Skip to content

Commit e353850

Browse files
committed
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: Yosry Ahmed <yosry.ahmed@linux.dev> Link: https://patch.msgid.link/20251230230150.4150236-21-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 59eef1a commit e353850

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

tools/testing/selftests/kvm/include/x86/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ static inline bool kvm_is_ignore_msrs(void)
13591359
return get_kvm_param_bool("ignore_msrs");
13601360
}
13611361

1362-
uint64_t *vm_get_page_table_entry(struct kvm_vm *vm, uint64_t vaddr);
1362+
uint64_t *vm_get_pte(struct kvm_vm *vm, uint64_t vaddr);
13631363

13641364
uint64_t kvm_hypercall(uint64_t nr, uint64_t a0, uint64_t a1, uint64_t a2,
13651365
uint64_t a3);

tools/testing/selftests/kvm/lib/x86/processor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ static uint64_t *__vm_get_page_table_entry(struct kvm_vm *vm,
390390
return virt_get_pte(vm, mmu, pte, vaddr, PG_LEVEL_4K);
391391
}
392392

393-
uint64_t *vm_get_page_table_entry(struct kvm_vm *vm, uint64_t vaddr)
393+
uint64_t *vm_get_pte(struct kvm_vm *vm, uint64_t vaddr)
394394
{
395395
int level = PG_LEVEL_4K;
396396

tools/testing/selftests/kvm/x86/hyperv_tlb_flush.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ int main(int argc, char *argv[])
619619
*/
620620
gva = vm_vaddr_unused_gap(vm, NTEST_PAGES * PAGE_SIZE, KVM_UTIL_MIN_VADDR);
621621
for (i = 0; i < NTEST_PAGES; i++) {
622-
pte = vm_get_page_table_entry(vm, data->test_pages + i * PAGE_SIZE);
622+
pte = vm_get_pte(vm, data->test_pages + i * PAGE_SIZE);
623623
gpa = addr_hva2gpa(vm, pte);
624624
virt_pg_map(vm, gva + PAGE_SIZE * i, gpa & PAGE_MASK);
625625
data->test_pages_pte[i] = gva + (gpa & ~PAGE_MASK);

tools/testing/selftests/kvm/x86/smaller_maxphyaddr_emulation_test.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ int main(int argc, char *argv[])
4747
struct kvm_vcpu *vcpu;
4848
struct kvm_vm *vm;
4949
struct ucall uc;
50-
uint64_t *pte;
5150
uint64_t *hva;
5251
uint64_t gpa;
5352
int rc;
@@ -73,8 +72,7 @@ int main(int argc, char *argv[])
7372
hva = addr_gpa2hva(vm, MEM_REGION_GPA);
7473
memset(hva, 0, PAGE_SIZE);
7574

76-
pte = vm_get_page_table_entry(vm, MEM_REGION_GVA);
77-
*pte |= BIT_ULL(MAXPHYADDR);
75+
*vm_get_pte(vm, MEM_REGION_GVA) |= BIT_ULL(MAXPHYADDR);
7876

7977
vcpu_run(vcpu);
8078

0 commit comments

Comments
 (0)