Fix Q35 ACPI PCI Hot-plug I/O issues
cover Fix Q35 ACPI PCI Hot-plug I/O issues
Attempt [1] to fix I/O allocation with the 'reserve-io' hint on each pcie-root-port resulted in regression [2-3]. This patchset aims to fix it by addressing the root cause of the problem - the disabled PCIe Slot HPC bit.
[1] 'hw/pcie-root-port: Fix hotplug for PCI devices requiring IO'
[2] https://gitlab.com/qemu-project/qemu/-/issues/641
[3] https://bugzilla.redhat.com/show_bug.cgi?id=2006409
Julia Suvorova (5):
hw/pci/pcie_port: Rename 'native-hotplug' to 'native-hpc-bit' hw/acpi/ich9: Add compatibility option for 'native-hpc-bit'
bios-tables-test: Allow changes in DSDT ACPI tables hw/i386/acpi-build: Deny control on PCIe Native Hot-plug in _OSC
bios-tables-test: Update golden binaries
include/hw/acpi/ich9.h | 1 + include/hw/pci/pcie_port.h | 2 +- hw/acpi/ich9.c | 18 ++++++++++++++++++ hw/i386/acpi-build.c | 12 ++++++++---- hw/i386/pc.c | 2 ++ hw/i386/pc_q35.c | 9 +++++++-- hw/pci-bridge/gen_pcie_root_port.c | 6 +++++- hw/pci/pcie.c | 2 +- hw/pci/pcie_port.c | 2 +- tests/data/acpi/q35/DSDT | Bin 8289 -> 8289 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9614 -> 9614 bytes tests/data/acpi/q35/DSDT.bridge | Bin 11003 -> 11003 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8753 -> 8753 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 9943 -> 9943 bytes tests/data/acpi/q35/DSDT.dmar | Bin 0 -> 8289 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 8364 -> 8364 bytes tests/data/acpi/q35/DSDT.ivrs | Bin 8306 -> 8306 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9648 -> 9648 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 9419 -> 9419 bytes tests/data/acpi/q35/DSDT.multi-bridge | Bin 8583 -> 8583 bytes tests/data/acpi/q35/DSDT.nohpet | Bin 8147 -> 8147 bytes tests/data/acpi/q35/DSDT.nosmm | Bin 0 -> 8289 bytes tests/data/acpi/q35/DSDT.numamem | Bin 8295 -> 8295 bytes tests/data/acpi/q35/DSDT.smm-compat | Bin 0 -> 8289 bytes tests/data/acpi/q35/DSDT.smm-compat-nosmm | Bin 0 -> 8289 bytes tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 8894 -> 8894 bytes tests/data/acpi/q35/DSDT.tis.tpm2 | Bin 8894 -> 8894 bytes tests/data/acpi/q35/DSDT.xapic | Bin 35652 -> 35652 bytes 28 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 tests/data/acpi/q35/DSDT.dmar create mode 100644 tests/data/acpi/q35/DSDT.nosmm create mode 100644 tests/data/acpi/q35/DSDT.smm-compat create mode 100644 tests/data/acpi/q35/DSDT.smm-compat-nosmm
Signature · 1 line
2.31.1
PATCH 2/5 hw/acpi/ich9: Add compatibility option for 'native-hpc-bit'
To solve issues [1-2] the Hot Plug Capable bit in PCIe Slots will be turned on, while the switch to ACPI Hot-plug will be done in the DSDT table.
Introducing 'x-keep-native-hpc' option disables the HPC bit only in 6.1 and as a result keeps the forced 'reserve-io' on pcie-root-ports in 6.1 too.
[1] https://gitlab.com/qemu-project/qemu/-/issues/641
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2006409
--- include/hw/acpi/ich9.h | 1 + hw/acpi/ich9.c | 18 ++++++++++++++++++ hw/i386/pc.c | 2 ++ hw/i386/pc_q35.c | 7 ++++++- 4 files changed, 27 insertions(+), 1 deletion(-)
include/hw/acpi/ich9.h +1 -0
@@ -56,6 +56,7 @@ typedef struct ICH9LPCPMRegs {AcpiCpuHotplug gpe_cpu;CPUHotplugState cpuhp_state; +bool keep_pci_slot_hpc;bool use_acpi_hotplug_bridge;AcpiPciHpState acpi_pci_hotplug;MemHotplugState acpi_memory_hotplug;
hw/acpi/ich9.c +18 -0
@@ -419,6 +419,20 @@ static void ich9_pm_set_acpi_pci_hotplug(Object *obj, bool value, Error **errp) s->pm.use_acpi_hotplug_bridge = value; } +static bool ich9_pm_get_keep_pci_slot_hpc (Object *obj,Error **errp) +{ +ICH9LPCState *s =ICH9_LPC_DEVICE (obj); + +return s->pm.keep_pci_slot_hpc; +} + +static void ich9_pm_set_keep_pci_slot_hpc (Object *obj,bool value,Error **errp) +{ +ICH9LPCState *s =ICH9_LPC_DEVICE (obj); + + s->pm.keep_pci_slot_hpc = value; +} +void ich9_pm_add_properties (Object *obj,ICH9LPCPMRegs *pm) {static const uint32_t gpe0_len =ICH9_PMIO_GPE0_LEN ;
@@ -428,6 +442,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) pm->disable_s4 =0 ; pm->s4_val =2 ; pm->use_acpi_hotplug_bridge = true; + pm->keep_pci_slot_hpc = true;object_property_add_uint32_ptr (obj,ACPI_PM_PROP_PM_IO_BASE , &pm->pm_io_base,OBJ_PROP_FLAG_READ );
@@ -454,6 +469,9 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)object_property_add_bool (obj,ACPI_PM_PROP_ACPI_PCIHP_BRIDGE , ich9_pm_get_acpi_pci_hotplug, ich9_pm_set_acpi_pci_hotplug); +object_property_add_bool (obj,"x-keep-pci-slot-hpc" , + ich9_pm_get_keep_pci_slot_hpc, + ich9_pm_set_keep_pci_slot_hpc); } void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
hw/i386/pc.c +2 -0
@@ -98,6 +98,7 @@ GlobalProperty pc_compat_6_1[] = { { TYPE_X86_CPU, "hv-version-id-build", "0x1bbc" }, { TYPE_X86_CPU, "hv-version-id-major", "0x0006" }, { TYPE_X86_CPU, "hv-version-id-minor", "0x0001" }, + { "ICH9-LPC", "x-keep-pci-slot-hpc", "false" }, };const size_t pc_compat_6_1_len =G_N_ELEMENTS (pc_compat_6_1);
@@ -107,6 +108,7 @@ GlobalProperty pc_compat_6_0[] = { { "qemu64" "-" TYPE_X86_CPU, "stepping", "3" }, { TYPE_X86_CPU, "x-vendor-cpuid-only", "off" }, { "ICH9-LPC", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" }, + { "ICH9-LPC", "x-keep-pci-slot-hpc", "true" }, };const size_t pc_compat_6_0_len =G_N_ELEMENTS (pc_compat_6_0);
hw/i386/pc_q35.c +6 -1
@@ -137,6 +137,7 @@ static void pc_q35_init(MachineState *machine)DriveInfo *hd[MAX_SATA_PORTS ];MachineClass *mc =MACHINE_GET_CLASS (machine);bool acpi_pcihp; +bool keep_pci_slot_hpc;/* Check whether RAM fits below 4G (leaving 1/2 GByte for IO memory * and 256 Mbytes for PCI Express Enhanced Configuration Access Mapping
@@ -242,7 +243,11 @@ static void pc_q35_init(MachineState *machine)ACPI_PM_PROP_ACPI_PCIHP_BRIDGE , NULL); -if (acpi_pcihp) { + keep_pci_slot_hpc =object_property_get_bool (OBJECT (lpc), +"x-keep-pci-slot-hpc" , +NULL ); + +if (!keep_pci_slot_hpc && acpi_pcihp) {object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hpc-bit" ,"false" , true); }
Signature · 1 line
2.31.1
PATCH 5/5 bios-tables-test: Update golden binaries
In reply to Julia SuvorovaThe changes are the result of
'hw/i386/acpi-build: Deny control on PCIe Native Hot-Plug in _OSC'
and listed here:
Method (_OSC, 4, NotSerialized) // _OSC: Operating System Capabilities
{
CreateDWordField (Arg3, Zero, CDW1)
If ((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */))
{
CreateDWordField (Arg3, 0x04, CDW2)
CreateDWordField (Arg3, 0x08, CDW3)
Local0 = CDW3 /* \_SB_.PCI0._OSC.CDW3 */- Local0 &= 0x1F
+ Local0 &= 0x1E
--- tests/qtest/bios-tables-test-allowed-diff.h | 16 ---------------- tests/data/acpi/q35/DSDT | Bin 8289 -> 8289 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9614 -> 9614 bytes tests/data/acpi/q35/DSDT.bridge | Bin 11003 -> 11003 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8753 -> 8753 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 9943 -> 9943 bytes tests/data/acpi/q35/DSDT.dmar | Bin 0 -> 8289 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 8364 -> 8364 bytes tests/data/acpi/q35/DSDT.ivrs | Bin 8306 -> 8306 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9648 -> 9648 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 9419 -> 9419 bytes tests/data/acpi/q35/DSDT.multi-bridge | Bin 8583 -> 8583 bytes tests/data/acpi/q35/DSDT.nohpet | Bin 8147 -> 8147 bytes tests/data/acpi/q35/DSDT.nosmm | Bin 0 -> 8289 bytes tests/data/acpi/q35/DSDT.numamem | Bin 8295 -> 8295 bytes tests/data/acpi/q35/DSDT.smm-compat | Bin 0 -> 8289 bytes tests/data/acpi/q35/DSDT.smm-compat-nosmm | Bin 0 -> 8289 bytes tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 8894 -> 8894 bytes tests/data/acpi/q35/DSDT.tis.tpm2 | Bin 8894 -> 8894 bytes tests/data/acpi/q35/DSDT.xapic | Bin 35652 -> 35652 bytes 20 files changed, 16 deletions(-) create mode 100644 tests/data/acpi/q35/DSDT.dmar create mode 100644 tests/data/acpi/q35/DSDT.nosmm create mode 100644 tests/data/acpi/q35/DSDT.smm-compat create mode 100644 tests/data/acpi/q35/DSDT.smm-compat-nosmm
tests/qtest/bios-tables-test-allowed-diff.h +0 -16
@@ -1,17 +1 @@/* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/q35/DSDT" , -"tests/data/acpi/q35/DSDT.tis" , -"tests/data/acpi/q35/DSDT.bridge" , -"tests/data/acpi/q35/DSDT.mmio64" , -"tests/data/acpi/q35/DSDT.ipmibt" , -"tests/data/acpi/q35/DSDT.cphp" , -"tests/data/acpi/q35/DSDT.memhp" , -"tests/data/acpi/q35/DSDT.acpihmat" , -"tests/data/acpi/q35/DSDT.numamem" , -"tests/data/acpi/q35/DSDT.dimmpxm" , -"tests/data/acpi/q35/DSDT.nohpet" , -"tests/data/acpi/q35/DSDT.tis.tpm2" , -"tests/data/acpi/q35/DSDT.tis.tpm12" , -"tests/data/acpi/q35/DSDT.multi-bridge" , -"tests/data/acpi/q35/DSDT.ivrs" , -"tests/data/acpi/q35/DSDT.xapic",
tests/data/acpi/q35/DSDT binary +0 -0
tests/data/acpi/q35/DSDT.acpihmat binary +0 -0
tests/data/acpi/q35/DSDT.bridge binary +0 -0
tests/data/acpi/q35/DSDT.cphp binary +0 -0
tests/data/acpi/q35/DSDT.dimmpxm binary +0 -0
tests/data/acpi/q35/DSDT.dmar new file binary +0 -0
tests/data/acpi/q35/DSDT.ipmibt binary +0 -0
tests/data/acpi/q35/DSDT.ivrs binary +0 -0
tests/data/acpi/q35/DSDT.memhp binary +0 -0
tests/data/acpi/q35/DSDT.mmio64 binary +0 -0
tests/data/acpi/q35/DSDT.multi-bridge binary +0 -0
tests/data/acpi/q35/DSDT.nohpet binary +0 -0
tests/data/acpi/q35/DSDT.nosmm new file binary +0 -0
tests/data/acpi/q35/DSDT.numamem binary +0 -0
tests/data/acpi/q35/DSDT.smm-compat new file binary +0 -0
tests/data/acpi/q35/DSDT.smm-compat-nosmm new file binary +0 -0
tests/data/acpi/q35/DSDT.tis.tpm12 binary +0 -0
tests/data/acpi/q35/DSDT.tis.tpm2 binary +0 -0
tests/data/acpi/q35/DSDT.xapic binary +0 -0
Signature · 1 line
2.31.1
PATCH 1/5 hw/pci/pcie_port: Rename 'native-hotplug' to 'native-hpc-bit'
In reply to Julia SuvorovaRename the option to better represent its function - toggle Hot-Plug Capable bit in the PCIe Slot Capability.
--- include/hw/pci/pcie_port.h | 2 +- hw/i386/pc_q35.c | 2 +- hw/pci-bridge/gen_pcie_root_port.c | 6 +++++- hw/pci/pcie.c | 2 +- hw/pci/pcie_port.c | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-)
include/hw/pci/pcie_port.h +1 -1
@@ -60,7 +60,7 @@ struct PCIESlot {/* Indicates whether any type of hot-plug is allowed on the slot */ bool hotplug; -bool native_hotplug; +bool native_hpc_bit;QLIST_ENTRY (PCIESlot) next; };
hw/i386/pc_q35.c +1 -1
@@ -243,7 +243,7 @@ static void pc_q35_init(MachineState *machine) NULL);if (acpi_pcihp) { -object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hotplug" , +object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hpc-bit" ,"false" , true); }
hw/pci-bridge/gen_pcie_root_port.c +5 -1
@@ -87,7 +87,11 @@ static void gen_rp_realize(DeviceState *dev, Error **errp)return ; } -if (grp->res_reserve.io ==-1 && s->hotplug && !s->native_hotplug) { +/* +* Make sure that IO is assigned in case the slot is hot-pluggable +* but it is not visible through the PCIe Slot Capabilities +*/ +if (grp->res_reserve.io ==-1 && s->hotplug && !s->native_hpc_bit) { grp->res_reserve.io =GEN_PCIE_ROOT_DEFAULT_IO_RANGE ; } int rc = pci_bridge_qemu_reserve_cap_init(d, 0,
hw/pci/pcie.c +1 -1
@@ -535,7 +535,7 @@ void pcie_cap_slot_init(PCIDevice *dev, PCIESlot *s)* hot-plug is disabled on the slot. */ if (s->hotplug && - (s->native_hotplug ||DEVICE (dev)->hotplugged)) { + (s->native_hpc_bit ||DEVICE (dev)->hotplugged)) {pci_long_test_and_set_mask (dev->config + pos +PCI_EXP_SLTCAP ,PCI_EXP_SLTCAP_HPS |PCI_EXP_SLTCAP_HPC );
hw/pci/pcie_port.c +1 -1
@@ -148,7 +148,7 @@ static Property pcie_slot_props[] = {DEFINE_PROP_UINT8 ("chassis" , PCIESlot, chassis,0 ),DEFINE_PROP_UINT16 ("slot" , PCIESlot, slot,0 ),DEFINE_PROP_BOOL ("hotplug" , PCIESlot, hotplug, true), -DEFINE_PROP_BOOL ("native-hotplug" , PCIESlot, native_hotplug, true), +DEFINE_PROP_BOOL ("native-hpc-bit" , PCIESlot, native_hpc_bit, true), DEFINE_PROP_END_OF_LIST() };
Signature · 1 line
2.31.1
PATCH 3/5 bios-tables-test: Allow changes in DSDT ACPI tables
In reply to Julia SuvorovaPrepare for changing the _OSC method in q35 DSDT.
--- tests/qtest/bios-tables-test-allowed-diff.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
tests/qtest/bios-tables-test-allowed-diff.h +16 -0
@@ -1 +1,17 @@/* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/DSDT" , +"tests/data/acpi/q35/DSDT.tis" , +"tests/data/acpi/q35/DSDT.bridge" , +"tests/data/acpi/q35/DSDT.mmio64" , +"tests/data/acpi/q35/DSDT.ipmibt" , +"tests/data/acpi/q35/DSDT.cphp" , +"tests/data/acpi/q35/DSDT.memhp" , +"tests/data/acpi/q35/DSDT.acpihmat" , +"tests/data/acpi/q35/DSDT.numamem" , +"tests/data/acpi/q35/DSDT.dimmpxm" , +"tests/data/acpi/q35/DSDT.nohpet" , +"tests/data/acpi/q35/DSDT.tis.tpm2" , +"tests/data/acpi/q35/DSDT.tis.tpm12" , +"tests/data/acpi/q35/DSDT.multi-bridge" , +"tests/data/acpi/q35/DSDT.ivrs" , +"tests/data/acpi/q35/DSDT.xapic",
Signature · 1 line
2.31.1
PATCH 4/5 hw/i386/acpi-build: Deny control on PCIe Native Hot-plug in _OSC
In reply to Julia SuvorovaThere are two ways to enable ACPI PCI Hot-plug:
* Disable the Hot-plug Capable bit on PCIe slots.
This was the first approach which led to regression [1-2], as I/O space for a port is allocated only when it is hot-pluggable, which is determined by HPC bit.
* Leave the HPC bit on and disable PCIe Native Hot-plug in _OSC method.
This removes the (future) ability of hot-plugging switches with PCIe Native hotplug since ACPI PCI Hot-plug only works with cold-plugged bridges. If the user wants to explicitely use this feature, they can disable ACPI PCI Hot-plug with:
--global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
Change the bit in _OSC method so that the OS selects ACPI PCI Hot-plug instead of PCIe Native.
[1] https://gitlab.com/qemu-project/qemu/-/issues/641
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2006409
--- hw/i386/acpi-build.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
hw/i386/acpi-build.c +8 -4
@@ -1337,7 +1337,7 @@ static void build_x86_acpi_pci_hotplug(Aml *table, uint64_t pcihp_addr)aml_append (table, scope); } -static Aml *build_q35_osc_method (void ) +static Aml *build_q35_osc_method (bool acpi_pcihp) {Aml *if_ctx;Aml *if_ctx2;
@@ -1345,6 +1345,7 @@ static Aml *build_q35_osc_method(void)Aml *method;Aml *a_cwd1 =aml_name ("CDW1" );Aml *a_ctrl =aml_local (0 ); +const uint64_t hotplug = acpi_pcihp ?0x1E :0x1F ; method =aml_method ("_OSC" ,4 ,AML_NOTSERIALIZED );aml_append (method,aml_create_dword_field (aml_arg (3 ),aml_int (0 ),"CDW1" ));
@@ -1359,8 +1360,9 @@ static Aml *build_q35_osc_method(void)/* * Always allow native PME, AER (no dependencies) * Allow SHPC (PCI bridges can have SHPC controller) +* Disable PCIe Native Hot-plug if ACPI PCI Hot-plug is enabled. */ -aml_append (if_ctx,aml_and (a_ctrl,aml_int (0x1F ), a_ctrl)); +aml_append (if_ctx,aml_and (a_ctrl,aml_int (hotplug), a_ctrl)); if_ctx2 =aml_if (aml_lnot (aml_equal (aml_arg (1 ),aml_int (1 ))));/* Unknown revision */
@@ -1449,7 +1451,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" )));aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (pcmc->pci_root_uid))); -aml_append (dev,build_q35_osc_method ()); +aml_append (dev,build_q35_osc_method (pm->pcihp_bridge_en));aml_append (sb_scope, dev);if (mcfg_valid) {aml_append (sb_scope,build_q35_dram_controller (&mcfg));
@@ -1565,7 +1567,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,if (pci_bus_is_express (bus)) {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" )));aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" ))); -aml_append (dev,build_q35_osc_method ()); + +/* Expander bridges do not have ACPI PCI Hot-plug enabled */ +aml_append (dev,build_q35_osc_method (false)); }else {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A03" ))); }
Signature · 1 line
2.31.1
Re: [PATCH 1/5] hw/pci/pcie_port: Rename 'native-hotplug' to 'native-hpc-bit'
In reply to Julia Suvorovahw/i386/pc_q35.c
Quoted 26 lines · Julia Suvorova
Rename the option to better represent its function - toggle Hot-Plug Capable bit in the PCIe Slot Capability.
Signed-off-by Julia Suvorova <[email protected]>--- include/hw/pci/pcie_port.h | 2 +- hw/i386/pc_q35.c | 2 +- hw/pci-bridge/gen_pcie_root_port.c | 6 +++++- hw/pci/pcie.c | 2 +- hw/pci/pcie_port.c | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-)include/hw/pci/pcie_port.h +1
-1@@ -60,7 +60,7 @@ struct PCIESlot {/* Indicates whether any type of hot-plug is allowed on the slot */ bool hotplug; -bool native_hotplug; +bool native_hpc_bit;QLIST_ENTRY (PCIESlot) next; };hw/i386/pc_q35.c +0
-0
This is ok.
hw/i386/pc_q35.c static void pc_q35_init(MachineState *machine) · line 249
Quoted 12 lines
index
797e09500b..ded61f8ef7100644hw/i386/pc_q35.c +1
-1@@ -243,7 +243,7 @@ static void pc_q35_init(MachineState *machine) NULL);if (acpi_pcihp) { -object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hotplug" , +object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hpc-bit" ,"false" , true); }
This part is problematic since we made the feature user-settable in 6.1. We can have two features if we really want to ...
I don't think we have a way to mark properties deprecated, do we?
Quoted 45 lines
hw/pci-bridge/gen_pcie_root_port.c +5
-1@@ -87,7 +87,11 @@ static void gen_rp_realize(DeviceState *dev, Error **errp)return ; } -if (grp->res_reserve.io ==-1 && s->hotplug && !s->native_hotplug) { +/* +* Make sure that IO is assigned in case the slot is hot-pluggable +* but it is not visible through the PCIe Slot Capabilities +*/ +if (grp->res_reserve.io ==-1 && s->hotplug && !s->native_hpc_bit) { grp->res_reserve.io =GEN_PCIE_ROOT_DEFAULT_IO_RANGE ; } int rc = pci_bridge_qemu_reserve_cap_init(d, 0,hw/pci/pcie.c +1
-1@@ -535,7 +535,7 @@ void pcie_cap_slot_init(PCIDevice *dev, PCIESlot *s)* hot-plug is disabled on the slot. */ if (s->hotplug && - (s->native_hotplug ||DEVICE (dev)->hotplugged)) { + (s->native_hpc_bit ||DEVICE (dev)->hotplugged)) {pci_long_test_and_set_mask (dev->config + pos +PCI_EXP_SLTCAP ,PCI_EXP_SLTCAP_HPS |PCI_EXP_SLTCAP_HPC );hw/pci/pcie_port.c +1
-1@@ -148,7 +148,7 @@ static Property pcie_slot_props[] = {DEFINE_PROP_UINT8 ("chassis" , PCIESlot, chassis,0 ),DEFINE_PROP_UINT16 ("slot" , PCIESlot, slot,0 ),DEFINE_PROP_BOOL ("hotplug" , PCIESlot, hotplug, true), -DEFINE_PROP_BOOL ("native-hotplug" , PCIESlot, native_hotplug, true), +DEFINE_PROP_BOOL ("native-hpc-bit" , PCIESlot, native_hpc_bit, true), DEFINE_PROP_END_OF_LIST() };Signature · 1 line
2.31.1
Re: [PATCH 4/5] hw/i386/acpi-build: Deny control on PCIe Native Hot-plug in _OSC
In reply to Julia SuvorovaQuoted 42 lines · Julia Suvorova
There are two ways to enable ACPI PCI Hot-plug:
* Disable the Hot-plug Capable bit on PCIe slots.
This was the first approach which led to regression [1-2], as I/O space for a port is allocated only when it is hot-pluggable, which is determined by HPC bit.
* Leave the HPC bit on and disable PCIe Native Hot-plug in
_OSCmethod.This removes the (future) ability of hot-plugging switches with PCIe Native hotplug since ACPI PCI Hot-plug only works with cold-plugged bridges. If the user wants to explicitely use this feature, they can disable ACPI PCI Hot-plug with:
--global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=offChange the bit in
_OSCmethod so that the OS selects ACPI PCI Hot-plug instead of PCIe Native.[1] https://gitlab.com/qemu-project/qemu/-/issues/641
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2006409Signed-off-by Julia Suvorova <[email protected]>--- hw/i386/acpi-build.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)hw/i386/acpi-build.c +1
-1@@ -1337,7 +1337,7 @@ static void build_x86_acpi_pci_hotplug(Aml *table, uint64_t pcihp_addr)aml_append (table, scope); } -static Aml *build_q35_osc_method (void ) +static Aml *build_q35_osc_method (bool acpi_pcihp) {Aml *if_ctx;Aml *if_ctx2;
hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1348
Quoted 4 lines
hw/i386/acpi-build.c +1
-0@@ -1345,6 +1345,7 @@ static Aml *build_q35_osc_method(void)Aml *method;Aml *a_cwd1 =aml_name ("CDW1" );Aml *a_ctrl =aml_local (0 ); +const uint64_t hotplug = acpi_pcihp ?0x1E :0x1F ;
drop this variable and open-code at use point below. As it is the comment is misplaced.
Also a slightly better way to write this:0x1E | (acpi_pcihp ? 0x0 : 0x1)
hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1351
Quoted 3 lines
hw/i386/acpi-build.c +0
-0method =aml_method ("_OSC" ,4 ,AML_NOTSERIALIZED );aml_append (method,aml_create_dword_field (aml_arg (3 ),aml_int (0 ),"CDW1" ));
So what acpi_pcihp does is enable/disable native pcie hotplug. How about we call the option exactly that?
hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1366
Quoted 9 lines
hw/i386/acpi-build.c +2
-1@@ -1359,8 +1360,9 @@ static Aml *build_q35_osc_method(void)/* * Always allow native PME, AER (no dependencies) * Allow SHPC (PCI bridges can have SHPC controller) +* Disable PCIe Native Hot-plug if ACPI PCI Hot-plug is enabled. */ -aml_append (if_ctx,aml_and (a_ctrl,aml_int (0x1F ), a_ctrl)); +aml_append (if_ctx,aml_and (a_ctrl,aml_int (hotplug), a_ctrl));
using the variable hotplug just made things confusing, open-coding will be clearer.
hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1457
Quoted 11 lines
hw/i386/acpi-build.c +1
-1if_ctx2 =aml_if (aml_lnot (aml_equal (aml_arg (1 ),aml_int (1 ))));/* Unknown revision */ @@ -1449,7 +1451,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" )));aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (pcmc->pci_root_uid))); -aml_append (dev,build_q35_osc_method ()); +aml_append (dev,build_q35_osc_method (pm->pcihp_bridge_en));aml_append (sb_scope, dev);if (mcfg_valid) {aml_append (sb_scope,build_q35_dram_controller (&mcfg));
One of the complaints of libvirt people was that the name is confusing. It seems to say whether to describe bridges in ACPI but it also disables native hotplug, but only for PCIe.
Maybe we should address this with flags saying whether to enable each of acpi,pcie,shpc hotplug separately...
Quoted 13 lines
hw/i386/acpi-build.c +3
-1@@ -1565,7 +1567,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,if (pci_bus_is_express (bus)) {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" )));aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" ))); -aml_append (dev,build_q35_osc_method ()); + +/* Expander bridges do not have ACPI PCI Hot-plug enabled */ +aml_append (dev,build_q35_osc_method (false)); }else {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A03" ))); }Signature · 1 line
2.31.1
Re: [PATCH 1/5] hw/pci/pcie_port: Rename 'native-hotplug' to 'native-hpc-bit'
In reply to Michael S. TsirkinQuoted 38 lines · Michael S. Tsirkin
hw/i386/pc_q35.c
Quoted 26 lines · Julia Suvorova
Rename the option to better represent its function - toggle Hot-Plug Capable bit in the PCIe Slot Capability.
Signed-off-by Julia Suvorova <[email protected]>--- include/hw/pci/pcie_port.h | 2 +- hw/i386/pc_q35.c | 2 +- hw/pci-bridge/gen_pcie_root_port.c | 6 +++++- hw/pci/pcie.c | 2 +- hw/pci/pcie_port.c | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-)include/hw/pci/pcie_port.h +1
-1@@ -60,7 +60,7 @@ struct PCIESlot {/* Indicates whether any type of hot-plug is allowed on the slot */ bool hotplug; -bool native_hotplug; +bool native_hpc_bit;QLIST_ENTRY (PCIESlot) next; };hw/i386/pc_q35.c +0
-0This is ok.
Quoted 6 lines
index
797e09500b..ded61f8ef7100644hw/i386/pc_q35.c +0
-0@@ -243,7 +243,7 @@ static void pc_q35_init(MachineState *machine) NULL);
Quoted 11 lines
hw/i386/pc_q35.c static void pc_q35_init(MachineState *machine) · line 249
Quoted 6 lines
hw/i386/pc_q35.c +1
-1if (acpi_pcihp) { -object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hotplug" , +object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hpc-bit" ,"false" , true); }This part is problematic since we made the feature user-settable in 6.1. We can have two features if we really want to ...
I don't think we have a way to mark properties deprecated, do we?
IMHO just leave the feature with its current name. It won't be the first thing without a "perfect" name and the name doesn't have a negative impact on mgmt apps. Changing the name will cause more pain than it solves.
Quoted 44 lines
Quoted 44 lines
hw/pci-bridge/gen_pcie_root_port.c +5
-1@@ -87,7 +87,11 @@ static void gen_rp_realize(DeviceState *dev, Error **errp)return ; } -if (grp->res_reserve.io ==-1 && s->hotplug && !s->native_hotplug) { +/* +* Make sure that IO is assigned in case the slot is hot-pluggable +* but it is not visible through the PCIe Slot Capabilities +*/ +if (grp->res_reserve.io ==-1 && s->hotplug && !s->native_hpc_bit) { grp->res_reserve.io =GEN_PCIE_ROOT_DEFAULT_IO_RANGE ; } int rc = pci_bridge_qemu_reserve_cap_init(d, 0,hw/pci/pcie.c +1
-1@@ -535,7 +535,7 @@ void pcie_cap_slot_init(PCIDevice *dev, PCIESlot *s)* hot-plug is disabled on the slot. */ if (s->hotplug && - (s->native_hotplug ||DEVICE (dev)->hotplugged)) { + (s->native_hpc_bit ||DEVICE (dev)->hotplugged)) {pci_long_test_and_set_mask (dev->config + pos +PCI_EXP_SLTCAP ,PCI_EXP_SLTCAP_HPS |PCI_EXP_SLTCAP_HPC );hw/pci/pcie_port.c +1
-1@@ -148,7 +148,7 @@ static Property pcie_slot_props[] = {DEFINE_PROP_UINT8 ("chassis" , PCIESlot, chassis,0 ),DEFINE_PROP_UINT16 ("slot" , PCIESlot, slot,0 ),DEFINE_PROP_BOOL ("hotplug" , PCIESlot, hotplug, true), -DEFINE_PROP_BOOL ("native-hotplug" , PCIESlot, native_hotplug, true), +DEFINE_PROP_BOOL ("native-hpc-bit" , PCIESlot, native_hpc_bit, true), DEFINE_PROP_END_OF_LIST() };
Quoted 4 lines
Quoted 2 lines
Signature · 1 line
2.31.1
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [PATCH 2/5] hw/acpi/ich9: Add compatibility option for 'native-hpc-bit'
In reply to Julia SuvorovaQuoted 7 lines · On Wed, 10 Nov 2021 06:30:11 +0100 Julia Suvorova <[email protected]> wrote:
To solve issues [1-2] the Hot Plug Capable bit in PCIe Slots will be turned on, while the switch to ACPI Hot-plug will be done in the DSDT table.
Introducing 'x-keep-native-hpc' option disables the HPC bit only in 6.1 and as a result keeps the forced 'reserve-io' on pcie-root-ports in 6.1 too.
using property from the 1st patch (native-hotplug), should be enough to keep 6.1 ABI, so this patch is likely not needed.
Quoted 112 lines
[1] https://gitlab.com/qemu-project/qemu/-/issues/641
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2006409Signed-off-by Julia Suvorova <[email protected]>--- include/hw/acpi/ich9.h | 1 + hw/acpi/ich9.c | 18 ++++++++++++++++++ hw/i386/pc.c | 2 ++ hw/i386/pc_q35.c | 7 ++++++- 4 files changed, 27 insertions(+), 1 deletion(-)include/hw/acpi/ich9.h +1
-0@@ -56,6 +56,7 @@ typedef struct ICH9LPCPMRegs {AcpiCpuHotplug gpe_cpu;CPUHotplugState cpuhp_state; +bool keep_pci_slot_hpc;bool use_acpi_hotplug_bridge;AcpiPciHpState acpi_pci_hotplug;MemHotplugState acpi_memory_hotplug;hw/acpi/ich9.c +18
-0@@ -419,6 +419,20 @@ static void ich9_pm_set_acpi_pci_hotplug(Object *obj, bool value, Error **errp) s->pm.use_acpi_hotplug_bridge = value; } +static bool ich9_pm_get_keep_pci_slot_hpc (Object *obj,Error **errp) +{ +ICH9LPCState *s =ICH9_LPC_DEVICE (obj); + +return s->pm.keep_pci_slot_hpc; +} + +static void ich9_pm_set_keep_pci_slot_hpc (Object *obj,bool value,Error **errp) +{ +ICH9LPCState *s =ICH9_LPC_DEVICE (obj); + + s->pm.keep_pci_slot_hpc = value; +} +void ich9_pm_add_properties (Object *obj,ICH9LPCPMRegs *pm) {static const uint32_t gpe0_len =ICH9_PMIO_GPE0_LEN ;@@ -428,6 +442,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) pm->disable_s4 =0 ; pm->s4_val =2 ; pm->use_acpi_hotplug_bridge = true; + pm->keep_pci_slot_hpc = true;object_property_add_uint32_ptr (obj,ACPI_PM_PROP_PM_IO_BASE , &pm->pm_io_base,OBJ_PROP_FLAG_READ );@@ -454,6 +469,9 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)object_property_add_bool (obj,ACPI_PM_PROP_ACPI_PCIHP_BRIDGE , ich9_pm_get_acpi_pci_hotplug, ich9_pm_set_acpi_pci_hotplug); +object_property_add_bool (obj,"x-keep-pci-slot-hpc" , + ich9_pm_get_keep_pci_slot_hpc, + ich9_pm_set_keep_pci_slot_hpc); } void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,hw/i386/pc.c +2
-0@@ -98,6 +98,7 @@ GlobalProperty pc_compat_6_1[] = { { TYPE_X86_CPU, "hv-version-id-build", "0x1bbc" }, { TYPE_X86_CPU, "hv-version-id-major", "0x0006" }, { TYPE_X86_CPU, "hv-version-id-minor", "0x0001" }, + { "ICH9-LPC", "x-keep-pci-slot-hpc", "false" }, };const size_t pc_compat_6_1_len =G_N_ELEMENTS (pc_compat_6_1);@@ -107,6 +108,7 @@ GlobalProperty pc_compat_6_0[] = { { "qemu64" "-" TYPE_X86_CPU, "stepping", "3" }, { TYPE_X86_CPU, "x-vendor-cpuid-only", "off" }, { "ICH9-LPC", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" }, + { "ICH9-LPC", "x-keep-pci-slot-hpc", "true" }, };const size_t pc_compat_6_0_len =G_N_ELEMENTS (pc_compat_6_0);hw/i386/pc_q35.c +6
-1@@ -137,6 +137,7 @@ static void pc_q35_init(MachineState *machine)DriveInfo *hd[MAX_SATA_PORTS ];MachineClass *mc =MACHINE_GET_CLASS (machine);bool acpi_pcihp; +bool keep_pci_slot_hpc;/* Check whether RAM fits below 4G (leaving 1/2 GByte for IO memory * and 256 Mbytes for PCI Express Enhanced Configuration Access Mapping @@ -242,7 +243,11 @@ static void pc_q35_init(MachineState *machine)ACPI_PM_PROP_ACPI_PCIHP_BRIDGE , NULL); -if (acpi_pcihp) { + keep_pci_slot_hpc =object_property_get_bool (OBJECT (lpc), +"x-keep-pci-slot-hpc" , +NULL ); + +if (!keep_pci_slot_hpc && acpi_pcihp) {object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hpc-bit" ,"false" , true); }
Re: [PATCH 1/5] hw/pci/pcie_port: Rename 'native-hotplug' to 'native-hpc-bit'
In reply to Daniel P. BerrangéQuoted 39 lines · On Wed, 10 Nov 2021 09:08:34 +0000 Daniel P. Berrangé <[email protected]>…
Quoted 38 lines · Michael S. Tsirkin
hw/i386/pc_q35.c
Quoted 26 lines · Julia Suvorova
Rename the option to better represent its function - toggle Hot-Plug Capable bit in the PCIe Slot Capability.
Signed-off-by Julia Suvorova <[email protected]>--- include/hw/pci/pcie_port.h | 2 +- hw/i386/pc_q35.c | 2 +- hw/pci-bridge/gen_pcie_root_port.c | 6 +++++- hw/pci/pcie.c | 2 +- hw/pci/pcie_port.c | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-)include/hw/pci/pcie_port.h +1
-1@@ -60,7 +60,7 @@ struct PCIESlot {/* Indicates whether any type of hot-plug is allowed on the slot */ bool hotplug; -bool native_hotplug; +bool native_hpc_bit;QLIST_ENTRY (PCIESlot) next; };hw/i386/pc_q35.c +0
-0This is ok.
Quoted 6 lines
index
797e09500b..ded61f8ef7100644hw/i386/pc_q35.c +0
-0@@ -243,7 +243,7 @@ static void pc_q35_init(MachineState *machine) NULL);
Quoted 11 lines
Quoted 11 lines
hw/i386/pc_q35.c static void pc_q35_init(MachineState *machine) · line 249
Quoted 6 lines
hw/i386/pc_q35.c +1
-1if (acpi_pcihp) { -object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hotplug" , +object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hpc-bit" ,"false" , true); }This part is problematic since we made the feature user-settable in 6.1. We can have two features if we really want to ...
I don't think we have a way to mark properties deprecated, do we?
describe them in deprecated.rst
Quoted 5 lines
IMHO just leave the feature with its current name. It won't be the first thing without a "perfect" name and the name doesn't have a negative impact on mgmt apps. Changing the name will cause more pain than it solves.
looking at the code, it was introduced in 6.1 for internal needs mostly
3f3cbbb23 hw/pci/pcie: Do not set HPC flag if acpihp is used
to hide slot from guest's native-hotplug module.
Even if user tried explicitly to set native-hoplug=on on a slot with ACPI hotplug enabled, native hotplug will not work properly as slot's hotplug is still handled by acpi_pcihp_device_plug_cb().
Given above and that it shouldn't been used by users,
I'd rather rename it to x-native-hotplug now than go through deprecation process and expose it for 2 more releases.
Quoted 51 lines
Quoted 44 lines
Quoted 44 lines
hw/pci-bridge/gen_pcie_root_port.c +5
-1@@ -87,7 +87,11 @@ static void gen_rp_realize(DeviceState *dev, Error **errp)return ; } -if (grp->res_reserve.io ==-1 && s->hotplug && !s->native_hotplug) { +/* +* Make sure that IO is assigned in case the slot is hot-pluggable +* but it is not visible through the PCIe Slot Capabilities +*/ +if (grp->res_reserve.io ==-1 && s->hotplug && !s->native_hpc_bit) { grp->res_reserve.io =GEN_PCIE_ROOT_DEFAULT_IO_RANGE ; } int rc = pci_bridge_qemu_reserve_cap_init(d, 0,hw/pci/pcie.c +1
-1@@ -535,7 +535,7 @@ void pcie_cap_slot_init(PCIDevice *dev, PCIESlot *s)* hot-plug is disabled on the slot. */ if (s->hotplug && - (s->native_hotplug ||DEVICE (dev)->hotplugged)) { + (s->native_hpc_bit ||DEVICE (dev)->hotplugged)) {pci_long_test_and_set_mask (dev->config + pos +PCI_EXP_SLTCAP ,PCI_EXP_SLTCAP_HPS |PCI_EXP_SLTCAP_HPC );hw/pci/pcie_port.c +1
-1@@ -148,7 +148,7 @@ static Property pcie_slot_props[] = {DEFINE_PROP_UINT8 ("chassis" , PCIESlot, chassis,0 ),DEFINE_PROP_UINT16 ("slot" , PCIESlot, slot,0 ),DEFINE_PROP_BOOL ("hotplug" , PCIESlot, hotplug, true), -DEFINE_PROP_BOOL ("native-hotplug" , PCIESlot, native_hotplug, true), +DEFINE_PROP_BOOL ("native-hpc-bit" , PCIESlot, native_hpc_bit, true), DEFINE_PROP_END_OF_LIST() };Quoted 4 lines
Quoted 2 lines
Signature · 1 line
2.31.1Regards,
Daniel
Re: [PATCH 2/5] hw/acpi/ich9: Add compatibility option for 'native-hpc-bit'
In reply to Igor MammedovQuoted 7 lines · On Wed, 10 Nov 2021 14:33:54 +0100 Igor Mammedov <[email protected]> wrote:
Quoted 4 lines · On Wed, 10 Nov 2021 06:30:11 +0100 Julia Suvorova <[email protected]> wrote:
To solve issues [1-2] the Hot Plug Capable bit in PCIe Slots will be turned on, while the switch to ACPI Hot-plug will be done in the DSDT table.
Quoted 7 lines
Quoted 3 lines
Introducing 'x-keep-native-hpc' option disables the HPC bit only in 6.1 and as a result keeps the forced 'reserve-io' on pcie-root-ports in 6.1 too.
using property from the 1st patch (native-hotplug), should be enough to keep 6.1 ABI, so this patch is likely not needed.
scratch this off, it's conditional on acpihp which compat machinery can't handle.
Quoted 114 lines
Quoted 113 lines
[1] https://gitlab.com/qemu-project/qemu/-/issues/641
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2006409Signed-off-by Julia Suvorova <[email protected]>--- include/hw/acpi/ich9.h | 1 + hw/acpi/ich9.c | 18 ++++++++++++++++++ hw/i386/pc.c | 2 ++ hw/i386/pc_q35.c | 7 ++++++- 4 files changed, 27 insertions(+), 1 deletion(-)include/hw/acpi/ich9.h +1
-0@@ -56,6 +56,7 @@ typedef struct ICH9LPCPMRegs {AcpiCpuHotplug gpe_cpu;CPUHotplugState cpuhp_state; +bool keep_pci_slot_hpc;bool use_acpi_hotplug_bridge;AcpiPciHpState acpi_pci_hotplug;MemHotplugState acpi_memory_hotplug;hw/acpi/ich9.c +18
-0@@ -419,6 +419,20 @@ static void ich9_pm_set_acpi_pci_hotplug(Object *obj, bool value, Error **errp) s->pm.use_acpi_hotplug_bridge = value; } +static bool ich9_pm_get_keep_pci_slot_hpc (Object *obj,Error **errp) +{ +ICH9LPCState *s =ICH9_LPC_DEVICE (obj); + +return s->pm.keep_pci_slot_hpc; +} + +static void ich9_pm_set_keep_pci_slot_hpc (Object *obj,bool value,Error **errp) +{ +ICH9LPCState *s =ICH9_LPC_DEVICE (obj); + + s->pm.keep_pci_slot_hpc = value; +} +void ich9_pm_add_properties (Object *obj,ICH9LPCPMRegs *pm) {static const uint32_t gpe0_len =ICH9_PMIO_GPE0_LEN ;@@ -428,6 +442,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) pm->disable_s4 =0 ; pm->s4_val =2 ; pm->use_acpi_hotplug_bridge = true; + pm->keep_pci_slot_hpc = true;object_property_add_uint32_ptr (obj,ACPI_PM_PROP_PM_IO_BASE , &pm->pm_io_base,OBJ_PROP_FLAG_READ );@@ -454,6 +469,9 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)object_property_add_bool (obj,ACPI_PM_PROP_ACPI_PCIHP_BRIDGE , ich9_pm_get_acpi_pci_hotplug, ich9_pm_set_acpi_pci_hotplug); +object_property_add_bool (obj,"x-keep-pci-slot-hpc" , + ich9_pm_get_keep_pci_slot_hpc, + ich9_pm_set_keep_pci_slot_hpc); } void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,hw/i386/pc.c +2
-0@@ -98,6 +98,7 @@ GlobalProperty pc_compat_6_1[] = { { TYPE_X86_CPU, "hv-version-id-build", "0x1bbc" }, { TYPE_X86_CPU, "hv-version-id-major", "0x0006" }, { TYPE_X86_CPU, "hv-version-id-minor", "0x0001" }, + { "ICH9-LPC", "x-keep-pci-slot-hpc", "false" }, };const size_t pc_compat_6_1_len =G_N_ELEMENTS (pc_compat_6_1);@@ -107,6 +108,7 @@ GlobalProperty pc_compat_6_0[] = { { "qemu64" "-" TYPE_X86_CPU, "stepping", "3" }, { TYPE_X86_CPU, "x-vendor-cpuid-only", "off" }, { "ICH9-LPC", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" }, + { "ICH9-LPC", "x-keep-pci-slot-hpc", "true" }, };const size_t pc_compat_6_0_len =G_N_ELEMENTS (pc_compat_6_0);hw/i386/pc_q35.c +6
-1@@ -137,6 +137,7 @@ static void pc_q35_init(MachineState *machine)DriveInfo *hd[MAX_SATA_PORTS ];MachineClass *mc =MACHINE_GET_CLASS (machine);bool acpi_pcihp; +bool keep_pci_slot_hpc;/* Check whether RAM fits below 4G (leaving 1/2 GByte for IO memory * and 256 Mbytes for PCI Express Enhanced Configuration Access Mapping @@ -242,7 +243,11 @@ static void pc_q35_init(MachineState *machine)ACPI_PM_PROP_ACPI_PCIHP_BRIDGE , NULL); -if (acpi_pcihp) { + keep_pci_slot_hpc =object_property_get_bool (OBJECT (lpc), +"x-keep-pci-slot-hpc" , +NULL ); + +if (!keep_pci_slot_hpc && acpi_pcihp) {object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hpc-bit" ,"false" , true); }
Re: [PATCH 4/5] hw/i386/acpi-build: Deny control on PCIe Native Hot-plug in _OSC
In reply to Michael S. TsirkinQuoted 93 lines · On Wed, 10 Nov 2021 02:21:34 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 42 lines · Julia Suvorova
There are two ways to enable ACPI PCI Hot-plug:
* Disable the Hot-plug Capable bit on PCIe slots.
This was the first approach which led to regression [1-2], as I/O space for a port is allocated only when it is hot-pluggable, which is determined by HPC bit.
* Leave the HPC bit on and disable PCIe Native Hot-plug in
_OSCmethod.This removes the (future) ability of hot-plugging switches with PCIe Native hotplug since ACPI PCI Hot-plug only works with cold-plugged bridges. If the user wants to explicitely use this feature, they can disable ACPI PCI Hot-plug with:
--global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=offChange the bit in
_OSCmethod so that the OS selects ACPI PCI Hot-plug instead of PCIe Native.[1] https://gitlab.com/qemu-project/qemu/-/issues/641
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2006409Signed-off-by Julia Suvorova <[email protected]>--- hw/i386/acpi-build.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)hw/i386/acpi-build.c +1
-1@@ -1337,7 +1337,7 @@ static void build_x86_acpi_pci_hotplug(Aml *table, uint64_t pcihp_addr)aml_append (table, scope); } -static Aml *build_q35_osc_method (void ) +static Aml *build_q35_osc_method (bool acpi_pcihp) {Aml *if_ctx;Aml *if_ctx2;hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1348
Quoted 4 lines
hw/i386/acpi-build.c +1
-0@@ -1345,6 +1345,7 @@ static Aml *build_q35_osc_method(void)Aml *method;Aml *a_cwd1 =aml_name ("CDW1" );Aml *a_ctrl =aml_local (0 ); +const uint64_t hotplug = acpi_pcihp ?0x1E :0x1F ;drop this variable and open-code at use point below. As it is the comment is misplaced.
Also a slightly better way to write this:0x1E| (acpi_pcihp?0x0:0x1)hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1351
Quoted 3 lines
hw/i386/acpi-build.c +0
-0method =aml_method ("_OSC" ,4 ,AML_NOTSERIALIZED );aml_append (method,aml_create_dword_field (aml_arg (3 ),aml_int (0 ),"CDW1" ));So what
acpi_pcihpdoes is enable/disable native pcie hotplug. How about we call the option exactly that?hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1366
Quoted 9 lines
hw/i386/acpi-build.c +2
-1@@ -1359,8 +1360,9 @@ static Aml *build_q35_osc_method(void)/* * Always allow native PME, AER (no dependencies) * Allow SHPC (PCI bridges can have SHPC controller) +* Disable PCIe Native Hot-plug if ACPI PCI Hot-plug is enabled. */ -aml_append (if_ctx,aml_and (a_ctrl,aml_int (0x1F ), a_ctrl)); +aml_append (if_ctx,aml_and (a_ctrl,aml_int (hotplug), a_ctrl));using the variable hotplug just made things confusing, open-coding will be clearer.
hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1457
Quoted 11 lines
hw/i386/acpi-build.c +1
-1if_ctx2 =aml_if (aml_lnot (aml_equal (aml_arg (1 ),aml_int (1 ))));/* Unknown revision */ @@ -1449,7 +1451,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" )));aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (pcmc->pci_root_uid))); -aml_append (dev,build_q35_osc_method ()); +aml_append (dev,build_q35_osc_method (pm->pcihp_bridge_en));aml_append (sb_scope, dev);if (mcfg_valid) {aml_append (sb_scope,build_q35_dram_controller (&mcfg));One of the complaints of libvirt people was that the name is confusing. It seems to say whether to describe bridges in ACPI but it also disables native hotplug, but only for PCIe.
Quoted 2 lines
Maybe we should address this with flags saying whether to enable each of acpi,pcie,shpc hotplug separately...
yep, mask with field defines would be better,
but I'd hold off such change to post 6.2 time.
Quoted 10 lines
hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1573
Quoted 10 lines
hw/i386/acpi-build.c +2
-1@@ -1565,7 +1567,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,if (pci_bus_is_express (bus)) {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" )));aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" ))); -aml_append (dev,build_q35_osc_method ()); +/* Expander bridges do not have ACPI PCI Hot-plug enabled */ +aml_append (dev,build_q35_osc_method (false));
this's it not obvious, why PXBs aren't capable of ACPI PCI Hot-plug?
Quoted 6 lines
Quoted 5 lines
hw/i386/acpi-build.c +0
-0}else {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A03" ))); }Signature · 1 line
2.31.1
Re: [PATCH 4/5] hw/i386/acpi-build: Deny control on PCIe Native Hot-plug in _OSC
Quoted 111 lines · Igor Mammedov
Quoted 93 lines · On Wed, 10 Nov 2021 02:21:34 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 42 lines · Julia Suvorova
There are two ways to enable ACPI PCI Hot-plug:
* Disable the Hot-plug Capable bit on PCIe slots.
This was the first approach which led to regression [1-2], as I/O space for a port is allocated only when it is hot-pluggable, which is determined by HPC bit.
* Leave the HPC bit on and disable PCIe Native Hot-plug in
_OSCmethod.This removes the (future) ability of hot-plugging switches with PCIe Native hotplug since ACPI PCI Hot-plug only works with cold-plugged bridges. If the user wants to explicitely use this feature, they can disable ACPI PCI Hot-plug with:
--global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=offChange the bit in
_OSCmethod so that the OS selects ACPI PCI Hot-plug instead of PCIe Native.[1] https://gitlab.com/qemu-project/qemu/-/issues/641
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2006409Signed-off-by Julia Suvorova <[email protected]>--- hw/i386/acpi-build.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)hw/i386/acpi-build.c +1
-1@@ -1337,7 +1337,7 @@ static void build_x86_acpi_pci_hotplug(Aml *table, uint64_t pcihp_addr)aml_append (table, scope); } -static Aml *build_q35_osc_method (void ) +static Aml *build_q35_osc_method (bool acpi_pcihp) {Aml *if_ctx;Aml *if_ctx2;hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1348
Quoted 4 lines
hw/i386/acpi-build.c +1
-0@@ -1345,6 +1345,7 @@ static Aml *build_q35_osc_method(void)Aml *method;Aml *a_cwd1 =aml_name ("CDW1" );Aml *a_ctrl =aml_local (0 ); +const uint64_t hotplug = acpi_pcihp ?0x1E :0x1F ;drop this variable and open-code at use point below. As it is the comment is misplaced.
Also a slightly better way to write this:0x1E| (acpi_pcihp?0x0:0x1)hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1351
Quoted 3 lines
hw/i386/acpi-build.c +0
-0method =aml_method ("_OSC" ,4 ,AML_NOTSERIALIZED );aml_append (method,aml_create_dword_field (aml_arg (3 ),aml_int (0 ),"CDW1" ));So what
acpi_pcihpdoes is enable/disable native pcie hotplug. How about we call the option exactly that?hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1366
Quoted 9 lines
hw/i386/acpi-build.c +2
-1@@ -1359,8 +1360,9 @@ static Aml *build_q35_osc_method(void)/* * Always allow native PME, AER (no dependencies) * Allow SHPC (PCI bridges can have SHPC controller) +* Disable PCIe Native Hot-plug if ACPI PCI Hot-plug is enabled. */ -aml_append (if_ctx,aml_and (a_ctrl,aml_int (0x1F ), a_ctrl)); +aml_append (if_ctx,aml_and (a_ctrl,aml_int (hotplug), a_ctrl));using the variable hotplug just made things confusing, open-coding will be clearer.
hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1457
Quoted 11 lines
hw/i386/acpi-build.c +1
-1if_ctx2 =aml_if (aml_lnot (aml_equal (aml_arg (1 ),aml_int (1 ))));/* Unknown revision */ @@ -1449,7 +1451,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" )));aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (pcmc->pci_root_uid))); -aml_append (dev,build_q35_osc_method ()); +aml_append (dev,build_q35_osc_method (pm->pcihp_bridge_en));aml_append (sb_scope, dev);if (mcfg_valid) {aml_append (sb_scope,build_q35_dram_controller (&mcfg));One of the complaints of libvirt people was that the name is confusing. It seems to say whether to describe bridges in ACPI but it also disables native hotplug, but only for PCIe.
Quoted 2 lines
Maybe we should address this with flags saying whether to enable each of acpi,pcie,shpc hotplug separately...
yep, mask with field defines would be better,
but I'd hold off such change to post 6.2 time.Quoted 6 lines
Quoted 6 lines
hw/i386/acpi-build.c +0
-1@@ -1565,7 +1567,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,if (pci_bus_is_express (bus)) {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" )));aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" ))); -aml_append (dev,build_q35_osc_method ());
Quoted 4 lines
Quoted 2 lines
hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1572
Quoted 2 lines
hw/i386/acpi-build.c +2
-0+/* Expander bridges do not have ACPI PCI Hot-plug enabled */ +aml_append (dev,build_q35_osc_method (false));this's it not obvious, why PXBs aren't capable of ACPI PCI Hot-plug?
Lack of support from the original patchset.
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
hw/i386/acpi-build.c +0
-1}else {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A03" ))); } --2.31.1
Re: [PATCH 4/5] hw/i386/acpi-build: Deny control on PCIe Native Hot-plug in _OSC
Quoted 112 lines · Julia Suvorova
Quoted 111 lines · Igor Mammedov
Quoted 93 lines · On Wed, 10 Nov 2021 02:21:34 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 42 lines · Julia Suvorova
There are two ways to enable ACPI PCI Hot-plug:
* Disable the Hot-plug Capable bit on PCIe slots.
This was the first approach which led to regression [1-2], as I/O space for a port is allocated only when it is hot-pluggable, which is determined by HPC bit.
* Leave the HPC bit on and disable PCIe Native Hot-plug in
_OSCmethod.This removes the (future) ability of hot-plugging switches with PCIe Native hotplug since ACPI PCI Hot-plug only works with cold-plugged bridges. If the user wants to explicitely use this feature, they can disable ACPI PCI Hot-plug with:
--global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=offChange the bit in
_OSCmethod so that the OS selects ACPI PCI Hot-plug instead of PCIe Native.[1] https://gitlab.com/qemu-project/qemu/-/issues/641
[2] https://bugzilla.redhat.com/show_bug.cgi?id=2006409Signed-off-by Julia Suvorova <[email protected]>--- hw/i386/acpi-build.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)hw/i386/acpi-build.c +1
-1@@ -1337,7 +1337,7 @@ static void build_x86_acpi_pci_hotplug(Aml *table, uint64_t pcihp_addr)aml_append (table, scope); } -static Aml *build_q35_osc_method (void ) +static Aml *build_q35_osc_method (bool acpi_pcihp) {Aml *if_ctx;Aml *if_ctx2;hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1348
Quoted 4 lines
hw/i386/acpi-build.c +1
-0@@ -1345,6 +1345,7 @@ static Aml *build_q35_osc_method(void)Aml *method;Aml *a_cwd1 =aml_name ("CDW1" );Aml *a_ctrl =aml_local (0 ); +const uint64_t hotplug = acpi_pcihp ?0x1E :0x1F ;drop this variable and open-code at use point below. As it is the comment is misplaced.
Also a slightly better way to write this:0x1E| (acpi_pcihp?0x0:0x1)hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1351
Quoted 3 lines
hw/i386/acpi-build.c +0
-0method =aml_method ("_OSC" ,4 ,AML_NOTSERIALIZED );aml_append (method,aml_create_dword_field (aml_arg (3 ),aml_int (0 ),"CDW1" ));So what
acpi_pcihpdoes is enable/disable native pcie hotplug. How about we call the option exactly that?hw/i386/acpi-build.c static Aml *build_q35_osc_method(void) · line 1366
Quoted 9 lines
hw/i386/acpi-build.c +2
-1@@ -1359,8 +1360,9 @@ static Aml *build_q35_osc_method(void)/* * Always allow native PME, AER (no dependencies) * Allow SHPC (PCI bridges can have SHPC controller) +* Disable PCIe Native Hot-plug if ACPI PCI Hot-plug is enabled. */ -aml_append (if_ctx,aml_and (a_ctrl,aml_int (0x1F ), a_ctrl)); +aml_append (if_ctx,aml_and (a_ctrl,aml_int (hotplug), a_ctrl));using the variable hotplug just made things confusing, open-coding will be clearer.
hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1457
Quoted 11 lines
hw/i386/acpi-build.c +1
-1if_ctx2 =aml_if (aml_lnot (aml_equal (aml_arg (1 ),aml_int (1 ))));/* Unknown revision */ @@ -1449,7 +1451,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" )));aml_append (dev,aml_name_decl ("_ADR" ,aml_int (0 )));aml_append (dev,aml_name_decl ("_UID" ,aml_int (pcmc->pci_root_uid))); -aml_append (dev,build_q35_osc_method ()); +aml_append (dev,build_q35_osc_method (pm->pcihp_bridge_en));aml_append (sb_scope, dev);if (mcfg_valid) {aml_append (sb_scope,build_q35_dram_controller (&mcfg));One of the complaints of libvirt people was that the name is confusing. It seems to say whether to describe bridges in ACPI but it also disables native hotplug, but only for PCIe.
Quoted 2 lines
Maybe we should address this with flags saying whether to enable each of acpi,pcie,shpc hotplug separately...
yep, mask with field defines would be better,
but I'd hold off such change to post 6.2 time.Quoted 6 lines
Quoted 6 lines
hw/i386/acpi-build.c +0
-1@@ -1565,7 +1567,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,if (pci_bus_is_express (bus)) {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A08" )));aml_append (dev,aml_name_decl ("_CID" ,aml_eisaid ("PNP0A03" ))); -aml_append (dev,build_q35_osc_method ());
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
hw/i386/acpi-build.c build_dsdt(GArray *table_data, BIOSLinker *linker, · line 1572
Quoted 2 lines
hw/i386/acpi-build.c +2
-0+/* Expander bridges do not have ACPI PCI Hot-plug enabled */ +aml_append (dev,build_q35_osc_method (false));this's it not obvious, why PXBs aren't capable of ACPI PCI Hot-plug?
Lack of support from the original patchset.
Hmm. So PXB will keep using native hotplug. Looks like a good reason to pick up Gerd's patches to fix it up ...
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
hw/i386/acpi-build.c +0
-1}else {aml_append (dev,aml_name_decl ("_HID" ,aml_eisaid ("PNP0A03" ))); } --2.31.1
Re: [PATCH 1/5] hw/pci/pcie_port: Rename 'native-hotplug' to 'native-hpc-bit'
In reply to Igor MammedovQuoted 66 lines · Igor Mammedov
Quoted 39 lines · On Wed, 10 Nov 2021 09:08:34 +0000 Daniel P. Berrangé <[email protected]>…
Quoted 38 lines · Michael S. Tsirkin
hw/i386/pc_q35.c
Quoted 26 lines · Julia Suvorova
Rename the option to better represent its function - toggle Hot-Plug Capable bit in the PCIe Slot Capability.
Signed-off-by Julia Suvorova <[email protected]>--- include/hw/pci/pcie_port.h | 2 +- hw/i386/pc_q35.c | 2 +- hw/pci-bridge/gen_pcie_root_port.c | 6 +++++- hw/pci/pcie.c | 2 +- hw/pci/pcie_port.c | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-)include/hw/pci/pcie_port.h +1
-1@@ -60,7 +60,7 @@ struct PCIESlot {/* Indicates whether any type of hot-plug is allowed on the slot */ bool hotplug; -bool native_hotplug; +bool native_hpc_bit;QLIST_ENTRY (PCIESlot) next; };hw/i386/pc_q35.c +0
-0This is ok.
Quoted 6 lines
index
797e09500b..ded61f8ef7100644hw/i386/pc_q35.c +0
-0@@ -243,7 +243,7 @@ static void pc_q35_init(MachineState *machine) NULL);Quoted 11 lines
Quoted 11 lines
hw/i386/pc_q35.c static void pc_q35_init(MachineState *machine) · line 249
Quoted 6 lines
hw/i386/pc_q35.c +1
-1if (acpi_pcihp) { -object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hotplug" , +object_register_sugar_prop (TYPE_PCIE_SLOT ,"native-hpc-bit" ,"false" , true); }This part is problematic since we made the feature user-settable in 6.1. We can have two features if we really want to ...
I don't think we have a way to mark properties deprecated, do we?describe them in
deprecated.rstQuoted 5 lines
IMHO just leave the feature with its current name. It won't be the first thing without a "perfect" name and the name doesn't have a negative impact on mgmt apps. Changing the name will cause more pain than it solves.
looking at the code, it was introduced in 6.1 for internal needs mostly
3f3cbbb23hw/pci/pcie: Do not set HPC flag if acpihp is used
Quoted 9 lines
to hide slot from guest's native-hotplug module.
Even if user tried explicitly to set native-hoplug=on on a slot with ACPI hotplug enabled, native hotplug will not work properly as slot's hotplug is still handled byacpi_pcihp_device_plug_cb().Given above and that it shouldn't been used by users,
I'd rather rename it to x-native-hotplug now than go through deprecation process and expose it for 2 more releases.
Well what works is disabling native hotplug. Has same effect as disabling hotplug really. Yes, I see little point
in keeping it. Technically an ABI breakage but hey. And I would also try to backport a patch renaming it to stable (if another stable release happens). So users don't start using this.
Quoted 51 lines
Quoted 51 lines
Quoted 44 lines
Quoted 44 lines
hw/pci-bridge/gen_pcie_root_port.c +5
-1@@ -87,7 +87,11 @@ static void gen_rp_realize(DeviceState *dev, Error **errp)return ; } -if (grp->res_reserve.io ==-1 && s->hotplug && !s->native_hotplug) { +/* +* Make sure that IO is assigned in case the slot is hot-pluggable +* but it is not visible through the PCIe Slot Capabilities +*/ +if (grp->res_reserve.io ==-1 && s->hotplug && !s->native_hpc_bit) { grp->res_reserve.io =GEN_PCIE_ROOT_DEFAULT_IO_RANGE ; } int rc = pci_bridge_qemu_reserve_cap_init(d, 0,hw/pci/pcie.c +1
-1@@ -535,7 +535,7 @@ void pcie_cap_slot_init(PCIDevice *dev, PCIESlot *s)* hot-plug is disabled on the slot. */ if (s->hotplug && - (s->native_hotplug ||DEVICE (dev)->hotplugged)) { + (s->native_hpc_bit ||DEVICE (dev)->hotplugged)) {pci_long_test_and_set_mask (dev->config + pos +PCI_EXP_SLTCAP ,PCI_EXP_SLTCAP_HPS |PCI_EXP_SLTCAP_HPC );hw/pci/pcie_port.c +1
-1@@ -148,7 +148,7 @@ static Property pcie_slot_props[] = {DEFINE_PROP_UINT8 ("chassis" , PCIESlot, chassis,0 ),DEFINE_PROP_UINT16 ("slot" , PCIESlot, slot,0 ),DEFINE_PROP_BOOL ("hotplug" , PCIESlot, hotplug, true), -DEFINE_PROP_BOOL ("native-hotplug" , PCIESlot, native_hotplug, true), +DEFINE_PROP_BOOL ("native-hpc-bit" , PCIESlot, native_hpc_bit, true), DEFINE_PROP_END_OF_LIST() };Quoted 4 lines
Quoted 2 lines
Signature · 1 line
2.31.1Regards,
Daniel