diff options
| author | Pratik R. Sampat <prsampat@amd.com> | 2025-03-05 16:59:53 -0600 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2025-05-02 12:32:32 -0700 |
| commit | c4e1a848d72179136f6ea9626933cb26c9d35eb5 (patch) | |
| tree | b1f58ed329458b3b78afa87f8c7ce8be37f72b0a /tools/testing/selftests/kvm/include | |
| parent | KVM: selftests: SEV-SNP test for KVM_SEV_INIT2 (diff) | |
| download | linux-c4e1a848d72179136f6ea9626933cb26c9d35eb5.tar.gz linux-c4e1a848d72179136f6ea9626933cb26c9d35eb5.zip | |
KVM: selftests: Add vmgexit helper
Abstract rep vmmcall coded into the vmgexit helper for the sev
library.
No functional change intended.
Signed-off-by: Pratik R. Sampat <prsampat@amd.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
Link: https://lore.kernel.org/r/20250305230000.231025-4-prsampat@amd.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include')
| -rw-r--r-- | tools/testing/selftests/kvm/include/x86/sev.h | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |
