mirror of
https://github.com/qemu/qemu.git
synced 2024-11-24 03:13:44 +08:00
kvm: x86: Establish IRQ0 override control
KVM is forced to disable the IRQ0 override when we run with in-kernel irqchip but without IRQ routing support of the kernel. Set the fwcfg value correspondingly. This aligns us with qemu-kvm. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
84b058d7df
commit
9b5b76d449
3
hw/pc.c
3
hw/pc.c
@ -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()) {
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
2
kvm.h
2
kvm.h
@ -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);
|
||||
|
||||
|
1
sysemu.h
1
sysemu.h
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user