Skip to contentSkip to conversation

vfio: Fix vfio_rtl8168_quirk_data_read address offset

PATCH In review Thorsten Kohfeldt 2 participants 3 messages Oct 9, 2016 – Oct 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfio: Fix vfio_rtl8168_quirk_data_read address offset

From: Thorsten Kohfeldt <[email protected]>
Date: Sat, 24 Sep 2016 20:43:20 +0200
Subject: [PATCH] vfio: Fix vfio_rtl8168_quirk_data_read address offset

Introductory comment for rtl8168 VFIO MSI-X quirk states:
At BAR2 offset 0x70 there is a dword data register,

        offset 0x74 is a dword address register.

vfio: vfio_bar_read(0000:05:00.0:BAR2+0x70, 4) = 0xfee00398 // read data

Thus, correct offset for data read is 0x70,
but function vfio_rtl8168_quirk_data_read() wrongfully uses offset 0x74.

---
 hw/vfio/pci-quirks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci-quirks.c +1 -1
index bec694c..1e97bc4 100644
@@ -898,7 +898,7 @@ static uint64_t vfio_rtl8168_quirk_data_read(void *opaque,
 {
     VFIOrtl8168Quirk *rtl = opaque;
     VFIOPCIDevice *vdev = rtl->vdev;
-    uint64_t data = vfio_region_read(&vdev->bars[2].region, addr + 0x74, size);
+    uint64_t data = vfio_region_read(&vdev->bars[2].region, addr + 0x70, size);
 
     if (rtl->enabled && (vdev->pdev.cap_present & QEMU_PCI_CAP_MSIX)) {
         hwaddr offset = rtl->addr & 0xfff;
Signature · 1 line
2.5.5
#1 lore raw
Quoted 6 lines · On Sun, 9 Oct 2016 19:56:03 +0200 Thorsten Kohfeldt <[email protected]>…

From: Thorsten Kohfeldt <[email protected]>
Date: Sat, 24 Sep 2016 20:43:20 +0200
Subject: [PATCH] vfio: Fix vfio_rtl8168_quirk_data_read address offset

Introductory comment for rtl8168 VFIO MSI-X quirk states:
At BAR2 offset 0x70 there is a dword data register,

Quoted 7 lines
         offset 0x74 is a dword address register.

vfio: vfio_bar_read(0000:05:00.0:BAR2+0x70, 4) = 0xfee00398 // read data

Thus, correct offset for data read is 0x70,
but function vfio_rtl8168_quirk_data_read() wrongfully uses offset 0x74.

I need a real email address for these, can I replace this with your gmx.de email? Thanks,

Alex

Quoted 17 lines
---
  hw/vfio/pci-quirks.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci-quirks.c +1 -1
index bec694c..1e97bc4 100644
@@ -898,7 +898,7 @@ static uint64_t vfio_rtl8168_quirk_data_read(void *opaque,
  {
      VFIOrtl8168Quirk *rtl = opaque;
      VFIOPCIDevice *vdev = rtl->vdev;
-    uint64_t data = vfio_region_read(&vdev->bars[2].region, addr + 0x74, size);
+    uint64_t data = vfio_region_read(&vdev->bars[2].region, addr + 0x70, size);
 
      if (rtl->enabled && (vdev->pdev.cap_present & QEMU_PCI_CAP_MSIX)) {
          hwaddr offset = rtl->addr & 0xfff;
#2 lore raw

Am 10.10.2016 um 17:18 schrieb Alex Williamson:

Quoted 15 lines
Quoted 12 lines · On Sun, 9 Oct 2016 19:56:03 +0200 Thorsten Kohfeldt <[email protected]>…

From: Thorsten Kohfeldt <[email protected]>
Date: Sat, 24 Sep 2016 20:43:20 +0200
Subject: [PATCH] vfio: Fix vfio_rtl8168_quirk_data_read address offset

Introductory comment for rtl8168 VFIO MSI-X quirk states:
At BAR2 offset 0x70 there is a dword data register,

         offset 0x74 is a dword address register.

vfio: vfio_bar_read(0000:05:00.0:BAR2+0x70, 4) = 0xfee00398 // read data

Thus, correct offset for data read is 0x70,
but function vfio_rtl8168_quirk_data_read() wrongfully uses offset 0x74.

Quoted 6 lines
Quoted 1 line

I need a real email address for these, can I replace this with your gmx.de email? Thanks,

Alex

Yes, thank you for taking over from here.

Regards,

Thorsten

Quoted 19 lines
Quoted 17 lines
---
  hw/vfio/pci-quirks.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/vfio/pci-quirks.c +1 -1
index bec694c..1e97bc4 100644
@@ -898,7 +898,7 @@ static uint64_t vfio_rtl8168_quirk_data_read(void *opaque,
  {
      VFIOrtl8168Quirk *rtl = opaque;
      VFIOPCIDevice *vdev = rtl->vdev;
-    uint64_t data = vfio_region_read(&vdev->bars[2].region, addr + 0x74, size);
+    uint64_t data = vfio_region_read(&vdev->bars[2].region, addr + 0x70, size);
 
      if (rtl->enabled && (vdev->pdev.cap_present & QEMU_PCI_CAP_MSIX)) {
          hwaddr offset = rtl->addr & 0xfff;