aer: fix wrong check on expose aer tlp prefix log
authorChen Fan <chen.fan.fnst@cn.fujitsu.com>
Fri, 13 Mar 2015 03:18:04 +0000 (11:18 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 18 Mar 2015 11:14:45 +0000 (12:14 +0100)
when specify TLP Prefix log as using pcie_aer_inject_error,
the TLP prefix log is always discarded. because the check
is incorrect, the End-End TLP Prefix Supported bit
(PCI_EXP_DEVCAP2_EETLPP) should be in Device Capabilities 2 Register.

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pcie_aer.c

index 5a25c32a3dff747fcc15b394d2041ba96ad6b8a5..c7fad3402c7f81d5b8d3bbeb1fe323511e003728 100644 (file)
@@ -433,7 +433,7 @@ static void pcie_aer_update_log(PCIDevice *dev, const PCIEAERErr *err)
     }
 
     if ((err->flags & PCIE_AER_ERR_TLP_PREFIX_PRESENT) &&
-        (pci_get_long(dev->config + dev->exp.exp_cap + PCI_EXP_DEVCTL2) &
+        (pci_get_long(dev->config + dev->exp.exp_cap + PCI_EXP_DEVCAP2) &
          PCI_EXP_DEVCAP2_EETLPP)) {
         for (i = 0; i < ARRAY_SIZE(err->prefix); ++i) {
             /* 7.10.12 tlp prefix log register */