Skip to contentSkip to conversation

hyperv: vmbus: ACPI various corrections

PATCH Superseded Jon Doron 2 participants 7 messages Jun 25, 2020 – Jul 13, 2020

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Jon Doron

author
#0 lore raw

v4 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.

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):
hyperv: vmbus: Remove the 2nd IRQ
acpi: i386: Move VMBus DSDT entry to SB

 hw/hyperv/vmbus.c                |  3 +--
 hw/i386/acpi-build.c             | 16 ++++++++--------
 include/hw/hyperv/vmbus-bridge.h |  3 +--
 3 files changed, 10 insertions(+), 12 deletions(-)
Signature · 1 line
2.24.1
author
#1 lore raw

PATCH v4 1/2 hyperv: vmbus: Remove the 2nd IRQ

It seems like Windows does not really require 2 IRQs to have a functioning VMBus.

---
 hw/hyperv/vmbus.c                | 3 +--
 hw/i386/acpi-build.c             | 4 +---
 include/hw/hyperv/vmbus-bridge.h | 3 +--
 3 files changed, 3 insertions(+), 7 deletions(-)
hw/hyperv/vmbus.c +1 -2
index f371240176..a8bcb41026 100644
@@ -2741,8 +2741,7 @@ static const VMStateDescription vmstate_vmbus_bridge = {
 };
 
 static Property vmbus_bridge_props[] = {
-    DEFINE_PROP_UINT8("irq0", VMBusBridge, irq0, 7),
-    DEFINE_PROP_UINT8("irq1", VMBusBridge, irq1, 13),
+    DEFINE_PROP_UINT8("irq", VMBusBridge, irq, 7),
     DEFINE_PROP_END_OF_LIST()
 };
 
hw/i386/acpi-build.c +1 -3
index 900f786d08..91af0d2d0d 100644
@@ -1082,9 +1082,7 @@ static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge)
     aml_append(dev, aml_name_decl("_PS3", aml_int(0x0)));
 
     crs = aml_resource_template();
-    aml_append(crs, aml_irq_no_flags(vmbus_bridge->irq0));
-    /* FIXME: newer HyperV gets by with only one IRQ */
-    aml_append(crs, aml_irq_no_flags(vmbus_bridge->irq1));
+    aml_append(crs, aml_irq_no_flags(vmbus_bridge->irq));
     aml_append(dev, aml_name_decl("_CRS", crs));
 
     return dev;
include/hw/hyperv/vmbus-bridge.h +1 -2
index c0a06d832c..33f93de64d 100644
@@ -19,8 +19,7 @@ typedef struct VMBus VMBus;
 typedef struct VMBusBridge {
     SysBusDevice parent_obj;
 
-    uint8_t irq0;
-    uint8_t irq1;
+    uint8_t irq;
 
     VMBus *bus;
 } VMBusBridge;
Signature · 1 line
2.24.1
author
#2 lore raw

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

In reply to Jon Doron
---
 hw/i386/acpi-build.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
hw/i386/acpi-build.c +7 -5
index 91af0d2d0d..1f938a53b2 100644
@@ -1091,7 +1091,6 @@ static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge)
 static void build_isa_devices_aml(Aml *table)
 {
     ISADevice *fdc = pc_find_fdc0();
-    VMBusBridge *vmbus_bridge = vmbus_bridge_find();
     bool ambiguous;
 
     Aml *scope = aml_scope("_SB.PCI0.ISA");
@@ -1112,10 +1111,6 @@ static void build_isa_devices_aml(Aml *table)
         isa_build_aml(ISA_BUS(obj), scope);
     }
 
-    if (vmbus_bridge) {
-        aml_append(scope, build_vmbus_device_aml(vmbus_bridge));
-    }
-
     aml_append(table, scope);
 }
 
@@ -1660,6 +1655,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();
 
@@ -1702,6 +1698,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 v4 2/2
#3 lore raw

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

Quoted 1 line · On Thu, 25 Jun 2020 07:50:11 +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 91af0d2d0d..1f938a53b2 100644
@@ -1091,7 +1091,6 @@ static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge)
 static void build_isa_devices_aml(Aml *table)
 {
     ISADevice *fdc = pc_find_fdc0();
-    VMBusBridge *vmbus_bridge = vmbus_bridge_find();
     bool ambiguous;
 
     Aml *scope = aml_scope("_SB.PCI0.ISA");
@@ -1112,10 +1111,6 @@ static void build_isa_devices_aml(Aml *table)
         isa_build_aml(ISA_BUS(obj), scope);
     }
 
-    if (vmbus_bridge) {
-        aml_append(scope, build_vmbus_device_aml(vmbus_bridge));
-    }
-
     aml_append(table, scope);
 }
 
@@ -1660,6 +1655,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();
 
@@ -1702,6 +1698,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 {
#4 lore raw
In reply to Jon Doron
Quoted 2 lines · On Thu, 25 Jun 2020 07:50:09 +0300 Jon Doron <[email protected]> wrote:

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

Michael,

could you queue it for 5.1, pls?

Quoted 19 lines

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):
hyperv: vmbus: Remove the 2nd IRQ
acpi: i386: Move VMBus DSDT entry to SB

 hw/hyperv/vmbus.c                |  3 +--
 hw/i386/acpi-build.c             | 16 ++++++++--------
 include/hw/hyperv/vmbus-bridge.h |  3 +--
 3 files changed, 10 insertions(+), 12 deletions(-)
#5 lore raw
In reply to Jon Doron
Quoted 2 lines · On Thu, 25 Jun 2020 07:50:09 +0300 Jon Doron <[email protected]> wrote:

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

Jon,
vmbus feature needs a testcase, could you look into it please? (see tests/qtest/bios-tables-test.c for an example. also look into comment blob at the top for the propper process for acpi patches/tests)

Quoted 19 lines

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):
hyperv: vmbus: Remove the 2nd IRQ
acpi: i386: Move VMBus DSDT entry to SB

 hw/hyperv/vmbus.c                |  3 +--
 hw/i386/acpi-build.c             | 16 ++++++++--------
 include/hw/hyperv/vmbus-bridge.h |  3 +--
 3 files changed, 10 insertions(+), 12 deletions(-)
author
#6 lore raw

Sure thing I'll try to take a look at it this weekend.

Jon.

Quoted 34 lines · On Mon, Jul 13, 2020, 11:44 Igor Mammedov <[email protected]> wrote:
Quoted 2 lines · On Thu, 25 Jun 2020 07:50:09 +0300 Jon Doron <[email protected]> wrote:

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

Jon,
vmbus feature needs a testcase, could you look into it please? (see tests/qtest/bios-tables-test.c for an example. also look into comment blob at the top for the propper process for acpi patches/tests)

Quoted 19 lines

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):
hyperv: vmbus: Remove the 2nd IRQ
acpi: i386: Move VMBus DSDT entry to SB

 hw/hyperv/vmbus.c                |  3 +--
 hw/i386/acpi-build.c             | 16 ++++++++--------
 include/hw/hyperv/vmbus-bridge.h |  3 +--
 3 files changed, 10 insertions(+), 12 deletions(-)