mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
target/i386: always create kvmclock device
QEMU's kvmclock device is only created when KVM PV feature bits for kvmclock (KVM_FEATURE_CLOCKSOURCE/KVM_FEATURE_CLOCKSOURCE2) are exposed to the guest. With 'kvm=off' cpu flag the device is not created and we don't call KVM_GET_CLOCK/KVM_SET_CLOCK upon migration. It was reported that without these call at least Hyper-V TSC page clocksouce (which can be enabled independently) gets broken after migration. Switch to creating kvmclock QEMU device unconditionally, it seems to always make sense to call KVM_GET_CLOCK/KVM_SET_CLOCK on migration. Use KVM_CAP_ADJUST_CLOCK check instead of CPUID feature bits. Reported-by: Antoine Damhet <antoine.damhet@blade-group.com> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Message-Id: <20200922151934.899555-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
6615be072d
commit
8700a98443
9 changed files with 27 additions and 8 deletions
|
@ -179,7 +179,7 @@ static void pc_q35_init(MachineState *machine)
|
|||
|
||||
x86_cpus_init(x86ms, pcmc->default_cpu_version);
|
||||
|
||||
kvmclock_create();
|
||||
kvmclock_create(pcmc->kvmclock_create_always);
|
||||
|
||||
/* pci enabled */
|
||||
if (pcmc->pci_enabled) {
|
||||
|
@ -357,10 +357,13 @@ DEFINE_Q35_MACHINE(v5_2, "pc-q35-5.2", NULL,
|
|||
|
||||
static void pc_q35_5_1_machine_options(MachineClass *m)
|
||||
{
|
||||
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
|
||||
|
||||
pc_q35_5_2_machine_options(m);
|
||||
m->alias = NULL;
|
||||
compat_props_add(m->compat_props, hw_compat_5_1, hw_compat_5_1_len);
|
||||
compat_props_add(m->compat_props, pc_compat_5_1, pc_compat_5_1_len);
|
||||
pcmc->kvmclock_create_always = false;
|
||||
}
|
||||
|
||||
DEFINE_Q35_MACHINE(v5_1, "pc-q35-5.1", NULL,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue