mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
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>
This commit is contained in:
parent
68ed692e39
commit
c4e1a848d7
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user