@@ -1520,7 +1520,8 @@ static const MemoryRegionOps ioportF0_io_ops = {
},
};
-void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
+void pc_basic_device_init(PCMachineState *pcms,
+ ISABus *isa_bus, qemu_irq *gsi,
ISADevice **rtc_state,
bool create_fdctrl,
bool no_vmport,
@@ -1577,7 +1578,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
qemu_register_boot_set(pc_boot_set, *rtc_state);
- if (!xen_enabled()) {
+ if (!xen_enabled() && pcms->pit) {
if (kvm_pit_in_kernel()) {
pit = kvm_pit_init(isa_bus, 0x40);
} else {
@@ -2194,6 +2195,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);
+ PC_MACHINE_DEFINE_PROP_BOOL(pcms, PC_MACHINE_PIT, pit, true);
}
static void pc_machine_reset(void)
@@ -235,7 +235,7 @@ static void pc_init1(MachineState *machine,
}
/* init basic PC hardware */
- pc_basic_device_init(isa_bus, gsi, &rtc_state, true,
+ pc_basic_device_init(pcms, isa_bus, gsi, &rtc_state, true,
(pcms->vmport != ON_OFF_AUTO_ON), 0x4);
pc_nic_init(isa_bus, pci_bus);
@@ -228,7 +228,7 @@ static void pc_q35_init(MachineState *machine)
}
/* init basic PC hardware */
- pc_basic_device_init(isa_bus, gsi, &rtc_state, !mc->no_floppy,
+ pc_basic_device_init(pcms, isa_bus, gsi, &rtc_state, !mc->no_floppy,
(pcms->vmport != ON_OFF_AUTO_ON), 0xff0104);
/* connect pm stuff to lpc */
@@ -80,6 +80,7 @@ struct PCMachineState {
bool smbus;
bool sata;
bool pic;
+ bool pit;
};
#define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device"
@@ -91,6 +92,7 @@ struct PCMachineState {
#define PC_MACHINE_SMBUS "smbus"
#define PC_MACHINE_SATA "sata"
#define PC_MACHINE_PIC "pic"
+#define PC_MACHINE_PIT "pit"
/**
* PCMachineClass:
@@ -262,7 +264,8 @@ void pc_memory_init(PCMachineState *pcms,
MemoryRegion **ram_memory);
qemu_irq pc_allocate_cpu_irq(void);
DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
-void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
+void pc_basic_device_init(PCMachineState *pcms,
+ ISABus *isa_bus, qemu_irq *gsi,
ISADevice **rtc_state,
bool create_fdctrl,
bool no_vmport,
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com> --- hw/i386/pc.c | 6 ++++-- hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- include/hw/i386/pc.h | 5 ++++- 4 files changed, 10 insertions(+), 5 deletions(-)