Skip to contentSkip to conversation

hyperv: vmbus: ACPI various corrections

PATCH Applied Jon Doron 7 participants 11 messages Jul 15, 2020 – Sep 12, 2020

lore
Share & tools
lore

Jon Doron

author
#0 lore raw

v5 cover hyperv: vmbus: ACPI various corrections

After doing further tests and looking at the latest HyperV ACPI DSDT. Do minor fix to our VMBus ACPI entry.

v5:
* Rebased on latest master
* Added a patch to fix 32bit compliation on VMBus

v4:
* Removed the patch which adds _ADR definition to the VMBus
* Correct the change which moves the VMBus under the SB

v3:
Removed accidental change for the dct submodule head

v2:
Renamed irq0 to irq now that there is a single IRQ required

Jon Doron (2):
acpi: i386: Move VMBus DSDT entry to SB
hw: hyperv: vmbus: Fix 32bit compilation

 hw/hyperv/vmbus.c    |  3 ++-
 hw/i386/acpi-build.c | 12 +++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
2.24.1
author
#1 lore raw

PATCH v5 1/2 acpi: i386: Move VMBus DSDT entry to SB

---
 hw/i386/acpi-build.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
hw/i386/acpi-build.c +7 -5
index b7bcbbbb2a..7708a27f70 100644
@@ -975,7 +975,6 @@ static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge)
 
 static void build_isa_devices_aml(Aml *table)
 {
-    VMBusBridge *vmbus_bridge = vmbus_bridge_find();
     bool ambiguous;
     Object *obj = object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous);
     Aml *scope;
@@ -986,10 +985,6 @@ static void build_isa_devices_aml(Aml *table)
     build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA");
     isa_build_aml(ISA_BUS(obj), scope);
 
-    if (vmbus_bridge) {
-        aml_append(scope, build_vmbus_device_aml(vmbus_bridge));
-    }
-
     aml_append(table, scope);
 }
 
@@ -1485,6 +1480,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
     PCIBus *bus = NULL;
     TPMIf *tpm = tpm_find();
     int i;
+    VMBusBridge *vmbus_bridge = vmbus_bridge_find();
 
     dsdt = init_aml_allocator();
 
@@ -1526,6 +1522,12 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         }
     }
 
+    if (vmbus_bridge) {
+        sb_scope = aml_scope("_SB");
+        aml_append(sb_scope, build_vmbus_device_aml(vmbus_bridge));
+        aml_append(dsdt, sb_scope);
+    }
+
     if (pcmc->legacy_cpu_hotplug) {
         build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base);
     } else {
Signature · 1 line
2.24.1
Reviewed-by on v5 1/2
#2 lore raw

Re: [PATCH v5 1/2] acpi: i386: Move VMBus DSDT entry to SB

Quoted 1 line · On Wed, 15 Jul 2020 11:43:25 +0300 Jon Doron <[email protected]> wrote:
Quoted 48 lines
---
 hw/i386/acpi-build.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
hw/i386/acpi-build.c +7 -5
index b7bcbbbb2a..7708a27f70 100644
@@ -975,7 +975,6 @@ static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge)
 
 static void build_isa_devices_aml(Aml *table)
 {
-    VMBusBridge *vmbus_bridge = vmbus_bridge_find();
     bool ambiguous;
     Object *obj = object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous);
     Aml *scope;
@@ -986,10 +985,6 @@ static void build_isa_devices_aml(Aml *table)
     build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA");
     isa_build_aml(ISA_BUS(obj), scope);
 
-    if (vmbus_bridge) {
-        aml_append(scope, build_vmbus_device_aml(vmbus_bridge));
-    }
-
     aml_append(table, scope);
 }
 
@@ -1485,6 +1480,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
     PCIBus *bus = NULL;
     TPMIf *tpm = tpm_find();
     int i;
+    VMBusBridge *vmbus_bridge = vmbus_bridge_find();
 
     dsdt = init_aml_allocator();
 
@@ -1526,6 +1522,12 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
         }
     }
 
+    if (vmbus_bridge) {
+        sb_scope = aml_scope("_SB");
+        aml_append(sb_scope, build_vmbus_device_aml(vmbus_bridge));
+        aml_append(dsdt, sb_scope);
+    }
+
     if (pcmc->legacy_cpu_hotplug) {
         build_legacy_cpu_hotplug_aml(dsdt, machine, pm->cpu_hp_io_base);
     } else {
author
#3 lore raw

PATCH v5 2/2 hw: hyperv: vmbus: Fix 32bit compilation

In reply to Jon Doron
---
 hw/hyperv/vmbus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/hyperv/vmbus.c +2 -1
index 34392e892a..c28bb4201b 100644
@@ -383,7 +383,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
             }
         }
 
-        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
+        p = (void *)(uintptr_t)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
+                off_in_page);
         if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
             memcpy(p, buf, cplen);
         } else {
Signature · 1 line
2.24.1
Tested-by Reviewed-by on v5 2/2
#4 lore raw

Re: [PATCH v5 2/2] hw: hyperv: vmbus: Fix 32bit compilation

Quoted 18 lines · Jon Doron
---
 hw/hyperv/vmbus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/hyperv/vmbus.c +1 -1
index 34392e892a..c28bb4201b 100644
@@ -383,7 +383,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void
 *buf, uint32_t len)
             }
         }
 
-        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
 off_in_page);
+        p = (void *)(uintptr_t)(((uintptr_t)iter->map &

TARGET_PAGE_MASK) |

Quoted 9 lines
+                off_in_page);
         if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
             memcpy(p, buf, cplen);
         } else {

--
2.24.1

It looks to me this patch should definitely be selected for 5.1.?

#5 lore raw

Re: [PATCH v5 2/2] hw: hyperv: vmbus: Fix 32bit compilation

Quoted 1 line · On Sat, 25 Jul 2020 14:16:08 +0200 Aleksandar Markovic…

On Wednesday, July 15, 2020, Jon Doron <[email protected]> wrote:

Michael,

could you merge it via your tree please?

Quoted 32 lines
Quoted 19 lines
---
 hw/hyperv/vmbus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/hyperv/vmbus.c +1 -1
index 34392e892a..c28bb4201b 100644
@@ -383,7 +383,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void
 *buf, uint32_t len)
             }
         }
 
-        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
 off_in_page);
+        p = (void *)(uintptr_t)(((uintptr_t)iter->map &

TARGET_PAGE_MASK) |

Quoted 9 lines
+                off_in_page);
         if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
             memcpy(p, buf, cplen);
         } else {

--
2.24.1

It looks to me this patch should definitely be selected for 5.1.?

#6 lore raw

Re: [PATCH v5 2/2] hw: hyperv: vmbus: Fix 32bit compilation

In reply to Jon Doron

Cc'ing qemu-trivial@

Can we add the commit description Richard wrote?

---
Fix 32-bit build error for vmbus:

hw/hyperv/vmbus.c: In function ‘gpadl_iter_io’:
hw/hyperv/vmbus.c:383:13: error: cast to pointer from integer of
different size [-Werror=int-to-pointer-cast]
383 | p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
off_in_page);
| ^
cc1: all warnings being treated as errors

Fixes 0d71f7082d7 ("vmbus: vmbus implementation")

---

Quoted 20 lines · Jon Doron
---
 hw/hyperv/vmbus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/hyperv/vmbus.c +2 -1
index 34392e892a..c28bb4201b 100644
@@ -383,7 +383,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
             }
         }
 
-        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
+        p = (void *)(uintptr_t)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
+                off_in_page);
         if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
             memcpy(p, buf, cplen);
         } else {
#7 lore raw

Re: [PATCH v5 2/2] hw: hyperv: vmbus: Fix 32bit compilation

Le 06/09/2020 à 12:14, Philippe Mathieu-Daudé a écrit :

Quoted 3 lines

Cc'ing qemu-trivial@

Can we add the commit description Richard wrote?

I have no message from Richard regarding this patch.

Thanks,
Laurent

Quoted 38 lines

---
Fix 32-bit build error for vmbus:

hw/hyperv/vmbus.c: In function ‘gpadl_iter_io’:
hw/hyperv/vmbus.c:383:13: error: cast to pointer from integer of
different size [-Werror=int-to-pointer-cast]
383 | p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
off_in_page);
| ^
cc1: all warnings being treated as errors

Fixes 0d71f7082d7 ("vmbus: vmbus implementation")

---

Quoted 20 lines · Jon Doron
---
 hw/hyperv/vmbus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
hw/hyperv/vmbus.c +2 -1
index 34392e892a..c28bb4201b 100644
@@ -383,7 +383,8 @@ static ssize_t gpadl_iter_io(GpadlIter *iter, void *buf, uint32_t len)
             }
         }
 
-        p = (void *)(((uintptr_t)iter->map & TARGET_PAGE_MASK) | off_in_page);
+        p = (void *)(uintptr_t)(((uintptr_t)iter->map & TARGET_PAGE_MASK) |
+                off_in_page);
         if (iter->dir == DMA_DIRECTION_FROM_DEVICE) {
             memcpy(p, buf, cplen);
         } else {
#9 lore raw

Re: [PATCH v5 2/2] hw: hyperv: vmbus: Fix 32bit compilation

Le 09/09/2020 à 18:18, Richard Henderson a écrit :

Quoted 11 lines · Laurent Vivier
Quoted 6 lines

Le 06/09/2020 à 12:14, Philippe Mathieu-Daudé a écrit :

Quoted 3 lines

Cc'ing qemu-trivial@

Can we add the commit description Richard wrote?

I have no message from Richard regarding this patch.

https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg02283.html

Different thread, same problem.

Thank you.

Applied to my trivial-patches branch.

Thanks,
Laurent

#10 lore raw
In reply to Jon Doron
Quoted 17 lines · Jon Doron

After doing further tests and looking at the latest HyperV ACPI DSDT. Do minor fix to our VMBus ACPI entry.

v5:
* Rebased on latest master
* Added a patch to fix 32bit compliation on VMBus

v4:
* Removed the patch which adds _ADR definition to the VMBus
* Correct the change which moves the VMBus under the SB

v3:
Removed accidental change for the dct submodule head

v2:
Renamed irq0 to irq now that there is a single IRQ required

Quoted 8 lines

Jon Doron (2):
acpi: i386: Move VMBus DSDT entry to SB
hw: hyperv: vmbus: Fix 32bit compilation

 hw/hyperv/vmbus.c    |  3 ++-
 hw/i386/acpi-build.c | 12 +++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

Queued, thanks.

Paolo