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

From: Michael Roth
Date: Thu Dec 16 2021 - 12:18:29 EST


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@xxxxxxx>
---
tools/testing/selftests/kvm/lib/ucall_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

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));
}

/*
--
2.25.1