@@ -314,7 +314,7 @@ build_madt(void)
io_apic->interrupt = cpu_to_le32(0);
struct madt_intsrcovr *intsrcovr = (void*)&io_apic[1];
- if (irq0override) {
+ if (qemu_cfg_irq0_override()) {
memset(intsrcovr, 0, sizeof(*intsrcovr));
intsrcovr->type = APIC_XRUPT_OVERRIDE;
intsrcovr->length = sizeof(*intsrcovr);
@@ -8,12 +8,7 @@
#include "util.h" // dprintf
#include "config.h" // CONFIG_*
#include "mptable.h" // MPTABLE_SIGNATURE
-
-#if CONFIG_KVM
-int irq0override = 1;
-#else
-int irq0override = 0;
-#endif
+#include "paravirt.h"
void
mptable_init(void)
@@ -103,7 +98,7 @@ mptable_init(void)
intsrc->srcbusirq = i;
intsrc->dstapic = ioapic_id;
intsrc->dstirq = i;
- if (irq0override) {
+ if (qemu_cfg_irq0_override()) {
/* Destination 2 is covered by irq0->inti2 override (i ==
0). Source IRQ 2 is unused */
if (i == 0)
@@ -79,6 +79,18 @@ int qemu_cfg_show_boot_menu(void)
return v;
}
+int qemu_cfg_irq0_override(void)
+{
+ u8 v;
+
+ if (!qemu_cfg_present)
+ return 0;
+
+ qemu_cfg_read_entry(&v, QEMU_CFG_IRQ0_OVERRIDE, sizeof(v));
+
+ return v;
+}
+
u16 qemu_cfg_acpi_additional_tables(void)
{
u16 cnt;
@@ -34,12 +34,14 @@ static inline int kvm_para_available(void)
#define QEMU_CFG_ARCH_LOCAL 0x8000
#define QEMU_CFG_ACPI_TABLES (QEMU_CFG_ARCH_LOCAL + 0)
#define QEMU_CFG_SMBIOS_ENTRIES (QEMU_CFG_ARCH_LOCAL + 1)
+#define QEMU_CFG_IRQ0_OVERRIDE (QEMU_CFG_ARCH_LOCAL + 1)
extern int qemu_cfg_present;
void qemu_cfg_port_probe(void);
int qemu_cfg_show_boot_menu(void);
void qemu_cfg_get_uuid(u8 *uuid);
+int qemu_cfg_irq0_override(void);
u16 qemu_cfg_acpi_additional_tables(void);
u16 qemu_cfg_next_acpi_table_len(void);
void *qemu_cfg_next_acpi_table_load(void *addr, u16 len);
@@ -302,9 +302,6 @@ void reset_vector() __attribute__ ((noreturn));
// misc.c
extern u8 BiosChecksum;
-// mptable.c
-extern int irq0override;
-
// version (auto generated file out/version.c)
extern const char VERSION[];
Read it instead of relying on compile time flag. Signed-off-by: Gleb Natapov <gleb@redhat.com> --- src/acpi.c | 2 +- src/mptable.c | 9 ++------- src/paravirt.c | 12 ++++++++++++ src/paravirt.h | 2 ++ src/util.h | 3 --- 5 files changed, 17 insertions(+), 11 deletions(-)