@@ -2193,6 +2193,7 @@ static void pc_machine_initfn(Object *obj)
PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SMBUS, smbus, true);
PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_SATA, sata, true);
+ PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIC, pic, true);
}
static void pc_machine_reset(void)
@@ -202,17 +202,20 @@ static void pc_q35_init(MachineState *machine)
pci_bus_set_route_irq_fn(host_bus, ich9_route_intx_pin_to_irq);
isa_bus = ich9_lpc->isa_bus;
- if (kvm_pic_in_kernel()) {
- i8259 = kvm_i8259_init(isa_bus);
- } else if (xen_enabled()) {
- i8259 = xen_interrupt_controller_init();
- } else {
- i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq());
- }
+ if (pcms->pic) {
+ if (kvm_pic_in_kernel()) {
+ i8259 = kvm_i8259_init(isa_bus);
+ } else if (xen_enabled()) {
+ i8259 = xen_interrupt_controller_init();
+ } else {
+ i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq());
+ }
- for (i = 0; i < ISA_NUM_IRQS; i++) {
- gsi_state->i8259_irq[i] = i8259[i];
+ for (i = 0; i < ISA_NUM_IRQS; i++) {
+ gsi_state->i8259_irq[i] = i8259[i];
+ }
}
+
if (pcmc->pci_enabled) {
ioapic_init_gsi(gsi_state, "q35");
}
@@ -79,6 +79,7 @@ struct PCMachineState {
bool smbus;
bool sata;
+ bool pic;
};
#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
@@ -89,6 +90,7 @@ struct PCMachineState {
#define PC_MACHINE_NVDIMM "nvdimm"
#define PC_MACHINE_SMBUS "smbus"
#define PC_MACHINE_SATA "sata"
+#define PC_MACHINE_PIC "pic"
/**
* PCMachineClass:
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com> --- hw/i386/pc.c | 1 + hw/i386/pc_q35.c | 21 ++++++++++++--------- include/hw/i386/pc.h | 2 ++ 3 files changed, 15 insertions(+), 9 deletions(-)