[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YBnwaiy8L/O0PCrR@google.com>
Date: Tue, 2 Feb 2021 16:38:02 -0800
From: Sean Christopherson <seanjc@...gle.com>
To: Michael Roth <michael.roth@....com>
Cc: kvm@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Andy Lutomirski <luto@...capital.net>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
x86@...nel.org, "H . Peter Anvin" <hpa@...or.com>,
linux-kernel@...r.kernel.org,
Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [PATCH v4 1/3] KVM: SVM: use vmsave/vmload for saving/restoring
additional host state
One quick comment while it's on my mind, I'll give this a proper gander tomorrow.
On Tue, Feb 02, 2021, Michael Roth wrote:
> diff --git a/arch/x86/kvm/svm/svm_ops.h b/arch/x86/kvm/svm/svm_ops.h
> index 0c8377aee52c..c2a05f56c8e4 100644
> --- a/arch/x86/kvm/svm/svm_ops.h
> +++ b/arch/x86/kvm/svm/svm_ops.h
> @@ -56,4 +56,9 @@ static inline void vmsave(hpa_t pa)
> svm_asm1(vmsave, "a" (pa), "memory");
> }
>
> +static inline void vmload(hpa_t pa)
This needs to be 'unsigned long', using 'hpa_t' in vmsave() is wrong as the
instructions consume rAX based on effective address. I wrote the function
comment for the vmsave() fix so that it applies to both VMSAVE and VMLOAD,
so this can be a simple fixup on application (assuming v5 isn't needed for
other reasons).
https://lkml.kernel.org/r/20210202223416.2702336-1-seanjc@google.com
> +{
> + svm_asm1(vmload, "a" (pa), "memory");
> +}
> +
> #endif /* __KVM_X86_SVM_OPS_H */
> --
> 2.25.1
>
Powered by blists - more mailing lists