lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 7 Nov 2022 15:32:06 +0000
From:   Andrew Cooper <Andrew.Cooper3@...rix.com>
To:     Paolo Bonzini <pbonzini@...hat.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>
CC:     "nathan@...nel.org" <nathan@...nel.org>,
        "thomas.lendacky@....com" <thomas.lendacky@....com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "jmattson@...gle.com" <jmattson@...gle.com>,
        "seanjc@...gle.com" <seanjc@...gle.com>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>,
        Andrew Cooper <Andrew.Cooper3@...rix.com>
Subject: Re: [PATCH 4/8] KVM: SVM: move guest vmsave/vmload to assembly

On 07/11/2022 14:54, Paolo Bonzini wrote:
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 4cfa62e66a0e..ae65cdcab660 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -3924,16 +3924,7 @@ static noinstr void svm_vcpu_enter_exit(struct kvm_vcpu *vcpu)
>  	} else {
>  		struct svm_cpu_data *sd = per_cpu(svm_data, vcpu->cpu);
>  
> -		/*
> -		 * Use a single vmcb (vmcb01 because it's always valid) for
> -		 * context switching guest state via VMLOAD/VMSAVE, that way
> -		 * the state doesn't need to be copied between vmcb01 and
> -		 * vmcb02 when switching vmcbs for nested virtualization.
> -		 */
> -		vmload(svm->vmcb01.pa);
>  		__svm_vcpu_run(vmcb_pa, svm);
> -		vmsave(svm->vmcb01.pa);
> -
>  		vmload(__sme_page_pa(sd->save_area));

%gs is still the guests until this vmload has completed.  It needs to
move down into asm too.

~Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ