diff mbox series

[v2,06/13] KVM: selftests: ensure ucall_shared_alloc() allocates shared memory

Message ID 20211216171358.61140-7-michael.roth@amd.com
State New
Headers show
Series KVM: selftests: Add tests for SEV and SEV-ES guests | expand

Commit Message

Michael Roth Dec. 16, 2021, 5:13 p.m. UTC
Now that vm_vaddr_alloc() allocates encrypted/private guest memory by
default for confidential guests, ucall_shared_alloc() needs to be
switched over to using the new vm_vaddr_alloc_shared() function to
ensure that shared memory is used for the allocation.

Signed-off-by: Michael Roth <michael.roth@amd.com>
---
 tools/testing/selftests/kvm/lib/ucall_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/kvm/lib/ucall_common.c b/tools/testing/selftests/kvm/lib/ucall_common.c
index 8e5738241a7c..54c6c159dcd5 100644
--- a/tools/testing/selftests/kvm/lib/ucall_common.c
+++ b/tools/testing/selftests/kvm/lib/ucall_common.c
@@ -97,8 +97,8 @@  uint64_t get_ucall(struct kvm_vm *vm, uint32_t vcpu_id, struct ucall *uc)
 /* Allocate shared memory within a guest to for a shared ucall buffer. */
 vm_vaddr_t ucall_shared_alloc(struct kvm_vm *vm, int count)
 {
-	return vm_vaddr_alloc(vm, count * sizeof(struct ucall),
-			      vm_get_page_size(vm));
+	return vm_vaddr_alloc_shared(vm, count * sizeof(struct ucall),
+				     vm_get_page_size(vm));
 }
 
 /*