diff options
| author | Fred Griffoul <[email protected]> | 2025-01-24 15:05:39 +0000 |
|---|---|---|
| committer | Sean Christopherson <[email protected]> | 2025-02-25 15:09:55 +0000 |
| commit | a2b00f85d7839d74a2f6fcbf547d4bf2e82c34e5 (patch) | |
| tree | ae03428a7cd98b7a327c22f76d831de7c6628bd1 /arch/x86/kvm/xen.c | |
| parent | KVM: x86/xen: Move kvm_xen_hvm_config field into kvm_xen (diff) | |
| download | kernel-a2b00f85d7839d74a2f6fcbf547d4bf2e82c34e5.tar.gz kernel-a2b00f85d7839d74a2f6fcbf547d4bf2e82c34e5.zip | |
KVM: x86: Update Xen TSC leaves during CPUID emulation
The Xen emulation in KVM modifies certain CPUID leaves to expose
TSC information to the guest.
Previously, these CPUID leaves were updated whenever guest time changed,
but this conflicts with KVM_SET_CPUID/KVM_SET_CPUID2 ioctls which reject
changes to CPUID entries on running vCPUs.
Fix this by updating the TSC information directly in the CPUID emulation
handler instead of modifying the vCPU's CPUID entries.
Signed-off-by: Fred Griffoul <[email protected]>
Reviewed-by: Paul Durrant <[email protected]>
Reviewed-by: David Woodhouse <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'arch/x86/kvm/xen.c')
| -rw-r--r-- | arch/x86/kvm/xen.c | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c index 8aef7cd24349..9174aa45597b 100644 --- a/arch/x86/kvm/xen.c +++ b/arch/x86/kvm/xen.c @@ -2256,29 +2256,6 @@ void kvm_xen_destroy_vcpu(struct kvm_vcpu *vcpu) del_timer_sync(&vcpu->arch.xen.poll_timer); } -void kvm_xen_update_tsc_info(struct kvm_vcpu *vcpu) -{ - struct kvm_cpuid_entry2 *entry; - u32 function; - - if (!vcpu->arch.xen.cpuid.base) - return; - - function = vcpu->arch.xen.cpuid.base | XEN_CPUID_LEAF(3); - if (function > vcpu->arch.xen.cpuid.limit) - return; - - entry = kvm_find_cpuid_entry_index(vcpu, function, 1); - if (entry) { - entry->ecx = vcpu->arch.hv_clock.tsc_to_system_mul; - entry->edx = vcpu->arch.hv_clock.tsc_shift; - } - - entry = kvm_find_cpuid_entry_index(vcpu, function, 2); - if (entry) - entry->eax = vcpu->arch.hw_tsc_khz; -} - void kvm_xen_init_vm(struct kvm *kvm) { mutex_init(&kvm->arch.xen.xen_lock); |
