Commit e3538504 authored by Sean Christopherson's avatar Sean Christopherson
Browse files

KVM: selftests: Rename vm_get_page_table_entry() to vm_get_pte()



Shorten the API to get a PTE as the "PTE" acronym is ubiquitous, and the
"page table entry" makes it unnecessarily difficult to quickly understand
what callers are doing.

No functional change intended.

Reviewed-by: default avatarYosry Ahmed <yosry.ahmed@linux.dev>
Link: https://patch.msgid.link/20251230230150.4150236-21-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 59eef1a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1359,7 +1359,7 @@ static inline bool kvm_is_ignore_msrs(void)
	return get_kvm_param_bool("ignore_msrs");
}

uint64_t *vm_get_page_table_entry(struct kvm_vm *vm, uint64_t vaddr);
uint64_t *vm_get_pte(struct kvm_vm *vm, uint64_t vaddr);

uint64_t kvm_hypercall(uint64_t nr, uint64_t a0, uint64_t a1, uint64_t a2,
		       uint64_t a3);
+1 −1
Original line number Diff line number Diff line
@@ -390,7 +390,7 @@ static uint64_t *__vm_get_page_table_entry(struct kvm_vm *vm,
	return virt_get_pte(vm, mmu, pte, vaddr, PG_LEVEL_4K);
}

uint64_t *vm_get_page_table_entry(struct kvm_vm *vm, uint64_t vaddr)
uint64_t *vm_get_pte(struct kvm_vm *vm, uint64_t vaddr)
{
	int level = PG_LEVEL_4K;

+1 −1
Original line number Diff line number Diff line
@@ -619,7 +619,7 @@ int main(int argc, char *argv[])
	 */
	gva = vm_vaddr_unused_gap(vm, NTEST_PAGES * PAGE_SIZE, KVM_UTIL_MIN_VADDR);
	for (i = 0; i < NTEST_PAGES; i++) {
		pte = vm_get_page_table_entry(vm, data->test_pages + i * PAGE_SIZE);
		pte = vm_get_pte(vm, data->test_pages + i * PAGE_SIZE);
		gpa = addr_hva2gpa(vm, pte);
		virt_pg_map(vm, gva + PAGE_SIZE * i, gpa & PAGE_MASK);
		data->test_pages_pte[i] = gva + (gpa & ~PAGE_MASK);
+1 −3
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ int main(int argc, char *argv[])
	struct kvm_vcpu *vcpu;
	struct kvm_vm *vm;
	struct ucall uc;
	uint64_t *pte;
	uint64_t *hva;
	uint64_t gpa;
	int rc;
@@ -73,8 +72,7 @@ int main(int argc, char *argv[])
	hva = addr_gpa2hva(vm, MEM_REGION_GPA);
	memset(hva, 0, PAGE_SIZE);

	pte = vm_get_page_table_entry(vm, MEM_REGION_GVA);
	*pte |= BIT_ULL(MAXPHYADDR);
	*vm_get_pte(vm, MEM_REGION_GVA) |= BIT_ULL(MAXPHYADDR);

	vcpu_run(vcpu);