lkml.org 
[lkml]   [2021]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 00/11] KVM: VMX: Clean up Hyper-V PV TLB flush
From
Date
On 09/03/21 02:18, Sean Christopherson wrote:
> Maybe this series is cursed. The first patch got mangled and broke SME.
> It shows up as two commits with the same changelog, so maybe you intended to
> split the patch and things went sideways?

There was a conflict. I admit kvm/queue is not always that good,
usually I try to test it but yesterday I just didn't have time.

I'll fix up everything (also 20/24 in the other series).

Oh well, you have to break eggs to make an omelette. :)

Paolo

> Anyways, commit a16241ae56fa ("KVM: x86: Get active PCID only when writing a
> CR3 value") breaks SME and PCID. The kvm/queue code looks like this:
>
>
> cr3 = __sme_set(root_hpa);
> if (npt_enabled) {
> svm->vmcb->control.nested_cr3 = root_hpa;
> vmcb_mark_dirty(svm->vmcb, VMCB_NPT);
>
> /* Loading L2's CR3 is handled by enter_svm_guest_mode. */
> if (!test_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail))
> return;
> cr3 = vcpu->arch.cr3;
> }
>
> svm->vmcb->save.cr3 = cr3;
> vmcb_mark_dirty(svm->vmcb, VMCB_CR);
>
> but it should look like this:
>
> if (npt_enabled) {
> svm->vmcb->control.nested_cr3 = __sme_set(root);
> vmcb_mark_dirty(svm->vmcb, VMCB_NPT);
>
> /* Loading L2's CR3 is handled by enter_svm_guest_mode. */
> if (!test_bit(VCPU_EXREG_CR3, (ulong *)&vcpu->arch.regs_avail))
> return;
> cr3 = vcpu->arch.cr3;
> } else if (vcpu->arch.mmu->shadow_root_level >= PT64_ROOT_4LEVEL) {
> cr3 = __sme_set(root);
> } else {
> cr3 = root;
> }
>
> svm->vmcb->save.cr3 = cr3;
> vmcb_mark_dirty(svm->vmcb, VMCB_CR);
>
> I'll generate a delta patch, and test and post, just in case there is other
> stuff that got lost.
>

\
 
 \ /
  Last update: 2021-03-09 09:36    [W:0.104 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site