lkml.org 
[lkml]   [2022]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 09/19] KVM: x86/svm: Remove unused "svm" of sev_es_prepare_guest_switch()
From
On 1/25/22 10:58, Jinrong Liang wrote:
> From: Jinrong Liang <cloudliang@tencent.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@tencent.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

\
 
 \ /
  Last update: 2022-01-25 17:34    [W:1.944 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site