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/x86.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/x86.c')
| -rw-r--r-- | arch/x86/kvm/x86.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index f97d4d435e7f..c3007982c88c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3170,7 +3170,7 @@ static void kvm_setup_guest_pvclock(struct kvm_vcpu *v, trace_kvm_pvclock_update(v->vcpu_id, &vcpu->hv_clock); } -static int kvm_guest_time_update(struct kvm_vcpu *v) +int kvm_guest_time_update(struct kvm_vcpu *v) { unsigned long flags, tgt_tsc_khz; unsigned seq; @@ -3253,7 +3253,6 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) &vcpu->hv_clock.tsc_shift, &vcpu->hv_clock.tsc_to_system_mul); vcpu->hw_tsc_khz = tgt_tsc_khz; - kvm_xen_update_tsc_info(v); } vcpu->hv_clock.tsc_timestamp = tsc_timestamp; |
