diff options
-rw-r--r-- | hw/pc.c | 3 | ||||
-rw-r--r-- | kvm-all.c | 5 | ||||
-rw-r--r-- | kvm-stub.c | 5 | ||||
-rw-r--r-- | kvm.h | 2 | ||||
-rw-r--r-- | sysemu.h | 1 | ||||
-rw-r--r-- | vl.c | 1 |
6 files changed, 14 insertions, 3 deletions
@@ -39,6 +39,7 @@ #include "msi.h" #include "sysbus.h" #include "sysemu.h" +#include "kvm.h" #include "blockdev.h" #include "ui/qemu-spice.h" #include "memory.h" @@ -609,7 +610,7 @@ static void *bochs_bios_init(void) fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES, (uint8_t *)acpi_tables, acpi_tables_len); - fw_cfg_add_bytes(fw_cfg, FW_CFG_IRQ0_OVERRIDE, &irq0override, 1); + fw_cfg_add_i32(fw_cfg, FW_CFG_IRQ0_OVERRIDE, kvm_allows_irq0_override()); smbios_table = smbios_get_table(&smbios_len); if (smbios_table) @@ -1307,6 +1307,11 @@ int kvm_has_gsi_routing(void) return kvm_check_extension(kvm_state, KVM_CAP_IRQ_ROUTING); } +int kvm_allows_irq0_override(void) +{ + return !kvm_enabled() || !kvm_irqchip_in_kernel() || kvm_has_gsi_routing(); +} + void kvm_setup_guest_memory(void *start, size_t size) { if (!kvm_has_sync_mmu()) { diff --git a/kvm-stub.c b/kvm-stub.c index 06064b9a86..6c2b06ba32 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -78,6 +78,11 @@ int kvm_has_many_ioeventfds(void) return 0; } +int kvm_allows_irq0_override(void) +{ + return 1; +} + void kvm_setup_guest_memory(void *start, size_t size) { } @@ -53,6 +53,8 @@ int kvm_has_xcrs(void); int kvm_has_many_ioeventfds(void); int kvm_has_gsi_routing(void); +int kvm_allows_irq0_override(void); + #ifdef NEED_CPU_H int kvm_init_vcpu(CPUState *env); @@ -102,7 +102,6 @@ extern int vga_interface_type; extern int graphic_width; extern int graphic_height; extern int graphic_depth; -extern uint8_t irq0override; extern DisplayType display_type; extern const char *keyboard_layout; extern int win2k_install_hack; @@ -218,7 +218,6 @@ int no_reboot = 0; int no_shutdown = 0; int cursor_hide = 1; int graphic_rotate = 0; -uint8_t irq0override = 1; const char *watchdog; QEMUOptionRom option_rom[MAX_OPTION_ROMS]; int nb_option_roms; |