[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <09f57158-3b79-4c61-834c-950ed40b7605@amd.com>
Date: Fri, 24 Jan 2025 10:18:25 +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-crypto@...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 v5 4/9] KVM: selftests: Add VMGEXIT helper
On 1/23/2025 11:00 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 | 2 ++
> tools/testing/selftests/kvm/x86/sev_smoke_test.c | 2 +-
> 2 files changed, 3 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..e7df5d0987f6 100644
> --- a/tools/testing/selftests/kvm/include/x86/sev.h
> +++ b/tools/testing/selftests/kvm/include/x86/sev.h
> @@ -27,6 +27,8 @@ enum sev_guest_state {
>
> #define GHCB_MSR_TERM_REQ 0x100
>
> +#define VMGEXIT() { __asm__ __volatile__("rep; vmmcall"); }
> +
> void sev_vm_launch(struct kvm_vm *vm, uint32_t policy);
> void sev_vm_launch_measure(struct kvm_vm *vm, uint8_t *measurement);
> void sev_vm_launch_finish(struct kvm_vm *vm);
> diff --git a/tools/testing/selftests/kvm/x86/sev_smoke_test.c b/tools/testing/selftests/kvm/x86/sev_smoke_test.c
> index a1a688e75266..38f647fe55d2 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