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]
Message-ID: <c4994952-efe0-ffe1-a129-7525ec9e7317@redhat.com>
Date:   Tue, 25 Jan 2022 17:29:21 +0100
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Jinrong Liang <ljr.kernel@...il.com>
Cc:     Xianting Tian <xianting.tian@...ux.alibaba.com>,
        Jim Mattson <jmattson@...gle.com>,
        Sean Christopherson <seanjc@...gle.com>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 09/19] KVM: x86/svm: Remove unused "svm" of
 sev_es_prepare_guest_switch()

On 1/25/22 10:58, Jinrong Liang wrote:
> From: Jinrong Liang <cloudliang@...cent.com>
> 
> The "struct vcpu_svm *svm" parameter of sev_es_prepare_guest_switch()
> is not used, so remove it. No functional change intended.
> 
> Signed-off-by: Jinrong Liang <cloudliang@...cent.com>
> ---
>   arch/x86/kvm/svm/sev.c | 2 +-
>   arch/x86/kvm/svm/svm.c | 2 +-
>   arch/x86/kvm/svm/svm.h | 2 +-
>   3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> index 6a22798eaaee..eae234afe04e 100644
> --- a/arch/x86/kvm/svm/sev.c
> +++ b/arch/x86/kvm/svm/sev.c
> @@ -2902,7 +2902,7 @@ void sev_es_vcpu_reset(struct vcpu_svm *svm)
>   					    sev_enc_bit));
>   }
>   
> -void sev_es_prepare_guest_switch(struct vcpu_svm *svm, unsigned int cpu)
> +void sev_es_prepare_guest_switch(unsigned int cpu)
>   {
>   	struct svm_cpu_data *sd = per_cpu(svm_data, cpu);
>   	struct vmcb_save_area *hostsa;
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 744ddc7ad6ad..3e75ae834412 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -1276,7 +1276,7 @@ static void svm_prepare_guest_switch(struct kvm_vcpu *vcpu)
>   	 * or subsequent vmload of host save area.
>   	 */
>   	if (sev_es_guest(vcpu->kvm)) {
> -		sev_es_prepare_guest_switch(svm, vcpu->cpu);
> +		sev_es_prepare_guest_switch(vcpu->cpu);
>   	} else {
>   		vmsave(__sme_page_pa(sd->save_area));
>   	}
> diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h
> index 47ef8f4a9358..0a749bbda738 100644
> --- a/arch/x86/kvm/svm/svm.h
> +++ b/arch/x86/kvm/svm/svm.h
> @@ -622,7 +622,7 @@ int sev_es_string_io(struct vcpu_svm *svm, int size, unsigned int port, int in);
>   void sev_es_init_vmcb(struct vcpu_svm *svm);
>   void sev_es_vcpu_reset(struct vcpu_svm *svm);
>   void sev_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector);
> -void sev_es_prepare_guest_switch(struct vcpu_svm *svm, unsigned int cpu);
> +void sev_es_prepare_guest_switch(unsigned int cpu);
>   void sev_es_unmap_ghcb(struct vcpu_svm *svm);
>   
>   /* vmenter.S */

This should instead receive a struct vmcb_save_area *, since the vmsave 
part is common between sev_es_prepare_guest_switch and the "else" branch 
in svm_prepare_guest_switch.  I'll send a patch - thanks for the report.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ