qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 15/16] pc: Move PcGuestInfo.apic_xrupt_override fiel


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 15/16] pc: Move PcGuestInfo.apic_xrupt_override field to PCMachineState
Date: Tue, 1 Dec 2015 23:47:10 -0200

Signed-off-by: Eduardo Habkost <address@hidden>
---
 hw/i386/acpi-build.c | 7 ++++---
 hw/i386/pc.c         | 2 +-
 include/hw/i386/pc.h | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 7771be7..cdbe5b9 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -366,8 +366,9 @@ build_fadt(GArray *table_data, GArray *linker, AcpiPmInfo 
*pm,
 
 static void
 build_madt(GArray *table_data, GArray *linker, AcpiCpuInfo *cpu,
-           PcGuestInfo *guest_info)
+           PCMachineState *pcms)
 {
+    PcGuestInfo *guest_info = &pcms->acpi_guest_info;
     int madt_start = table_data->len;
 
     AcpiMultipleApicTable *madt;
@@ -400,7 +401,7 @@ build_madt(GArray *table_data, GArray *linker, AcpiCpuInfo 
*cpu,
     io_apic->address = cpu_to_le32(IO_APIC_DEFAULT_ADDRESS);
     io_apic->interrupt = cpu_to_le32(0);
 
-    if (guest_info->apic_xrupt_override) {
+    if (pcms->apic_xrupt_override) {
         intsrcovr = acpi_data_push(table_data, sizeof *intsrcovr);
         intsrcovr->type   = ACPI_APIC_XRUPT_OVERRIDE;
         intsrcovr->length = sizeof(*intsrcovr);
@@ -1740,7 +1741,7 @@ void acpi_build(PCMachineState *pcms, AcpiBuildTables 
*tables)
     aml_len += tables_blob->len - ssdt;
 
     acpi_add_table(table_offsets, tables_blob);
-    build_madt(tables_blob, tables->linker, &cpu, guest_info);
+    build_madt(tables_blob, tables->linker, &cpu, pcms);
 
     if (misc.has_hpet) {
         acpi_add_table(table_offsets, tables_blob);
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index cdfdd52..f399d14 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1188,7 +1188,7 @@ PcGuestInfo *pc_guest_info_init(PCMachineState *pcms)
     int i, j;
 
     guest_info->apic_id_limit = pc_apic_id_limit(max_cpus);
-    guest_info->apic_xrupt_override = kvm_allows_irq0_override();
+    pcms->apic_xrupt_override = kvm_allows_irq0_override();
     guest_info->numa_nodes = nb_numa_nodes;
     guest_info->node_mem = g_malloc0(guest_info->numa_nodes *
                                     sizeof *guest_info->node_mem);
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index a175131..5ded182 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -23,7 +23,6 @@
 /* Machine info for ACPI build: */
 struct PcGuestInfo {
     unsigned apic_id_limit;
-    bool apic_xrupt_override;
     uint64_t numa_nodes;
     uint64_t *node_mem;
     uint64_t *node_cpu;
@@ -51,6 +50,7 @@ struct PCMachineState {
     PcGuestInfo acpi_guest_info;
     Notifier machine_done;
     FWCfgState *fw_cfg;
+    bool apic_xrupt_override;
 };
 
 #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
-- 
2.1.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]