[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6e342579-efed-462d-ba2c-c844e0d614df@amd.com>
Date: Thu, 6 Mar 2025 05:38:31 +0100
From: "Gupta, Pankaj" <pankaj.gupta@....com>
To: "Pratik R. Sampat" <prsampat@....com>, linux-kernel@...r.kernel.org,
x86@...nel.org, kvm@...r.kernel.org, linux-kselftest@...r.kernel.org
Cc: seanjc@...gle.com, pbonzini@...hat.com, thomas.lendacky@....com,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, shuah@...nel.org, pgonda@...gle.com,
ashish.kalra@....com, nikunj@....com, michael.roth@....com, sraithal@....com
Subject: Re: [PATCH v8 03/10] KVM: selftests: Add vmgexit helper
On 3/5/2025 11:59 PM, Pratik R. Sampat wrote:
> Abstract rep vmmcall coded into the vmgexit helper for the sev
> library.
>
> No functional change intended.
>
> Signed-off-by: Pratik R. Sampat <prsampat@....com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@....com>
> ---
> tools/testing/selftests/kvm/include/x86/sev.h | 5 +++++
> tools/testing/selftests/kvm/x86/sev_smoke_test.c | 2 +-
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/include/x86/sev.h b/tools/testing/selftests/kvm/include/x86/sev.h
> index 82c11c81a956..3003dc837fb7 100644
> --- a/tools/testing/selftests/kvm/include/x86/sev.h
> +++ b/tools/testing/selftests/kvm/include/x86/sev.h
> @@ -71,6 +71,11 @@ kvm_static_assert(SEV_RET_SUCCESS == 0);
> void sev_vm_init(struct kvm_vm *vm);
> void sev_es_vm_init(struct kvm_vm *vm);
>
> +static inline void vmgexit(void)
> +{
> + __asm__ __volatile__("rep; vmmcall");
> +}
> +
> static inline void sev_register_encrypted_memory(struct kvm_vm *vm,
> struct userspace_mem_region *region)
> {
> diff --git a/tools/testing/selftests/kvm/x86/sev_smoke_test.c b/tools/testing/selftests/kvm/x86/sev_smoke_test.c
> index a1a688e75266..6812b94bf5b6 100644
> --- a/tools/testing/selftests/kvm/x86/sev_smoke_test.c
> +++ b/tools/testing/selftests/kvm/x86/sev_smoke_test.c
> @@ -27,7 +27,7 @@ static void guest_sev_es_code(void)
> * force "termination" to signal "done" via the GHCB MSR protocol.
> */
> wrmsr(MSR_AMD64_SEV_ES_GHCB, GHCB_MSR_TERM_REQ);
> - __asm__ __volatile__("rep; vmmcall");
> + vmgexit();
> }
>
> static void guest_sev_code(void)
Powered by blists - more mailing lists