From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Sean Christopherson <seanjc@google.com>
Subject: [GIT PULL] KVM: x86: Changes for 6.15
Date: Tue, 18 Mar 2025 11:02:55 -0700 [thread overview]
Message-ID: <20250318180303.283401-1-seanjc@google.com> (raw)
There are two conflicts between the PV clock pull request and the Xen
pull request.
1. The Xen branch moves Xen TSC leaf updates to CPUID emulation, and the PV
clock branch renames the fields in kvm_vcpu_arch that are used to update
the Xen leafs. After the dust settles, kvm_cpuid() should look like:
} else if (IS_ENABLED(CONFIG_KVM_XEN) &&
kvm_xen_is_tsc_leaf(vcpu, function)) {
/*
* Update guest TSC frequency information if necessary.
* Ignore failures, there is no sane value that can be
* provided if KVM can't get the TSC frequency.
*/
if (kvm_check_request(KVM_REQ_CLOCK_UPDATE, vcpu))
kvm_guest_time_update(vcpu);
if (index == 1) {
*ecx = vcpu->arch.pvclock_tsc_mul;
*edx = vcpu->arch.pvclock_tsc_shift;
} else if (index == 2) {
*eax = vcpu->arch.hw_tsc_khz;
}
}
2. The Xen branch moves and renames xen_hvm_config so that its xen.hvm_config,
while PV clock branch shuffles use of xen_hvm_config/xen.hvm_config flags.
The resulting code in kvm_guest_time_update() should look like:
#ifdef CONFIG_KVM_XEN
/*
* For Xen guests we may need to override PVCLOCK_TSC_STABLE_BIT as unless
* explicitly told to use TSC as its clocksource Xen will not set this bit.
* This default behaviour led to bugs in some guest kernels which cause
* problems if they observe PVCLOCK_TSC_STABLE_BIT in the pvclock flags.
*
* Note! Clear TSC_STABLE only for Xen clocks, i.e. the order matters!
*/
if (ka->xen.hvm_config.flags & KVM_XEN_HVM_CONFIG_PVCLOCK_TSC_UNSTABLE)
hv_clock.flags &= ~PVCLOCK_TSC_STABLE_BIT;
if (vcpu->xen.vcpu_info_cache.active)
kvm_setup_guest_pvclock(&hv_clock, v, &vcpu->xen.vcpu_info_cache,
offsetof(struct compat_vcpu_info, time));
if (vcpu->xen.vcpu_time_info_cache.active)
kvm_setup_guest_pvclock(&hv_clock, v, &vcpu->xen.vcpu_time_info_cache, 0);
#endif
next reply other threads:[~2025-03-18 18:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-18 18:02 Sean Christopherson [this message]
2025-03-18 18:02 ` [GIT PULL] KVM: x86: Misc changes for 6.15 Sean Christopherson
2025-03-18 18:02 ` [GIT PULL] KVM: x86: MMU " Sean Christopherson
2025-03-18 18:02 ` [GIT PULL] KVM: x86: PV clock " Sean Christopherson
2025-03-18 18:02 ` [GIT PULL] KVM: Selftests changes for 6.15, part 2 Sean Christopherson
2025-03-18 18:03 ` [GIT PULL] KVM: Selftests changes for 6.15, part 1 Sean Christopherson
2025-03-18 18:03 ` [GIT PULL] KVM: x86: SVM changes for 6.15 Sean Christopherson
2025-03-18 18:03 ` [GIT PULL] KVM: x86: VMX " Sean Christopherson
2025-03-18 18:03 ` [GIT PULL] KVM: x86: Xen " Sean Christopherson
2025-03-19 17:53 ` [GIT PULL] KVM: x86: Changes " Paolo Bonzini
2025-03-19 19:42 ` Sean Christopherson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250318180303.283401-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox