All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
To: qemu-devel@nongnu.org
Cc: chen.fan.fnst@cn.fujitsu.com,
	Alex Williamson <alex.williamson@redhat.com>
Subject: [Qemu-devel] [RFC PATCH 2/4] pcie-aer: Fix command pcie_aer_inject_error is invalid
Date: Mon, 12 Jan 2015 11:04:27 +0800	[thread overview]
Message-ID: <dc4eb00521217a02e368af354288dd20b544a720.1421028274.git.chen.fan.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <cover.1421028274.git.chen.fan.fnst@cn.fujitsu.com>

in spec "PCI Express 3.0" section 6.2.6 Figure 6-3 virtual bridge part,
the flowchart showing tell us SERR# enable at Bridge Control register
associate with system error at Secondary Status register can send error
message. but bridge_control from dev->config is NULL, and SERR# was set
in dev->wmask in pcie_aer_init() which was implemented by root port and
swith devices, so we should add wmask (for w/r) bit set for bridge control.
we can user command like:
qemu_system_x86_64:
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,id=bridge1
-device x3130-upstream,bus=bridge1,id=up.1,addr=00.0
-device xio3130-downstream,bus=up.1,id=down.1,port=1,addr=00.0,chassis=5

(qemu) pcie_aer_inject_error net0 POISON_TLP

after that,
guest can output the error message.

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
---
 hw/pci/pcie_aer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index 7ca077a..571dc92 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -231,7 +231,8 @@ pcie_aer_msg_alldev(PCIDevice *dev, const PCIEAERMsg *msg)
  */
 static bool pcie_aer_msg_vbridge(PCIDevice *dev, const PCIEAERMsg *msg)
 {
-    uint16_t bridge_control = pci_get_word(dev->config + PCI_BRIDGE_CONTROL);
+    uint16_t bridge_control = pci_get_word(dev->config + PCI_BRIDGE_CONTROL) |
+                              pci_get_word(dev->wmask + PCI_BRIDGE_CONTROL);
 
     if (pcie_aer_msg_is_uncor(msg)) {
         /* Received System Error */
-- 
1.9.3

  parent reply	other threads:[~2015-01-12  3:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12  3:04 [Qemu-devel] [RFC PATCH 0/4] pass aer error to guest Chen Fan
2015-01-12  3:04 ` [Qemu-devel] [RFC PATCH 1/4] pcie_aer: fix typos in pcie_aer_inject_error comment Chen Fan
2015-01-12  3:04 ` Chen Fan [this message]
2015-01-12 13:56   ` [Qemu-devel] [RFC PATCH 2/4] pcie-aer: Fix command pcie_aer_inject_error is invalid Marcel Apfelbaum
2015-01-15  6:54     ` Chen Fan
2015-01-16  7:56     ` Chen Fan
2015-01-21  9:56       ` Chen Fan
2015-01-21 16:32         ` Marcel Apfelbaum
2015-01-12  3:04 ` [Qemu-devel] [RFC PATCH 3/4] vfio-pci: add aer capability support Chen Fan
2015-01-12 13:14   ` Paolo Bonzini
2015-01-15  8:45     ` Chen Fan
2015-01-12 15:26   ` Alex Williamson
2015-01-15  8:40     ` Chen Fan
2015-01-12  3:04 ` [Qemu-devel] [RFC PATCH 4/4] vfio-pci: pass the aer error to guest Chen Fan
2015-01-12 15:24   ` Alex Williamson
2015-01-28  8:51     ` Chen Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc4eb00521217a02e368af354288dd20b544a720.1421028274.git.chen.fan.fnst@cn.fujitsu.com \
    --to=chen.fan.fnst@cn.fujitsu.com \
    --cc=alex.williamson@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.