[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bdbd5050-bce1-33db-20d1-b3023aec4df7@redhat.com>
Date: Wed, 9 Mar 2022 14:00:09 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Maxim Levitsky <mlevitsk@...hat.com>, kvm@...r.kernel.org
Cc: Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Sean Christopherson <seanjc@...gle.com>,
Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Jim Mattson <jmattson@...gle.com>, x86@...nel.org,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Joerg Roedel <joro@...tes.org>, linux-kernel@...r.kernel.org,
Wanpeng Li <wanpengli@...cent.com>
Subject: Re: [PATCH v3 2/7] KVM: x86: nSVM: implement nested LBR
virtualization
On 3/1/22 15:36, Maxim Levitsky wrote:
> @@ -565,8 +565,19 @@ static void nested_vmcb02_prepare_save(struct vcpu_svm *svm, struct vmcb *vmcb12
> vmcb_mark_dirty(svm->vmcb, VMCB_DR);
> }
>
> - if (unlikely(svm->vmcb01.ptr->control.virt_ext & LBR_CTL_ENABLE_MASK))
> + if (unlikely(svm->lbrv_enabled && (svm->nested.ctl.virt_ext & LBR_CTL_ENABLE_MASK))) {
> +
> + /* Copy LBR related registers from vmcb12,
> + * but make sure that we only pick LBR enable bit from the guest.
> + */
> +
> + svm_copy_lbrs(vmcb12, svm->vmcb);
> + svm->vmcb->save.dbgctl &= LBR_CTL_ENABLE_MASK;
This should be checked against DEBUGCTL_RESERVED_BITS instead in
__nested_vmcb_check_save; remember to add dbgctl to struct
vmcb_save_area_cached too.
Paolo
> + svm_update_lbrv(&svm->vcpu);
> +
> + } else if (unlikely(svm->vmcb01.ptr->control.virt_ext & LBR_CTL_ENABLE_MASK)) {
> svm_copy_lbrs(svm->vmcb01.ptr, svm->vmcb);
> + }
> }
Powered by blists - more mailing lists