Skip to content

Commit 88afdc9

Browse files
committed
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
pc,pci,virtio: fixes, cleanups Fixes, cleanups all over the place. Signed-off-by: Michael S. Tsirkin <[email protected]> # gpg: Signature made Sat 04 Sep 2021 22:34:10 BST # gpg: using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469 # gpg: issuer "[email protected]" # gpg: Good signature from "Michael S. Tsirkin <[email protected]>" [full] # gpg: aka "Michael S. Tsirkin <[email protected]>" [full] # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: (35 commits) vhost-vdpa: remove the unncessary queue_index assignment vhost-vdpa: fix the wrong assertion in vhost_vdpa_init() vhost-vdpa: tweak the error label in vhost_vdpa_add() vhost-vdpa: fix leaking of vhost_net in vhost_vdpa_add() vhost-vdpa: don't cleanup twice in vhost_vdpa_add() vhost-vdpa: remove the unnecessary check in vhost_vdpa_add() vhost_net: do not assume nvqs is always 2 vhost: use unsigned int for nvqs vhost_net: remove the meaningless assignment in vhost_net_start_one() vhost-vdpa: correctly return err in vhost_vdpa_set_backend_cap() vhost-vdpa: remove unused variable "acked_features" tests/vhost-user-bridge.c: Fix typo in help message tests/vhost-user-bridge.c: Sanity check socket path length hw/virtio: Add flatview update in vhost_user_cleanup() hw/virtio: Remove NULL check in virtio_free_region_cache() hw/virtio: Document virtio_queue_packed_empty_rcu is called within RCU MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystem hw/acpi: use existing references to pci device struct within functions hw/pci: remove all references to find_i440fx function hw/i386/acpi-build: Get NUMA information from struct NumaState ... Signed-off-by: Peter Maydell <[email protected]>
2 parents 31ebff5 + 499c8b4 commit 88afdc9

40 files changed

+440
-213
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,6 +1751,7 @@ F: docs/specs/*pci*
17511751
ACPI/SMBIOS
17521752
M: Michael S. Tsirkin <[email protected]>
17531753
M: Igor Mammedov <[email protected]>
1754+
R: Ani Sinha <[email protected]>
17541755
S: Supported
17551756
F: include/hw/acpi/*
17561757
F: include/hw/firmware/smbios.h

configs/devices/mips-softmmu/common.mak

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ CONFIG_PCSPK=y
1818
CONFIG_PCKBD=y
1919
CONFIG_FDC=y
2020
CONFIG_ACPI=y
21-
CONFIG_ACPI_X86=y
22-
CONFIG_ACPI_MEMORY_HOTPLUG=y
23-
CONFIG_ACPI_NVDIMM=y
24-
CONFIG_ACPI_CPU_HOTPLUG=y
21+
CONFIG_ACPI_PIIX4=y
2522
CONFIG_APM=y
2623
CONFIG_I8257=y
2724
CONFIG_PIIX4=y

hw/acpi/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ config ACPI_X86
88
select ACPI_CPU_HOTPLUG
99
select ACPI_MEMORY_HOTPLUG
1010
select ACPI_HMAT
11+
select ACPI_PIIX4
12+
select ACPI_PCIHP
1113

1214
config ACPI_X86_ICH
1315
bool
@@ -24,6 +26,14 @@ config ACPI_NVDIMM
2426
bool
2527
depends on ACPI
2628

29+
config ACPI_PIIX4
30+
bool
31+
depends on ACPI
32+
33+
config ACPI_PCIHP
34+
bool
35+
depends on ACPI
36+
2737
config ACPI_HMAT
2838
bool
2939
depends on ACPI

hw/acpi/acpi-cpu-hotplug-stub.c

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#include "qemu/osdep.h"
2+
#include "hw/acpi/cpu_hotplug.h"
3+
#include "migration/vmstate.h"
4+
5+
6+
/* Following stubs are all related to ACPI cpu hotplug */
7+
const VMStateDescription vmstate_cpu_hotplug;
8+
9+
void acpi_switch_to_modern_cphp(AcpiCpuHotplug *gpe_cpu,
10+
CPUHotplugState *cpuhp_state,
11+
uint16_t io_port)
12+
{
13+
return;
14+
}
15+
16+
void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner,
17+
AcpiCpuHotplug *gpe_cpu, uint16_t base)
18+
{
19+
return;
20+
}
21+
22+
void acpi_cpu_ospm_status(CPUHotplugState *cpu_st, ACPIOSTInfoList ***list)
23+
{
24+
return;
25+
}
26+
27+
void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev,
28+
CPUHotplugState *cpu_st, DeviceState *dev, Error **errp)
29+
{
30+
return;
31+
}
32+
33+
void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev,
34+
AcpiCpuHotplug *g, DeviceState *dev, Error **errp)
35+
{
36+
return;
37+
}
38+
39+
void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st,
40+
DeviceState *dev, Error **errp)
41+
{
42+
return;
43+
}
44+
45+
void acpi_cpu_unplug_request_cb(HotplugHandler *hotplug_dev,
46+
CPUHotplugState *cpu_st,
47+
DeviceState *dev, Error **errp)
48+
{
49+
return;
50+
}

hw/acpi/acpi-mem-hotplug-stub.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include "qemu/osdep.h"
2+
#include "hw/acpi/memory_hotplug.h"
3+
#include "migration/vmstate.h"
4+
5+
const VMStateDescription vmstate_memory_hotplug;
6+
7+
void acpi_memory_hotplug_init(MemoryRegion *as, Object *owner,
8+
MemHotplugState *state, hwaddr io_base)
9+
{
10+
return;
11+
}
12+
13+
void acpi_memory_ospm_status(MemHotplugState *mem_st, ACPIOSTInfoList ***list)
14+
{
15+
return;
16+
}
17+
18+
void acpi_memory_plug_cb(HotplugHandler *hotplug_dev, MemHotplugState *mem_st,
19+
DeviceState *dev, Error **errp)
20+
{
21+
return;
22+
}
23+
24+
void acpi_memory_unplug_cb(MemHotplugState *mem_st,
25+
DeviceState *dev, Error **errp)
26+
{
27+
return;
28+
}
29+
30+
void acpi_memory_unplug_request_cb(HotplugHandler *hotplug_dev,
31+
MemHotplugState *mem_st,
32+
DeviceState *dev, Error **errp)
33+
{
34+
return;
35+
}

hw/acpi/acpi-nvdimm-stub.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include "qemu/osdep.h"
2+
#include "hw/mem/nvdimm.h"
3+
#include "hw/hotplug.h"
4+
5+
void nvdimm_acpi_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev)
6+
{
7+
return;
8+
}

hw/acpi/acpi-pci-hotplug-stub.c

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#include "qemu/osdep.h"
2+
#include "hw/acpi/pcihp.h"
3+
#include "migration/vmstate.h"
4+
5+
const VMStateDescription vmstate_acpi_pcihp_pci_status;
6+
7+
void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus,
8+
MemoryRegion *address_space_io, bool bridges_enabled,
9+
uint16_t io_base)
10+
{
11+
return;
12+
}
13+
14+
void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,
15+
DeviceState *dev, Error **errp)
16+
{
17+
return;
18+
}
19+
20+
void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev,
21+
DeviceState *dev, Error **errp)
22+
{
23+
return;
24+
}
25+
26+
void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,
27+
DeviceState *dev, Error **errp)
28+
{
29+
return;
30+
}
31+
32+
void acpi_pcihp_device_unplug_request_cb(HotplugHandler *hotplug_dev,
33+
AcpiPciHpState *s, DeviceState *dev,
34+
Error **errp)
35+
{
36+
return;
37+
}
38+
39+
void acpi_pcihp_reset(AcpiPciHpState *s, bool acpihp_root_off)
40+
{
41+
return;
42+
}
43+
44+
bool vmstate_acpi_pcihp_use_acpi_index(void *opaque, int version_id)
45+
{
46+
return false;
47+
}

hw/acpi/ich9.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
451451
object_property_add_bool(obj, ACPI_PM_PROP_TCO_ENABLED,
452452
ich9_pm_get_enable_tco,
453453
ich9_pm_set_enable_tco);
454-
object_property_add_bool(obj, "acpi-pci-hotplug-with-bridge-support",
454+
object_property_add_bool(obj, ACPI_PM_PROP_ACPI_PCIHP_BRIDGE,
455455
ich9_pm_get_acpi_pci_hotplug,
456456
ich9_pm_set_acpi_pci_hotplug);
457457
}

hw/acpi/meson.build

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,27 @@ acpi_ss.add(files(
66
'core.c',
77
'utils.c',
88
))
9-
acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c'))
10-
acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu_hotplug.c'))
9+
acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c', 'cpu_hotplug.c'))
10+
acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_false: files('acpi-cpu-hotplug-stub.c'))
1111
acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_true: files('memory_hotplug.c'))
12+
acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_false: files('acpi-mem-hotplug-stub.c'))
1213
acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_true: files('nvdimm.c'))
14+
acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_false: files('acpi-nvdimm-stub.c'))
1315
acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c'))
1416
acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.c'))
1517
acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device.c'))
1618
acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c'))
1719
acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c'), if_false: files('ghes-stub.c'))
18-
acpi_ss.add(when: 'CONFIG_ACPI_X86', if_true: files('piix4.c', 'pcihp.c'))
20+
acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c'))
21+
acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c'))
22+
acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-stub.c'))
1923
acpi_ss.add(when: 'CONFIG_ACPI_X86_ICH', if_true: files('ich9.c', 'tco.c'))
2024
acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c'))
2125
acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c'))
2226
acpi_ss.add(when: 'CONFIG_TPM', if_true: files('tpm.c'))
2327
softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c'))
2428
softmmu_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss)
2529
softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('acpi-stub.c', 'aml-build-stub.c',
26-
'acpi-x86-stub.c', 'ipmi-stub.c', 'ghes-stub.c'))
30+
'acpi-x86-stub.c', 'ipmi-stub.c', 'ghes-stub.c',
31+
'acpi-mem-hotplug-stub.c', 'acpi-cpu-hotplug-stub.c',
32+
'acpi-pci-hotplug-stub.c', 'acpi-nvdimm-stub.c'))

hw/acpi/pcihp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev,
283283

284284
/* Only hotplugged devices need the hotplug capability. */
285285
if (dev->hotplugged &&
286-
acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev))) < 0) {
286+
acpi_pcihp_get_bsel(pci_get_bus(pdev)) < 0) {
287287
error_setg(errp, "Unsupported bus. Bus doesn't have property '"
288288
ACPI_PCIHP_PROP_BSEL "' set");
289289
return;
@@ -363,8 +363,8 @@ void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,
363363
{
364364
PCIDevice *pdev = PCI_DEVICE(dev);
365365

366-
trace_acpi_pci_unplug(PCI_SLOT(PCI_DEVICE(dev)->devfn),
367-
acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev))));
366+
trace_acpi_pci_unplug(PCI_SLOT(pdev->devfn),
367+
acpi_pcihp_get_bsel(pci_get_bus(pdev)));
368368

369369
/*
370370
* clean up acpi-index so it could reused by another device

0 commit comments

Comments
 (0)