[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH-for-9.1 12/29] hw/i386/pc: Move acpi_build_enabled to PcPciMa
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH-for-9.1 12/29] hw/i386/pc: Move acpi_build_enabled to PcPciMachineState |
Date: |
Thu, 28 Mar 2024 16:54:20 +0100 |
Since only PCI-based machines use the 'acpi_build_enabled',
move it to PcPciMachineState.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/acpi-build.h | 2 +-
include/hw/i386/pc.h | 3 ++-
hw/i386/acpi-build.c | 8 ++++----
hw/i386/pc.c | 5 ++---
hw/i386/xen/xen-hvm.c | 3 ++-
5 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h
index 31de5bddbd..4c1511c432 100644
--- a/hw/i386/acpi-build.h
+++ b/hw/i386/acpi-build.h
@@ -10,7 +10,7 @@ extern const struct AcpiGenericAddress x86_nvdimm_acpi_dsmio;
#define ACPI_PCIHP_SEJ_BASE 0x8
#define ACPI_PCIHP_BNMR_BASE 0x10
-void acpi_setup(PCMachineState *pcms);
+void acpi_setup(PcPciMachineState *ppms);
Object *acpi_get_i386_pci_host(void);
#endif
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index dd5ee448ef..67f8f4730b 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -41,7 +41,6 @@ typedef struct PCMachineState {
SmbiosEntryPointType smbios_entry_point_type;
const char *south_bridge;
- bool acpi_build_enabled;
bool smbus_enabled;
bool sata_enabled;
bool hpet_enabled;
@@ -61,6 +60,8 @@ typedef struct PcPciMachineState {
Notifier machine_done;
+ bool acpi_build_enabled;
+
CXLState cxl_devices_state;
} PcPciMachineState;
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index e702d5e9d2..ee0e99a2fa 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -2749,9 +2749,9 @@ static const VMStateDescription vmstate_acpi_build = {
},
};
-void acpi_setup(PCMachineState *pcms)
+void acpi_setup(PcPciMachineState *ppms)
{
- X86MachineState *x86ms = X86_MACHINE(pcms);
+ X86MachineState *x86ms = X86_MACHINE(ppms);
AcpiBuildTables tables;
AcpiBuildState *build_state;
Object *vmgenid_dev;
@@ -2765,7 +2765,7 @@ void acpi_setup(PCMachineState *pcms)
return;
}
- if (!pcms->acpi_build_enabled) {
+ if (!ppms->acpi_build_enabled) {
ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
return;
}
@@ -2778,7 +2778,7 @@ void acpi_setup(PCMachineState *pcms)
build_state = g_malloc0(sizeof *build_state);
acpi_build_tables_init(&tables);
- acpi_build(&tables, MACHINE(pcms));
+ acpi_build(&tables, MACHINE(ppms));
/* Now expose it all to Guest */
build_state->table_mr = acpi_add_rom_blob(acpi_build_update,
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 47fe3a7c02..f184808e3e 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -627,7 +627,7 @@ static void pc_pci_machine_done(Notifier *notifier, void
*data)
fw_cfg_add_extra_pci_roots(pcms->pcibus, x86ms->fw_cfg);
- acpi_setup(pcms);
+ acpi_setup(ppms);
}
/* setup pci memory address space mapping into system address space */
@@ -1687,9 +1687,8 @@ static void pc_machine_initfn(Object *obj)
static void pc_pci_machine_initfn(Object *obj)
{
PcPciMachineState *ppms = PC_PCI_MACHINE(obj);
- PCMachineState *pcms = PC_MACHINE(obj);
- pcms->acpi_build_enabled = true;
+ ppms->acpi_build_enabled = true;
cxl_machine_init(obj, &ppms->cxl_devices_state);
diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index 7745cb3963..ce48d51842 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -586,6 +586,7 @@ static void xen_wakeup_notifier(Notifier *notifier, void
*data)
void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegion **ram_memory)
{
MachineState *ms = MACHINE(pcms);
+ PcPciMachineState *ppms = PC_PCI_MACHINE(pcms);
unsigned int max_cpus = ms->smp.max_cpus;
int rc;
xen_pfn_t ioreq_pfn;
@@ -624,7 +625,7 @@ void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegion
**ram_memory)
xen_ram_init(pcms, ms->ram_size, ram_memory);
/* Disable ACPI build because Xen handles it */
- pcms->acpi_build_enabled = false;
+ ppms->acpi_build_enabled = false;
return;
--
2.41.0
- [RFC PATCH-for-9.1 03/29] hw/i386/pc: Pass base machine type as argument to DEFINE_PC_MACHINE(), (continued)
- [RFC PATCH-for-9.1 03/29] hw/i386/pc: Pass base machine type as argument to DEFINE_PC_MACHINE(), Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 04/29] hw/i386/pc: Introduce PC_PCI_MACHINE QOM type, Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 05/29] hw/i386/pc: Remove PCMachineClass::pci_enabled field, Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 06/29] hw/i386/pc: Move pci_root_uid field to PcPciMachineClass, Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 07/29] hw/i386/pc: Call fw_cfg_add_extra_pci_roots() in pc_pci_machine_done(), Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 08/29] hw/i386/pc: Move CXLState to PcPciMachineState, Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 09/29] hw/i386/pc: Pass PCMachineState argument to acpi_setup(), Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 10/29] hw/i386/pc: Remove PCMachineClass::has_acpi_build field, Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 11/29] hw/i386/pc: Move acpi_setup() call to pc_pci_machine_done(), Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 12/29] hw/i386/pc: Move acpi_build_enabled to PcPciMachineState,
Philippe Mathieu-Daudé <=
- [RFC PATCH-for-9.1 13/29] hw/i386/pc: Remove non-PCI code from pc_system_firmware_init(), Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 14/29] hw/i386/pc: Move pc_system_flash_create() to pc_pci_machine_initfn(), Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 19/29] hw/i386/pc: Pass PcPciMachineState argument to CXL helpers, Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 15/29] hw/i386/pc: Move FW/pflash related fields to PcPciMachineState, Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 17/29] hw/i386/pc: Inline gigabyte_align(), Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 18/29] hw/i386/pc: Inline has_reserved_memory(), Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 16/29] hw/i386/pc: Move south-bridge related fields to PcPciMachine, Philippe Mathieu-Daudé, 2024/03/28
- [RFC PATCH-for-9.1 20/29] hw/i386/pc: Pass PcPciMachineState argument to pc_pci_hole64_start(), Philippe Mathieu-Daudé, 2024/03/28