[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230725220132.2310657-25-afranji@google.com>
Date: Tue, 25 Jul 2023 22:01:17 +0000
From: Ryan Afranji <afranji@...gle.com>
To: linux-kselftest@...r.kernel.org
Cc: pbonzini@...hat.com, seanjc@...gle.com, isaku.yamahata@...el.com,
sagis@...gle.com, erdemaktas@...gle.com, afranji@...gle.com,
runanwang@...gle.com, shuah@...nel.org, drjones@...hat.com,
maz@...nel.org, bgardon@...gle.com, jmattson@...gle.com,
dmatlack@...gle.com, peterx@...hat.com, oupton@...gle.com,
ricarkol@...gle.com, yang.zhong@...el.com, wei.w.wang@...el.com,
xiaoyao.li@...el.com, pgonda@...gle.com, eesposit@...hat.com,
borntraeger@...ibm.com, eric.auger@...hat.com,
wangyanan55@...wei.com, aaronlewis@...gle.com, vkuznets@...hat.com,
pshier@...gle.com, axelrasmussen@...gle.com,
zhenzhong.duan@...el.com, maciej.szmigiero@...cle.com,
like.xu@...ux.intel.com, linux-kernel@...r.kernel.org,
kvm@...r.kernel.org, ackerleytng@...gle.com
Subject: [PATCH v4 24/28] KVM: selftests: Expose _vm_vaddr_alloc
From: Ackerley Tng <ackerleytng@...gle.com>
vm_vaddr_alloc always allocates memory in memslot 0. This allows users
of this function to choose which memslot to allocate virtual memory
in.
Signed-off-by: Ackerley Tng <ackerleytng@...gle.com>
Change-Id: I2755287f0c0c2983d278094776a3c51d1c9ce448
Signed-off-by: Ryan Afranji <afranji@...gle.com>
---
tools/testing/selftests/kvm/include/kvm_util_base.h | 3 +++
tools/testing/selftests/kvm/lib/kvm_util.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h b/tools/testing/selftests/kvm/include/kvm_util_base.h
index d793355599e1..4d02d1e6eb53 100644
--- a/tools/testing/selftests/kvm/include/kvm_util_base.h
+++ b/tools/testing/selftests/kvm/include/kvm_util_base.h
@@ -511,6 +511,9 @@ void vm_mem_region_delete(struct kvm_vm *vm, uint32_t slot);
struct kvm_vcpu *__vm_vcpu_add(struct kvm_vm *vm, uint32_t vcpu_id);
void vm_populate_vaddr_bitmap(struct kvm_vm *vm);
vm_vaddr_t vm_vaddr_unused_gap(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min);
+vm_vaddr_t _vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min,
+ vm_paddr_t paddr_min, uint32_t data_memslot,
+ bool encrypt);
vm_vaddr_t vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min);
vm_vaddr_t __vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min,
enum kvm_mem_region_type type);
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index 7db9437505d7..bed218c4f8b4 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -1393,7 +1393,7 @@ vm_vaddr_t __vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min,
* a unique set of pages, with the minimum real allocation being at least
* a page.
*/
-static vm_vaddr_t
+vm_vaddr_t
_vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min,
vm_paddr_t paddr_min, uint32_t data_memslot, bool encrypt)
{
--
2.41.0.487.g6d72f3e995-goog
Powered by blists - more mailing lists