From 5d17c0d2df4998598e6002b27b8e47e792899a0f Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 2 Mar 2012 20:28:49 +0100 Subject: kvm: x86: Add user space part for in-kernel i8254 This provides the required user space stubs to enable the in-kernel i8254 emulation of KVM. The in-kernel model supports lost tick compensation according to the "delay" policy. This is enabled by default and can be switched off via a device property. Depending on the feature set of the host kernel (before 2.6.32), we may have to disable the HPET or lack sound output from the PC speaker. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- hw/i8254.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'hw/i8254.h') diff --git a/hw/i8254.h b/hw/i8254.h index a1d2e9835b..ba6b598a99 100644 --- a/hw/i8254.h +++ b/hw/i8254.h @@ -51,6 +51,17 @@ static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq, return dev; } +static inline ISADevice *kvm_pit_init(ISABus *bus, int base) +{ + ISADevice *dev; + + dev = isa_create(bus, "kvm-pit"); + qdev_prop_set_uint32(&dev->qdev, "iobase", base); + qdev_init_nofail(&dev->qdev); + + return dev; +} + void pit_set_gate(ISADevice *dev, int channel, int val); void pit_get_channel_info(ISADevice *dev, int channel, PITChannelInfo *info); -- cgit v1.2.3