]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: selftests: Use gva_t instead of vm_vaddr_t
authorDavid Matlack <dmatlack@google.com>
Mon, 20 Apr 2026 21:19:46 +0000 (14:19 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 20 Apr 2026 21:54:16 +0000 (14:54 -0700)
Replace all occurrences of vm_vaddr_t with gva_t to align with KVM code
and with the conversion helpers (e.g. addr_gva2hva()).

This commit was generated with the following command:

  git ls-files tools/testing/selftests/kvm | xargs sed -i 's/vm_vaddr_/gva_/g'

Then by manually adjusting whitespace to make checkpatch.pl happy, and
dropping renames of functions that allocate memory within a given VM.

No functional change intended.

Signed-off-by: David Matlack <dmatlack@google.com>
[sean: drop renames of allocator APIs]
Link: https://patch.msgid.link/20260420212004.3938325-2-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
71 files changed:
tools/testing/selftests/kvm/arm64/vgic_irq.c
tools/testing/selftests/kvm/include/arm64/processor.h
tools/testing/selftests/kvm/include/arm64/ucall.h
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/include/kvm_util_types.h
tools/testing/selftests/kvm/include/loongarch/ucall.h
tools/testing/selftests/kvm/include/riscv/ucall.h
tools/testing/selftests/kvm/include/s390/ucall.h
tools/testing/selftests/kvm/include/ucall_common.h
tools/testing/selftests/kvm/include/x86/hyperv.h
tools/testing/selftests/kvm/include/x86/kvm_util_arch.h
tools/testing/selftests/kvm/include/x86/svm_util.h
tools/testing/selftests/kvm/include/x86/vmx.h
tools/testing/selftests/kvm/kvm_page_table_test.c
tools/testing/selftests/kvm/lib/arm64/processor.c
tools/testing/selftests/kvm/lib/arm64/ucall.c
tools/testing/selftests/kvm/lib/elf.c
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/loongarch/processor.c
tools/testing/selftests/kvm/lib/loongarch/ucall.c
tools/testing/selftests/kvm/lib/riscv/processor.c
tools/testing/selftests/kvm/lib/s390/processor.c
tools/testing/selftests/kvm/lib/ucall_common.c
tools/testing/selftests/kvm/lib/x86/hyperv.c
tools/testing/selftests/kvm/lib/x86/memstress.c
tools/testing/selftests/kvm/lib/x86/processor.c
tools/testing/selftests/kvm/lib/x86/svm.c
tools/testing/selftests/kvm/lib/x86/ucall.c
tools/testing/selftests/kvm/lib/x86/vmx.c
tools/testing/selftests/kvm/riscv/sbi_pmu_test.c
tools/testing/selftests/kvm/s390/memop.c
tools/testing/selftests/kvm/s390/tprot.c
tools/testing/selftests/kvm/steal_time.c
tools/testing/selftests/kvm/x86/amx_test.c
tools/testing/selftests/kvm/x86/aperfmperf_test.c
tools/testing/selftests/kvm/x86/cpuid_test.c
tools/testing/selftests/kvm/x86/evmcs_smm_controls_test.c
tools/testing/selftests/kvm/x86/hyperv_clock.c
tools/testing/selftests/kvm/x86/hyperv_evmcs.c
tools/testing/selftests/kvm/x86/hyperv_extended_hypercalls.c
tools/testing/selftests/kvm/x86/hyperv_features.c
tools/testing/selftests/kvm/x86/hyperv_ipi.c
tools/testing/selftests/kvm/x86/hyperv_svm_test.c
tools/testing/selftests/kvm/x86/hyperv_tlb_flush.c
tools/testing/selftests/kvm/x86/kvm_buslock_test.c
tools/testing/selftests/kvm/x86/kvm_clock_test.c
tools/testing/selftests/kvm/x86/nested_close_kvm_test.c
tools/testing/selftests/kvm/x86/nested_dirty_log_test.c
tools/testing/selftests/kvm/x86/nested_emulation_test.c
tools/testing/selftests/kvm/x86/nested_exceptions_test.c
tools/testing/selftests/kvm/x86/nested_invalid_cr3_test.c
tools/testing/selftests/kvm/x86/nested_tsc_adjust_test.c
tools/testing/selftests/kvm/x86/nested_tsc_scaling_test.c
tools/testing/selftests/kvm/x86/nested_vmsave_vmload_test.c
tools/testing/selftests/kvm/x86/sev_smoke_test.c
tools/testing/selftests/kvm/x86/smm_test.c
tools/testing/selftests/kvm/x86/state_test.c
tools/testing/selftests/kvm/x86/svm_int_ctl_test.c
tools/testing/selftests/kvm/x86/svm_lbr_nested_state.c
tools/testing/selftests/kvm/x86/svm_nested_clear_efer_svme.c
tools/testing/selftests/kvm/x86/svm_nested_shutdown_test.c
tools/testing/selftests/kvm/x86/svm_nested_soft_inject_test.c
tools/testing/selftests/kvm/x86/svm_nested_vmcb12_gpa.c
tools/testing/selftests/kvm/x86/svm_vmcall_test.c
tools/testing/selftests/kvm/x86/triple_fault_event_test.c
tools/testing/selftests/kvm/x86/vmx_apic_access_test.c
tools/testing/selftests/kvm/x86/vmx_apicv_updates_test.c
tools/testing/selftests/kvm/x86/vmx_invalid_nested_guest_state.c
tools/testing/selftests/kvm/x86/vmx_nested_la57_state_test.c
tools/testing/selftests/kvm/x86/vmx_preemption_timer_test.c
tools/testing/selftests/kvm/x86/xapic_ipi_test.c

index 2fb2c7939fe975ee42f0790ba55365f9290cf448..da87d049d246dfb6e3234bcbfaf572354d420113 100644 (file)
@@ -731,7 +731,7 @@ static void kvm_inject_get_call(struct kvm_vm *vm, struct ucall *uc,
                struct kvm_inject_args *args)
 {
        struct kvm_inject_args *kvm_args_hva;
-       vm_vaddr_t kvm_args_gva;
+       gva_t kvm_args_gva;
 
        kvm_args_gva = uc->args[1];
        kvm_args_hva = (struct kvm_inject_args *)addr_gva2hva(vm, kvm_args_gva);
@@ -752,7 +752,7 @@ static void test_vgic(uint32_t nr_irqs, bool level_sensitive, bool eoi_split)
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
        struct kvm_inject_args inject_args;
-       vm_vaddr_t args_gva;
+       gva_t args_gva;
 
        struct test_args args = {
                .nr_irqs = nr_irqs,
@@ -986,7 +986,7 @@ static void test_vgic_two_cpus(void *gcode)
        struct kvm_vcpu *vcpus[2];
        struct test_args args = {};
        struct kvm_vm *vm;
-       vm_vaddr_t args_gva;
+       gva_t args_gva;
        int gic_fd, ret;
 
        vm = vm_create_with_vcpus(2, gcode, vcpus);
index ac97a1c436fc490e36faba08215c7998811a1327..5b18ffe687899e37eea806e0c2e708fca4f5d237 100644 (file)
@@ -179,8 +179,8 @@ void vm_install_exception_handler(struct kvm_vm *vm,
 void vm_install_sync_handler(struct kvm_vm *vm,
                int vector, int ec, handler_fn handler);
 
-uint64_t *virt_get_pte_hva_at_level(struct kvm_vm *vm, vm_vaddr_t gva, int level);
-uint64_t *virt_get_pte_hva(struct kvm_vm *vm, vm_vaddr_t gva);
+uint64_t *virt_get_pte_hva_at_level(struct kvm_vm *vm, gva_t gva, int level);
+uint64_t *virt_get_pte_hva(struct kvm_vm *vm, gva_t gva);
 
 static inline void cpu_relax(void)
 {
index 4ec801f37f00e7a1fbd28818d9e72fc3fd0f4d9c..2210d3d94c40c4c5d9ea042b9b0afaa0901a357a 100644 (file)
@@ -10,9 +10,9 @@
  * ucall_exit_mmio_addr holds per-VM values (global data is duplicated by each
  * VM), it must not be accessed from host code.
  */
-extern vm_vaddr_t *ucall_exit_mmio_addr;
+extern gva_t *ucall_exit_mmio_addr;
 
-static inline void ucall_arch_do_ucall(vm_vaddr_t uc)
+static inline void ucall_arch_do_ucall(gva_t uc)
 {
        WRITE_ONCE(*ucall_exit_mmio_addr, uc);
 }
index f861242b4ae80627be7d78f6ec8fae2140c39f9c..2378dd42c9881b19c49592d751d12b5324ebf157 100644 (file)
@@ -112,7 +112,7 @@ struct kvm_vm {
        struct sparsebit *vpages_mapped;
        bool has_irqchip;
        vm_paddr_t ucall_mmio_addr;
-       vm_vaddr_t handlers;
+       gva_t handlers;
        uint32_t dirty_ring_size;
        uint64_t gpa_tag_mask;
 
@@ -716,22 +716,20 @@ void vm_mem_region_move(struct kvm_vm *vm, uint32_t slot, uint64_t new_gpa);
 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_vaddr_t __vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min,
+gva_t vm_vaddr_unused_gap(struct kvm_vm *vm, size_t sz, gva_t vaddr_min);
+gva_t vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, gva_t vaddr_min);
+gva_t __vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, gva_t vaddr_min,
+                      enum kvm_mem_region_type type);
+gva_t vm_vaddr_alloc_shared(struct kvm_vm *vm, size_t sz, gva_t vaddr_min,
                            enum kvm_mem_region_type type);
-vm_vaddr_t vm_vaddr_alloc_shared(struct kvm_vm *vm, size_t sz,
-                                vm_vaddr_t vaddr_min,
-                                enum kvm_mem_region_type type);
-vm_vaddr_t vm_vaddr_alloc_pages(struct kvm_vm *vm, int nr_pages);
-vm_vaddr_t __vm_vaddr_alloc_page(struct kvm_vm *vm,
-                                enum kvm_mem_region_type type);
-vm_vaddr_t vm_vaddr_alloc_page(struct kvm_vm *vm);
+gva_t vm_vaddr_alloc_pages(struct kvm_vm *vm, int nr_pages);
+gva_t __vm_vaddr_alloc_page(struct kvm_vm *vm, enum kvm_mem_region_type type);
+gva_t vm_vaddr_alloc_page(struct kvm_vm *vm);
 
 void virt_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr,
              unsigned int npages);
 void *addr_gpa2hva(struct kvm_vm *vm, vm_paddr_t gpa);
-void *addr_gva2hva(struct kvm_vm *vm, vm_vaddr_t gva);
+void *addr_gva2hva(struct kvm_vm *vm, gva_t gva);
 vm_paddr_t addr_hva2gpa(struct kvm_vm *vm, void *hva);
 void *addr_gpa2alias(struct kvm_vm *vm, vm_paddr_t gpa);
 
@@ -1131,12 +1129,12 @@ vm_adjust_num_guest_pages(enum vm_guest_mode mode, unsigned int num_guest_pages)
 }
 
 #define sync_global_to_guest(vm, g) ({                         \
-       typeof(g) *_p = addr_gva2hva(vm, (vm_vaddr_t)&(g));     \
+       typeof(g) *_p = addr_gva2hva(vm, (gva_t)&(g));          \
        memcpy(_p, &(g), sizeof(g));                            \
 })
 
 #define sync_global_from_guest(vm, g) ({                       \
-       typeof(g) *_p = addr_gva2hva(vm, (vm_vaddr_t)&(g));     \
+       typeof(g) *_p = addr_gva2hva(vm, (gva_t)&(g));          \
        memcpy(&(g), _p, sizeof(g));                            \
 })
 
@@ -1147,7 +1145,7 @@ vm_adjust_num_guest_pages(enum vm_guest_mode mode, unsigned int num_guest_pages)
  * undesirable to change the host's copy of the global.
  */
 #define write_guest_global(vm, g, val) ({                      \
-       typeof(g) *_p = addr_gva2hva(vm, (vm_vaddr_t)&(g));     \
+       typeof(g) *_p = addr_gva2hva(vm, (gva_t)&(g));          \
        typeof(g) _val = val;                                   \
                                                                \
        memcpy(_p, &(_val), sizeof(g));                         \
@@ -1242,9 +1240,9 @@ static inline void virt_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr
  * Returns the VM physical address of the translated VM virtual
  * address given by @gva.
  */
-vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva);
+vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, gva_t gva);
 
-static inline vm_paddr_t addr_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva)
+static inline vm_paddr_t addr_gva2gpa(struct kvm_vm *vm, gva_t gva)
 {
        return addr_arch_gva2gpa(vm, gva);
 }
index 0366e9bce7f93664b8709836b5d2055b8c07f7bb..f27bd035ea10f2350b89c148752fb771d81e9a51 100644 (file)
@@ -15,7 +15,7 @@
 #define kvm_static_assert(expr, ...) __kvm_static_assert(expr, ##__VA_ARGS__, #expr)
 
 typedef uint64_t vm_paddr_t; /* Virtual Machine (Guest) physical address */
-typedef uint64_t vm_vaddr_t; /* Virtual Machine (Guest) virtual address */
+typedef uint64_t gva_t; /* Virtual Machine (Guest) virtual address */
 
 #define INVALID_GPA (~(uint64_t)0)
 
index 4ec801f37f00e7a1fbd28818d9e72fc3fd0f4d9c..2210d3d94c40c4c5d9ea042b9b0afaa0901a357a 100644 (file)
@@ -10,9 +10,9 @@
  * ucall_exit_mmio_addr holds per-VM values (global data is duplicated by each
  * VM), it must not be accessed from host code.
  */
-extern vm_vaddr_t *ucall_exit_mmio_addr;
+extern gva_t *ucall_exit_mmio_addr;
 
-static inline void ucall_arch_do_ucall(vm_vaddr_t uc)
+static inline void ucall_arch_do_ucall(gva_t uc)
 {
        WRITE_ONCE(*ucall_exit_mmio_addr, uc);
 }
index a695ae36f3e0de40a32a17a3212d87a1841c4b22..41d56254968ea50d9e3247857b6449ffedc9e2d4 100644 (file)
@@ -11,7 +11,7 @@ static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
 {
 }
 
-static inline void ucall_arch_do_ucall(vm_vaddr_t uc)
+static inline void ucall_arch_do_ucall(gva_t uc)
 {
        sbi_ecall(KVM_RISCV_SELFTESTS_SBI_EXT,
                  KVM_RISCV_SELFTESTS_SBI_UCALL,
index 8035a872a351bb295e2b584669b0c08f755bfc65..befee84c460969441a24d28458005857b023b4bb 100644 (file)
@@ -10,7 +10,7 @@ static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
 {
 }
 
-static inline void ucall_arch_do_ucall(vm_vaddr_t uc)
+static inline void ucall_arch_do_ucall(gva_t uc)
 {
        /* Exit via DIAGNOSE 0x501 (normally used for breakpoints) */
        asm volatile ("diag 0,%0,0x501" : : "a"(uc) : "memory");
index d9d6581b8d4f221d1d84ac6a8c085043ae5f4d48..e5499f170834700ec6c341c2bdc6eba058fc105e 100644 (file)
@@ -30,7 +30,7 @@ struct ucall {
 };
 
 void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa);
-void ucall_arch_do_ucall(vm_vaddr_t uc);
+void ucall_arch_do_ucall(gva_t uc);
 void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu);
 
 void ucall(uint64_t cmd, int nargs, ...);
@@ -48,7 +48,7 @@ int ucall_nr_pages_required(uint64_t page_size);
  * the full ucall() are problematic and/or unwanted.  Note, this will come out
  * as UCALL_NONE on the backend.
  */
-#define GUEST_UCALL_NONE()     ucall_arch_do_ucall((vm_vaddr_t)NULL)
+#define GUEST_UCALL_NONE()     ucall_arch_do_ucall((gva_t)NULL)
 
 #define GUEST_SYNC_ARGS(stage, arg1, arg2, arg3, arg4) \
                                ucall(UCALL_SYNC, 6, "hello", stage, arg1, arg2, arg3, arg4)
index f13e532be2406e78e854ec6da4cefaa9166da142..eedfff3cf1028571d24f5caba9d562e70099c7cb 100644 (file)
  * Issue a Hyper-V hypercall. Returns exception vector raised or 0, 'hv_status'
  * is set to the hypercall status (if no exception occurred).
  */
-static inline uint8_t __hyperv_hypercall(u64 control, vm_vaddr_t input_address,
-                                        vm_vaddr_t output_address,
+static inline uint8_t __hyperv_hypercall(u64 control, gva_t input_address,
+                                        gva_t output_address,
                                         uint64_t *hv_status)
 {
        uint64_t error_code;
@@ -274,8 +274,8 @@ static inline uint8_t __hyperv_hypercall(u64 control, vm_vaddr_t input_address,
 }
 
 /* Issue a Hyper-V hypercall and assert that it succeeded. */
-static inline void hyperv_hypercall(u64 control, vm_vaddr_t input_address,
-                                   vm_vaddr_t output_address)
+static inline void hyperv_hypercall(u64 control, gva_t input_address,
+                                   gva_t output_address)
 {
        uint64_t hv_status;
        uint8_t vector;
@@ -347,7 +347,7 @@ struct hyperv_test_pages {
 };
 
 struct hyperv_test_pages *vcpu_alloc_hyperv_test_pages(struct kvm_vm *vm,
-                                                      vm_vaddr_t *p_hv_pages_gva);
+                                                      gva_t *p_hv_pages_gva);
 
 /* HV_X64_MSR_TSC_INVARIANT_CONTROL bits */
 #define HV_INVARIANT_TSC_EXPOSED               BIT_ULL(0)
index be35d26bb32005e21378edcc924aee6ed3fa464e..4c605f6249562a6466570a43c686b9796c53b9f7 100644 (file)
@@ -33,9 +33,9 @@ struct kvm_mmu_arch {
 struct kvm_mmu;
 
 struct kvm_vm_arch {
-       vm_vaddr_t gdt;
-       vm_vaddr_t tss;
-       vm_vaddr_t idt;
+       gva_t gdt;
+       gva_t tss;
+       gva_t idt;
 
        uint64_t c_bit;
        uint64_t s_bit;
index 5d7c42534bc45e65c4645b46443481772c8f0f58..a25b83e2c2335e1f2b66e54be1fa4e05e71b2a00 100644 (file)
@@ -56,7 +56,7 @@ static inline void vmmcall(void)
                "clgi\n"        \
                )
 
-struct svm_test_data *vcpu_alloc_svm(struct kvm_vm *vm, vm_vaddr_t *p_svm_gva);
+struct svm_test_data *vcpu_alloc_svm(struct kvm_vm *vm, gva_t *p_svm_gva);
 void generic_svm_setup(struct svm_test_data *svm, void *guest_rip, void *guest_rsp);
 void run_guest(struct vmcb *vmcb, uint64_t vmcb_gpa);
 
index 92b918700d249fc21d91a9ed72ea21a9b9a862c2..f194723da3d0f63f8fbafd632c9cb1620bee52d5 100644 (file)
@@ -550,7 +550,7 @@ union vmx_ctrl_msr {
        };
 };
 
-struct vmx_pages *vcpu_alloc_vmx(struct kvm_vm *vm, vm_vaddr_t *p_vmx_gva);
+struct vmx_pages *vcpu_alloc_vmx(struct kvm_vm *vm, gva_t *p_vmx_gva);
 bool prepare_for_vmx_operation(struct vmx_pages *vmx);
 void prepare_vmcs(struct vmx_pages *vmx, void *guest_rip, void *guest_rsp);
 bool load_vmcs(struct vmx_pages *vmx);
index c60a24a92829dbca1630a5dc70414d3c286d0246..61915fc89c17eb005c1c0e9076d32406b1464a43 100644 (file)
@@ -292,7 +292,7 @@ static struct kvm_vm *pre_init_before_test(enum vm_guest_mode mode, void *arg)
        ret = sem_init(&test_stage_completed, 0, 0);
        TEST_ASSERT(ret == 0, "Error in sem_init");
 
-       current_stage = addr_gva2hva(vm, (vm_vaddr_t)(&guest_test_stage));
+       current_stage = addr_gva2hva(vm, (gva_t)(&guest_test_stage));
        *current_stage = NUM_TEST_STAGES;
 
        pr_info("Testing guest mode: %s\n", vm_guest_mode_string(mode));
index 43ea40edc53304b85490d17bb70a6272a72818fc..3645acae09ce739e589d905cc27e24846a215aeb 100644 (file)
@@ -19,9 +19,9 @@
 
 #define DEFAULT_ARM64_GUEST_STACK_VADDR_MIN    0xac0000
 
-static vm_vaddr_t exception_handlers;
+static gva_t exception_handlers;
 
-static uint64_t pgd_index(struct kvm_vm *vm, vm_vaddr_t gva)
+static uint64_t pgd_index(struct kvm_vm *vm, gva_t gva)
 {
        unsigned int shift = (vm->mmu.pgtable_levels - 1) * (vm->page_shift - 3) + vm->page_shift;
        uint64_t mask = (1UL << (vm->va_bits - shift)) - 1;
@@ -29,7 +29,7 @@ static uint64_t pgd_index(struct kvm_vm *vm, vm_vaddr_t gva)
        return (gva >> shift) & mask;
 }
 
-static uint64_t pud_index(struct kvm_vm *vm, vm_vaddr_t gva)
+static uint64_t pud_index(struct kvm_vm *vm, gva_t gva)
 {
        unsigned int shift = 2 * (vm->page_shift - 3) + vm->page_shift;
        uint64_t mask = (1UL << (vm->page_shift - 3)) - 1;
@@ -40,7 +40,7 @@ static uint64_t pud_index(struct kvm_vm *vm, vm_vaddr_t gva)
        return (gva >> shift) & mask;
 }
 
-static uint64_t pmd_index(struct kvm_vm *vm, vm_vaddr_t gva)
+static uint64_t pmd_index(struct kvm_vm *vm, gva_t gva)
 {
        unsigned int shift = (vm->page_shift - 3) + vm->page_shift;
        uint64_t mask = (1UL << (vm->page_shift - 3)) - 1;
@@ -51,7 +51,7 @@ static uint64_t pmd_index(struct kvm_vm *vm, vm_vaddr_t gva)
        return (gva >> shift) & mask;
 }
 
-static uint64_t pte_index(struct kvm_vm *vm, vm_vaddr_t gva)
+static uint64_t pte_index(struct kvm_vm *vm, gva_t gva)
 {
        uint64_t mask = (1UL << (vm->page_shift - 3)) - 1;
        return (gva >> vm->page_shift) & mask;
@@ -181,7 +181,7 @@ void virt_arch_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr)
        _virt_pg_map(vm, vaddr, paddr, attr_idx);
 }
 
-uint64_t *virt_get_pte_hva_at_level(struct kvm_vm *vm, vm_vaddr_t gva, int level)
+uint64_t *virt_get_pte_hva_at_level(struct kvm_vm *vm, gva_t gva, int level)
 {
        uint64_t *ptep;
 
@@ -225,12 +225,12 @@ unmapped_gva:
        exit(EXIT_FAILURE);
 }
 
-uint64_t *virt_get_pte_hva(struct kvm_vm *vm, vm_vaddr_t gva)
+uint64_t *virt_get_pte_hva(struct kvm_vm *vm, gva_t gva)
 {
        return virt_get_pte_hva_at_level(vm, gva, 3);
 }
 
-vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva)
+vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, gva_t gva)
 {
        uint64_t *ptep = virt_get_pte_hva(vm, gva);
 
@@ -539,7 +539,7 @@ void vm_init_descriptor_tables(struct kvm_vm *vm)
        vm->handlers = __vm_vaddr_alloc(vm, sizeof(struct handlers),
                                        vm->page_size, MEM_REGION_DATA);
 
-       *(vm_vaddr_t *)addr_gva2hva(vm, (vm_vaddr_t)(&exception_handlers)) = vm->handlers;
+       *(gva_t *)addr_gva2hva(vm, (gva_t)(&exception_handlers)) = vm->handlers;
 }
 
 void vm_install_sync_handler(struct kvm_vm *vm, int vector, int ec,
index ddab0ce89d4dfe95e19aad91b5fb12c9668e14fc..9ea747982d0035f3c0f145ecee4678c7159e20a5 100644 (file)
@@ -6,17 +6,17 @@
  */
 #include "kvm_util.h"
 
-vm_vaddr_t *ucall_exit_mmio_addr;
+gva_t *ucall_exit_mmio_addr;
 
 void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
 {
-       vm_vaddr_t mmio_gva = vm_vaddr_unused_gap(vm, vm->page_size, KVM_UTIL_MIN_VADDR);
+       gva_t mmio_gva = vm_vaddr_unused_gap(vm, vm->page_size, KVM_UTIL_MIN_VADDR);
 
        virt_map(vm, mmio_gva, mmio_gpa, 1);
 
        vm->ucall_mmio_addr = mmio_gpa;
 
-       write_guest_global(vm, ucall_exit_mmio_addr, (vm_vaddr_t *)mmio_gva);
+       write_guest_global(vm, ucall_exit_mmio_addr, (gva_t *)mmio_gva);
 }
 
 void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu)
index f34d926d9735913f5ba826a8bee07aa0b8169d43..ff90fba3a5c66a2da8834cc1278341badcf3ef86 100644 (file)
@@ -157,12 +157,12 @@ void kvm_vm_elf_load(struct kvm_vm *vm, const char *filename)
                        "memsize of 0,\n"
                        "  phdr index: %u p_memsz: 0x%" PRIx64,
                        n1, (uint64_t) phdr.p_memsz);
-               vm_vaddr_t seg_vstart = align_down(phdr.p_vaddr, vm->page_size);
-               vm_vaddr_t seg_vend = phdr.p_vaddr + phdr.p_memsz - 1;
+               gva_t seg_vstart = align_down(phdr.p_vaddr, vm->page_size);
+               gva_t seg_vend = phdr.p_vaddr + phdr.p_memsz - 1;
                seg_vend |= vm->page_size - 1;
                size_t seg_size = seg_vend - seg_vstart + 1;
 
-               vm_vaddr_t vaddr = __vm_vaddr_alloc(vm, seg_size, seg_vstart,
+               gva_t vaddr = __vm_vaddr_alloc(vm, seg_size, seg_vstart,
                                                    MEM_REGION_CODE);
                TEST_ASSERT(vaddr == seg_vstart, "Unable to allocate "
                        "virtual memory for segment at requested min addr,\n"
index f5e076591c64bd69fae0e9f0ef94e2531c793ba3..04a59603e93efc424de2c506420ff625a2b01baf 100644 (file)
@@ -1386,8 +1386,7 @@ struct kvm_vcpu *__vm_vcpu_add(struct kvm_vm *vm, uint32_t vcpu_id)
  * TEST_ASSERT failure occurs for invalid input or no area of at least
  * sz unallocated bytes >= vaddr_min is available.
  */
-vm_vaddr_t vm_vaddr_unused_gap(struct kvm_vm *vm, size_t sz,
-                              vm_vaddr_t vaddr_min)
+gva_t vm_vaddr_unused_gap(struct kvm_vm *vm, size_t sz, gva_t vaddr_min)
 {
        uint64_t pages = (sz + vm->page_size - 1) >> vm->page_shift;
 
@@ -1452,10 +1451,8 @@ va_found:
        return pgidx_start * vm->page_size;
 }
 
-static vm_vaddr_t ____vm_vaddr_alloc(struct kvm_vm *vm, size_t sz,
-                                    vm_vaddr_t vaddr_min,
-                                    enum kvm_mem_region_type type,
-                                    bool protected)
+static gva_t ____vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, gva_t vaddr_min,
+                               enum kvm_mem_region_type type, bool protected)
 {
        uint64_t pages = (sz >> vm->page_shift) + ((sz % vm->page_size) != 0);
 
@@ -1468,10 +1465,10 @@ static vm_vaddr_t ____vm_vaddr_alloc(struct kvm_vm *vm, size_t sz,
         * Find an unused range of virtual page addresses of at least
         * pages in length.
         */
-       vm_vaddr_t vaddr_start = vm_vaddr_unused_gap(vm, sz, vaddr_min);
+       gva_t vaddr_start = vm_vaddr_unused_gap(vm, sz, vaddr_min);
 
        /* Map the virtual pages. */
-       for (vm_vaddr_t vaddr = vaddr_start; pages > 0;
+       for (gva_t vaddr = vaddr_start; pages > 0;
                pages--, vaddr += vm->page_size, paddr += vm->page_size) {
 
                virt_pg_map(vm, vaddr, paddr);
@@ -1480,16 +1477,15 @@ static vm_vaddr_t ____vm_vaddr_alloc(struct kvm_vm *vm, size_t sz,
        return vaddr_start;
 }
 
-vm_vaddr_t __vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min,
-                           enum kvm_mem_region_type type)
+gva_t __vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, gva_t vaddr_min,
+                      enum kvm_mem_region_type type)
 {
        return ____vm_vaddr_alloc(vm, sz, vaddr_min, type,
                                  vm_arch_has_protected_memory(vm));
 }
 
-vm_vaddr_t vm_vaddr_alloc_shared(struct kvm_vm *vm, size_t sz,
-                                vm_vaddr_t vaddr_min,
-                                enum kvm_mem_region_type type)
+gva_t vm_vaddr_alloc_shared(struct kvm_vm *vm, size_t sz, gva_t vaddr_min,
+                           enum kvm_mem_region_type type)
 {
        return ____vm_vaddr_alloc(vm, sz, vaddr_min, type, false);
 }
@@ -1513,7 +1509,7 @@ vm_vaddr_t vm_vaddr_alloc_shared(struct kvm_vm *vm, size_t sz,
  * a unique set of pages, with the minimum real allocation being at least
  * a page. The allocated physical space comes from the TEST_DATA memory region.
  */
-vm_vaddr_t vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min)
+gva_t vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, gva_t vaddr_min)
 {
        return __vm_vaddr_alloc(vm, sz, vaddr_min, MEM_REGION_TEST_DATA);
 }
@@ -1532,12 +1528,12 @@ vm_vaddr_t vm_vaddr_alloc(struct kvm_vm *vm, size_t sz, vm_vaddr_t vaddr_min)
  * Allocates at least N system pages worth of bytes within the virtual address
  * space of the vm.
  */
-vm_vaddr_t vm_vaddr_alloc_pages(struct kvm_vm *vm, int nr_pages)
+gva_t vm_vaddr_alloc_pages(struct kvm_vm *vm, int nr_pages)
 {
        return vm_vaddr_alloc(vm, nr_pages * getpagesize(), KVM_UTIL_MIN_VADDR);
 }
 
-vm_vaddr_t __vm_vaddr_alloc_page(struct kvm_vm *vm, enum kvm_mem_region_type type)
+gva_t __vm_vaddr_alloc_page(struct kvm_vm *vm, enum kvm_mem_region_type type)
 {
        return __vm_vaddr_alloc(vm, getpagesize(), KVM_UTIL_MIN_VADDR, type);
 }
@@ -1556,7 +1552,7 @@ vm_vaddr_t __vm_vaddr_alloc_page(struct kvm_vm *vm, enum kvm_mem_region_type typ
  * Allocates at least one system page worth of bytes within the virtual address
  * space of the vm.
  */
-vm_vaddr_t vm_vaddr_alloc_page(struct kvm_vm *vm)
+gva_t vm_vaddr_alloc_page(struct kvm_vm *vm)
 {
        return vm_vaddr_alloc_pages(vm, 1);
 }
@@ -2161,7 +2157,7 @@ vm_paddr_t vm_alloc_page_table(struct kvm_vm *vm)
  * Return:
  *   Equivalent host virtual address
  */
-void *addr_gva2hva(struct kvm_vm *vm, vm_vaddr_t gva)
+void *addr_gva2hva(struct kvm_vm *vm, gva_t gva)
 {
        return addr_gpa2hva(vm, addr_gva2gpa(vm, gva));
 }
index ee4ad3b1d2a4fb8c2404a97f44883a71b1cf9820..3b67720fbbe193c81b3e59cd4edc074d29690999 100644 (file)
@@ -13,9 +13,9 @@
 #define LOONGARCH_GUEST_STACK_VADDR_MIN                0x200000
 
 static vm_paddr_t invalid_pgtable[4];
-static vm_vaddr_t exception_handlers;
+static gva_t exception_handlers;
 
-static uint64_t virt_pte_index(struct kvm_vm *vm, vm_vaddr_t gva, int level)
+static uint64_t virt_pte_index(struct kvm_vm *vm, gva_t gva, int level)
 {
        unsigned int shift;
        uint64_t mask;
@@ -72,7 +72,7 @@ static int virt_pte_none(uint64_t *ptep, int level)
        return *ptep == invalid_pgtable[level];
 }
 
-static uint64_t *virt_populate_pte(struct kvm_vm *vm, vm_vaddr_t gva, int alloc)
+static uint64_t *virt_populate_pte(struct kvm_vm *vm, gva_t gva, int alloc)
 {
        int level;
        uint64_t *ptep;
@@ -106,7 +106,7 @@ unmapped_gva:
        exit(EXIT_FAILURE);
 }
 
-vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva)
+vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, gva_t gva)
 {
        uint64_t *ptep;
 
index fc6cbb50573fe434e348607154191b3dcc29c04c..a5aa568f437b771182b039aadeade62335e854ba 100644 (file)
@@ -9,17 +9,17 @@
  * ucall_exit_mmio_addr holds per-VM values (global data is duplicated by each
  * VM), it must not be accessed from host code.
  */
-vm_vaddr_t *ucall_exit_mmio_addr;
+gva_t *ucall_exit_mmio_addr;
 
 void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
 {
-       vm_vaddr_t mmio_gva = vm_vaddr_unused_gap(vm, vm->page_size, KVM_UTIL_MIN_VADDR);
+       gva_t mmio_gva = vm_vaddr_unused_gap(vm, vm->page_size, KVM_UTIL_MIN_VADDR);
 
        virt_map(vm, mmio_gva, mmio_gpa, 1);
 
        vm->ucall_mmio_addr = mmio_gpa;
 
-       write_guest_global(vm, ucall_exit_mmio_addr, (vm_vaddr_t *)mmio_gva);
+       write_guest_global(vm, ucall_exit_mmio_addr, (gva_t *)mmio_gva);
 }
 
 void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu)
index 067c6b2c15b05ddb88c85fa3d187d3fc72b6bf29..552628dda4a09bb395c07090f395a0809b03524e 100644 (file)
@@ -15,7 +15,7 @@
 
 #define DEFAULT_RISCV_GUEST_STACK_VADDR_MIN    0xac0000
 
-static vm_vaddr_t exception_handlers;
+static gva_t exception_handlers;
 
 bool __vcpu_has_ext(struct kvm_vcpu *vcpu, uint64_t ext)
 {
@@ -52,7 +52,7 @@ static uint32_t pte_index_shift[] = {
        PGTBL_L3_INDEX_SHIFT,
 };
 
-static uint64_t pte_index(struct kvm_vm *vm, vm_vaddr_t gva, int level)
+static uint64_t pte_index(struct kvm_vm *vm, gva_t gva, int level)
 {
        TEST_ASSERT(level > -1,
                "Negative page table level (%d) not possible", level);
@@ -119,7 +119,7 @@ void virt_arch_pg_map(struct kvm_vm *vm, uint64_t vaddr, uint64_t paddr)
                PGTBL_PTE_PERM_MASK | PGTBL_PTE_VALID_MASK;
 }
 
-vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva)
+vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, gva_t gva)
 {
        uint64_t *ptep;
        int level = vm->mmu.pgtable_levels - 1;
@@ -452,7 +452,7 @@ void vm_init_vector_tables(struct kvm_vm *vm)
        vm->handlers = __vm_vaddr_alloc(vm, sizeof(struct handlers),
                                   vm->page_size, MEM_REGION_DATA);
 
-       *(vm_vaddr_t *)addr_gva2hva(vm, (vm_vaddr_t)(&exception_handlers)) = vm->handlers;
+       *(gva_t *)addr_gva2hva(vm, (gva_t)(&exception_handlers)) = vm->handlers;
 }
 
 void vm_install_exception_handler(struct kvm_vm *vm, int vector, exception_handler_fn handler)
index 6a9a660413a7473fbc712a58170ac58e0ff315b2..e8d3c1d333d5bee6991072071929bb032646ac82 100644 (file)
@@ -86,7 +86,7 @@ void virt_arch_pg_map(struct kvm_vm *vm, uint64_t gva, uint64_t gpa)
        entry[idx] = gpa;
 }
 
-vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva)
+vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, gva_t gva)
 {
        int ri, idx;
        uint64_t *entry;
index 42151e5719536078e45083b27c7397ac1a66f308..997444178c78ac19f125610509deb0185a643525 100644 (file)
@@ -29,7 +29,7 @@ void ucall_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
 {
        struct ucall_header *hdr;
        struct ucall *uc;
-       vm_vaddr_t vaddr;
+       gva_t vaddr;
        int i;
 
        vaddr = vm_vaddr_alloc_shared(vm, sizeof(*hdr), KVM_UTIL_MIN_VADDR,
@@ -96,7 +96,7 @@ void ucall_assert(uint64_t cmd, const char *exp, const char *file,
        guest_vsnprintf(uc->buffer, UCALL_BUFFER_LEN, fmt, va);
        va_end(va);
 
-       ucall_arch_do_ucall((vm_vaddr_t)uc->hva);
+       ucall_arch_do_ucall((gva_t)uc->hva);
 
        ucall_free(uc);
 }
@@ -113,7 +113,7 @@ void ucall_fmt(uint64_t cmd, const char *fmt, ...)
        guest_vsnprintf(uc->buffer, UCALL_BUFFER_LEN, fmt, va);
        va_end(va);
 
-       ucall_arch_do_ucall((vm_vaddr_t)uc->hva);
+       ucall_arch_do_ucall((gva_t)uc->hva);
 
        ucall_free(uc);
 }
@@ -135,7 +135,7 @@ void ucall(uint64_t cmd, int nargs, ...)
                WRITE_ONCE(uc->args[i], va_arg(va, uint64_t));
        va_end(va);
 
-       ucall_arch_do_ucall((vm_vaddr_t)uc->hva);
+       ucall_arch_do_ucall((gva_t)uc->hva);
 
        ucall_free(uc);
 }
index 15bc8cd583aa42dac136006f2914ad2cc3587428..be8b31572588af5580641af0e2cf62692436e825 100644 (file)
@@ -76,9 +76,9 @@ bool kvm_hv_cpu_has(struct kvm_x86_cpu_feature feature)
 }
 
 struct hyperv_test_pages *vcpu_alloc_hyperv_test_pages(struct kvm_vm *vm,
-                                                      vm_vaddr_t *p_hv_pages_gva)
+                                                      gva_t *p_hv_pages_gva)
 {
-       vm_vaddr_t hv_pages_gva = vm_vaddr_alloc_page(vm);
+       gva_t hv_pages_gva = vm_vaddr_alloc_page(vm);
        struct hyperv_test_pages *hv = addr_gva2hva(vm, hv_pages_gva);
 
        /* Setup of a region of guest memory for the VP Assist page. */
index f53414ba7103418336eaeb02e4d60053d6d33fd7..73a82730927dec1d33b04f27ea9775585dddb658 100644 (file)
@@ -104,7 +104,7 @@ static void memstress_setup_ept_mappings(struct kvm_vm *vm)
 void memstress_setup_nested(struct kvm_vm *vm, int nr_vcpus, struct kvm_vcpu *vcpus[])
 {
        struct kvm_regs regs;
-       vm_vaddr_t nested_gva;
+       gva_t nested_gva;
        int vcpu_id;
 
        TEST_REQUIRE(kvm_cpu_has_tdp());
index 01f0f97d44304384e87d74f7a51a53eec48a970e..7a01f83cab0b4338757c72916f48026b4a49c0be 100644 (file)
@@ -21,7 +21,7 @@
 #define KERNEL_DS      0x10
 #define KERNEL_TSS     0x18
 
-vm_vaddr_t exception_handlers;
+gva_t exception_handlers;
 bool host_cpu_is_amd;
 bool host_cpu_is_intel;
 bool host_cpu_is_hygon;
@@ -618,7 +618,7 @@ static void kvm_seg_set_kernel_data_64bit(struct kvm_segment *segp)
        segp->present = true;
 }
 
-vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva)
+vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, gva_t gva)
 {
        int level = PG_LEVEL_NONE;
        uint64_t *pte = __vm_get_page_table_entry(vm, &vm->mmu, gva, &level);
@@ -633,7 +633,7 @@ vm_paddr_t addr_arch_gva2gpa(struct kvm_vm *vm, vm_vaddr_t gva)
        return vm_untag_gpa(vm, PTE_GET_PA(*pte)) | (gva & ~HUGEPAGE_MASK(level));
 }
 
-static void kvm_seg_set_tss_64bit(vm_vaddr_t base, struct kvm_segment *segp)
+static void kvm_seg_set_tss_64bit(gva_t base, struct kvm_segment *segp)
 {
        memset(segp, 0, sizeof(*segp));
        segp->base = base;
@@ -755,7 +755,7 @@ static void vm_init_descriptor_tables(struct kvm_vm *vm)
        for (i = 0; i < NUM_INTERRUPTS; i++)
                set_idt_entry(vm, i, (unsigned long)(&idt_handlers)[i], 0, KERNEL_CS);
 
-       *(vm_vaddr_t *)addr_gva2hva(vm, (vm_vaddr_t)(&exception_handlers)) = vm->handlers;
+       *(gva_t *)addr_gva2hva(vm, (gva_t)(&exception_handlers)) = vm->handlers;
 
        kvm_seg_set_kernel_code_64bit(&seg);
        kvm_seg_fill_gdt_64bit(vm, &seg);
@@ -770,9 +770,9 @@ static void vm_init_descriptor_tables(struct kvm_vm *vm)
 void vm_install_exception_handler(struct kvm_vm *vm, int vector,
                               void (*handler)(struct ex_regs *))
 {
-       vm_vaddr_t *handlers = (vm_vaddr_t *)addr_gva2hva(vm, vm->handlers);
+       gva_t *handlers = (gva_t *)addr_gva2hva(vm, vm->handlers);
 
-       handlers[vector] = (vm_vaddr_t)handler;
+       handlers[vector] = (gva_t)handler;
 }
 
 void assert_on_unhandled_exception(struct kvm_vcpu *vcpu)
@@ -825,7 +825,7 @@ struct kvm_vcpu *vm_arch_vcpu_add(struct kvm_vm *vm, uint32_t vcpu_id)
 {
        struct kvm_mp_state mp_state;
        struct kvm_regs regs;
-       vm_vaddr_t stack_vaddr;
+       gva_t stack_vaddr;
        struct kvm_vcpu *vcpu;
 
        stack_vaddr = __vm_vaddr_alloc(vm, DEFAULT_STACK_PGS * getpagesize(),
index eb20b00112c76909098136462f4ea624b3d81bcb..4a3b1a2738a27c266989fae05a83e93107fd8c25 100644 (file)
@@ -28,9 +28,9 @@ u64 rflags;
  *   Pointer to structure with the addresses of the SVM areas.
  */
 struct svm_test_data *
-vcpu_alloc_svm(struct kvm_vm *vm, vm_vaddr_t *p_svm_gva)
+vcpu_alloc_svm(struct kvm_vm *vm, gva_t *p_svm_gva)
 {
-       vm_vaddr_t svm_gva = vm_vaddr_alloc_page(vm);
+       gva_t svm_gva = vm_vaddr_alloc_page(vm);
        struct svm_test_data *svm = addr_gva2hva(vm, svm_gva);
 
        svm->vmcb = (void *)vm_vaddr_alloc_page(vm);
index 1265cecc7dd1040ed260b7746547ea915e930cb6..1af2a6880cdfaeaea18e94752593991cc2730e6b 100644 (file)
@@ -8,7 +8,7 @@
 
 #define UCALL_PIO_PORT ((uint16_t)0x1000)
 
-void ucall_arch_do_ucall(vm_vaddr_t uc)
+void ucall_arch_do_ucall(gva_t uc)
 {
        /*
         * FIXME: Revert this hack (the entire commit that added it) once nVMX
index c87b340362a900da8bc427f4d1d4780501443f2d..a6bb649e62c3c50a56c9639ecf486e58fb336e4e 100644 (file)
@@ -79,9 +79,9 @@ void vm_enable_ept(struct kvm_vm *vm)
  *   Pointer to structure with the addresses of the VMX areas.
  */
 struct vmx_pages *
-vcpu_alloc_vmx(struct kvm_vm *vm, vm_vaddr_t *p_vmx_gva)
+vcpu_alloc_vmx(struct kvm_vm *vm, gva_t *p_vmx_gva)
 {
-       vm_vaddr_t vmx_gva = vm_vaddr_alloc_page(vm);
+       gva_t vmx_gva = vm_vaddr_alloc_page(vm);
        struct vmx_pages *vmx = addr_gva2hva(vm, vmx_gva);
 
        /* Setup of a region of guest memory for the vmxon region. */
index cec1621ace232c778d639317dc34b7c6013b8dfb..8366c11131ff0936afa0496d638a9d29c286703a 100644 (file)
@@ -610,7 +610,7 @@ static void test_vm_setup_snapshot_mem(struct kvm_vm *vm, struct kvm_vcpu *vcpu)
        virt_map(vm, PMU_SNAPSHOT_GPA_BASE, PMU_SNAPSHOT_GPA_BASE, 1);
 
        snapshot_gva = (void *)(PMU_SNAPSHOT_GPA_BASE);
-       snapshot_gpa = addr_gva2gpa(vcpu->vm, (vm_vaddr_t)snapshot_gva);
+       snapshot_gpa = addr_gva2gpa(vcpu->vm, (gva_t)snapshot_gva);
        sync_global_to_guest(vcpu->vm, snapshot_gva);
        sync_global_to_guest(vcpu->vm, snapshot_gpa);
 }
index 4374b4cd2a8071485ea1757149914085c39be757..0e8dc8e5d8bd6329d7ab04973d98e9d60657d40a 100644 (file)
@@ -878,7 +878,7 @@ static void guest_copy_key_fetch_prot_override(void)
 static void test_copy_key_fetch_prot_override(void)
 {
        struct test_default t = test_default_init(guest_copy_key_fetch_prot_override);
-       vm_vaddr_t guest_0_page, guest_last_page;
+       gva_t guest_0_page, guest_last_page;
 
        guest_0_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, 0);
        guest_last_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, last_page_addr);
@@ -917,7 +917,7 @@ out:
 static void test_errors_key_fetch_prot_override_not_enabled(void)
 {
        struct test_default t = test_default_init(guest_copy_key_fetch_prot_override);
-       vm_vaddr_t guest_0_page, guest_last_page;
+       gva_t guest_0_page, guest_last_page;
 
        guest_0_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, 0);
        guest_last_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, last_page_addr);
@@ -938,7 +938,7 @@ out:
 static void test_errors_key_fetch_prot_override_enabled(void)
 {
        struct test_default t = test_default_init(guest_copy_key_fetch_prot_override);
-       vm_vaddr_t guest_0_page, guest_last_page;
+       gva_t guest_0_page, guest_last_page;
 
        guest_0_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, 0);
        guest_last_page = vm_vaddr_alloc(t.kvm_vm, PAGE_SIZE, last_page_addr);
index 12d5e1cb62e349be947e743bac89e8a586e5cca4..fd8e997de6931265d744ae81e5df4ad28440c7ba 100644 (file)
@@ -207,7 +207,7 @@ int main(int argc, char *argv[])
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
        struct kvm_run *run;
-       vm_vaddr_t guest_0_page;
+       gva_t guest_0_page;
 
        ksft_print_header();
        ksft_set_plan(STAGE_END);
@@ -216,7 +216,7 @@ int main(int argc, char *argv[])
        run = vcpu->run;
 
        HOST_SYNC(vcpu, STAGE_INIT_SIMPLE);
-       mprotect(addr_gva2hva(vm, (vm_vaddr_t)pages), PAGE_SIZE * 2, PROT_READ);
+       mprotect(addr_gva2hva(vm, (gva_t)pages), PAGE_SIZE * 2, PROT_READ);
        HOST_SYNC(vcpu, TEST_SIMPLE);
 
        guest_0_page = vm_vaddr_alloc(vm, PAGE_SIZE, 0);
@@ -229,7 +229,7 @@ int main(int argc, char *argv[])
                HOST_SYNC(vcpu, STAGE_INIT_FETCH_PROT_OVERRIDE);
        }
        if (guest_0_page == 0)
-               mprotect(addr_gva2hva(vm, (vm_vaddr_t)0), PAGE_SIZE, PROT_READ);
+               mprotect(addr_gva2hva(vm, (gva_t)0), PAGE_SIZE, PROT_READ);
        run->s.regs.crs[0] |= CR0_FETCH_PROTECTION_OVERRIDE;
        run->kvm_dirty_regs = KVM_SYNC_CRS;
        HOST_SYNC(vcpu, TEST_FETCH_PROT_OVERRIDE);
index efe56a10d13e83e74118cca2558dc33556653161..d2a513ec7dd5d7e208e566bab1dfd6a064baf4e5 100644 (file)
@@ -309,7 +309,7 @@ static void steal_time_init(struct kvm_vcpu *vcpu, uint32_t i)
 {
        /* ST_GPA_BASE is identity mapped */
        st_gva[i] = (void *)(ST_GPA_BASE + i * STEAL_TIME_SIZE);
-       st_gpa[i] = addr_gva2gpa(vcpu->vm, (vm_vaddr_t)st_gva[i]);
+       st_gpa[i] = addr_gva2gpa(vcpu->vm, (gva_t)st_gva[i]);
        sync_global_to_guest(vcpu->vm, st_gva[i]);
        sync_global_to_guest(vcpu->vm, st_gpa[i]);
 }
index 37b166260ee3f1807a6254ea00e1bee601dbbaa2..6f934732c0143860d3882390ff0dadc862973831 100644 (file)
@@ -236,7 +236,7 @@ int main(int argc, char *argv[])
        struct kvm_x86_state *state;
        struct kvm_x86_state *tile_state = NULL;
        int xsave_restore_size;
-       vm_vaddr_t amx_cfg, tiledata, xstate;
+       gva_t amx_cfg, tiledata, xstate;
        struct ucall uc;
        int ret;
 
index 8b15a13df9394972ac9811566bc3427bcf1f98cc..2b547fc93ba841c2e78c68204d79f40564618673 100644 (file)
@@ -123,7 +123,7 @@ int main(int argc, char *argv[])
 {
        const bool has_nested = kvm_cpu_has(X86_FEATURE_SVM) || kvm_cpu_has(X86_FEATURE_VMX);
        uint64_t host_aperf_before, host_mperf_before;
-       vm_vaddr_t nested_test_data_gva;
+       gva_t nested_test_data_gva;
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
        int msr_fd, cpu, i;
index f9ed14996977abcc1caab02e2dce9af17196721d..3c45249a42c4c418869141d627e1b34c074ddfe6 100644 (file)
@@ -140,10 +140,10 @@ static void run_vcpu(struct kvm_vcpu *vcpu, int stage)
        }
 }
 
-struct kvm_cpuid2 *vcpu_alloc_cpuid(struct kvm_vm *vm, vm_vaddr_t *p_gva, struct kvm_cpuid2 *cpuid)
+struct kvm_cpuid2 *vcpu_alloc_cpuid(struct kvm_vm *vm, gva_t *p_gva, struct kvm_cpuid2 *cpuid)
 {
        int size = sizeof(*cpuid) + cpuid->nent * sizeof(cpuid->entries[0]);
-       vm_vaddr_t gva = vm_vaddr_alloc(vm, size, KVM_UTIL_MIN_VADDR);
+       gva_t gva = vm_vaddr_alloc(vm, size, KVM_UTIL_MIN_VADDR);
        struct kvm_cpuid2 *guest_cpuids = addr_gva2hva(vm, gva);
 
        memcpy(guest_cpuids, cpuid, size);
@@ -217,7 +217,7 @@ static void test_get_cpuid2(struct kvm_vcpu *vcpu)
 int main(void)
 {
        struct kvm_vcpu *vcpu;
-       vm_vaddr_t cpuid_gva;
+       gva_t cpuid_gva;
        struct kvm_vm *vm;
        int stage;
 
index af7c901033966a631ad96162c35ce1199e9910c5..62cfde273f71947351508ff706fb2555c9a0f76e 100644 (file)
@@ -73,7 +73,7 @@ static void guest_code(struct vmx_pages *vmx_pages,
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t vmx_pages_gva = 0, hv_pages_gva = 0;
+       gva_t vmx_pages_gva = 0, hv_pages_gva = 0;
        struct hyperv_test_pages *hv;
        struct hv_enlightened_vmcs *evmcs;
        struct kvm_vcpu *vcpu;
index e058bc676cd6930d54593093579fff15e1930d91..b68844924dc5de3f7b5219e2851042ecb0296ce4 100644 (file)
@@ -208,7 +208,7 @@ int main(void)
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
        struct ucall uc;
-       vm_vaddr_t tsc_page_gva;
+       gva_t tsc_page_gva;
        int stage;
 
        TEST_REQUIRE(kvm_has_cap(KVM_CAP_HYPERV_TIME));
index 74cf196613090819fda37704c704bc28ed9e665b..c2de5ac799ee6de3a40a985c10104de56573442a 100644 (file)
@@ -76,7 +76,7 @@ void l2_guest_code(void)
 }
 
 void guest_code(struct vmx_pages *vmx_pages, struct hyperv_test_pages *hv_pages,
-               vm_vaddr_t hv_hcall_page_gpa)
+               gva_t hv_hcall_page_gpa)
 {
 #define L2_GUEST_STACK_SIZE 64
        unsigned long l2_guest_stack[L2_GUEST_STACK_SIZE];
@@ -231,8 +231,8 @@ static struct kvm_vcpu *save_restore_vm(struct kvm_vm *vm,
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t vmx_pages_gva = 0, hv_pages_gva = 0;
-       vm_vaddr_t hcall_page;
+       gva_t vmx_pages_gva = 0, hv_pages_gva = 0;
+       gva_t hcall_page;
 
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
index 949e08e98f31585a41f5d5ccd5bfb0bab3de0de9..7762c168bbf3981df60c9620dc6676c0458ae630 100644 (file)
@@ -16,7 +16,7 @@
 #define EXT_CAPABILITIES 0xbull
 
 static void guest_code(vm_paddr_t in_pg_gpa, vm_paddr_t out_pg_gpa,
-                      vm_vaddr_t out_pg_gva)
+                      gva_t out_pg_gva)
 {
        uint64_t *output_gva;
 
@@ -35,8 +35,8 @@ static void guest_code(vm_paddr_t in_pg_gpa, vm_paddr_t out_pg_gpa,
 
 int main(void)
 {
-       vm_vaddr_t hcall_out_page;
-       vm_vaddr_t hcall_in_page;
+       gva_t hcall_out_page;
+       gva_t hcall_in_page;
        struct kvm_vcpu *vcpu;
        struct kvm_run *run;
        struct kvm_vm *vm;
index 130b9ce7e5ddd4f34bf83e94b33c209dfec45876..1059fcc460e3a7ba6b3ffe1a2ca92c40b0e57d97 100644 (file)
@@ -82,7 +82,7 @@ done:
        GUEST_DONE();
 }
 
-static void guest_hcall(vm_vaddr_t pgs_gpa, struct hcall_data *hcall)
+static void guest_hcall(gva_t pgs_gpa, struct hcall_data *hcall)
 {
        u64 res, input, output;
        uint8_t vector;
@@ -134,7 +134,7 @@ static void guest_test_msrs_access(void)
        struct kvm_vm *vm;
        struct ucall uc;
        int stage = 0;
-       vm_vaddr_t msr_gva;
+       gva_t msr_gva;
        struct msr_data *msr;
        bool has_invtsc = kvm_cpu_has(X86_FEATURE_INVTSC);
 
@@ -523,7 +523,7 @@ static void guest_test_hcalls_access(void)
        struct kvm_vm *vm;
        struct ucall uc;
        int stage = 0;
-       vm_vaddr_t hcall_page, hcall_params;
+       gva_t hcall_page, hcall_params;
        struct hcall_data *hcall;
 
        while (true) {
index ca61836c4e325a4c913749ca1dac565ad2fa80fe..7d648219833cb861dc5c25d2b44ae27c4bcc5e13 100644 (file)
@@ -45,13 +45,13 @@ struct hv_send_ipi_ex {
        struct hv_vpset vp_set;
 };
 
-static inline void hv_init(vm_vaddr_t pgs_gpa)
+static inline void hv_init(gva_t pgs_gpa)
 {
        wrmsr(HV_X64_MSR_GUEST_OS_ID, HYPERV_LINUX_OS_ID);
        wrmsr(HV_X64_MSR_HYPERCALL, pgs_gpa);
 }
 
-static void receiver_code(void *hcall_page, vm_vaddr_t pgs_gpa)
+static void receiver_code(void *hcall_page, gva_t pgs_gpa)
 {
        u32 vcpu_id;
 
@@ -85,7 +85,7 @@ static inline void nop_loop(void)
                asm volatile("nop");
 }
 
-static void sender_guest_code(void *hcall_page, vm_vaddr_t pgs_gpa)
+static void sender_guest_code(void *hcall_page, gva_t pgs_gpa)
 {
        struct hv_send_ipi *ipi = (struct hv_send_ipi *)hcall_page;
        struct hv_send_ipi_ex *ipi_ex = (struct hv_send_ipi_ex *)hcall_page;
@@ -243,7 +243,7 @@ int main(int argc, char *argv[])
 {
        struct kvm_vm *vm;
        struct kvm_vcpu *vcpu[3];
-       vm_vaddr_t hcall_page;
+       gva_t hcall_page;
        pthread_t threads[2];
        int stage = 1, r;
        struct ucall uc;
index 0ddb63229bcbb8b57170c6c7b638f69829a1a79f..e0caf5ea14bda05c8f5872e10d4a59e5b56a8e04 100644 (file)
@@ -67,7 +67,7 @@ void l2_guest_code(void)
 
 static void __attribute__((__flatten__)) guest_code(struct svm_test_data *svm,
                                                    struct hyperv_test_pages *hv_pages,
-                                                   vm_vaddr_t pgs_gpa)
+                                                   gva_t pgs_gpa)
 {
        unsigned long l2_guest_stack[L2_GUEST_STACK_SIZE];
        struct vmcb *vmcb = svm->vmcb;
@@ -149,8 +149,8 @@ static void __attribute__((__flatten__)) guest_code(struct svm_test_data *svm,
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t nested_gva = 0, hv_pages_gva = 0;
-       vm_vaddr_t hcall_page;
+       gva_t nested_gva = 0, hv_pages_gva = 0;
+       gva_t hcall_page;
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
        struct ucall uc;
index c542cc4762b154875e8cf66497cbbe5c8fb20716..7f58a5efe6d58ca536817df3a356f53529cd78c7 100644 (file)
@@ -61,14 +61,14 @@ struct hv_tlb_flush_ex {
  * - GVAs of the test pages' PTEs
  */
 struct test_data {
-       vm_vaddr_t hcall_gva;
+       gva_t hcall_gva;
        vm_paddr_t hcall_gpa;
-       vm_vaddr_t test_pages;
-       vm_vaddr_t test_pages_pte[NTEST_PAGES];
+       gva_t test_pages;
+       gva_t test_pages_pte[NTEST_PAGES];
 };
 
 /* 'Worker' vCPU code checking the contents of the test page */
-static void worker_guest_code(vm_vaddr_t test_data)
+static void worker_guest_code(gva_t test_data)
 {
        struct test_data *data = (struct test_data *)test_data;
        u32 vcpu_id = rdmsr(HV_X64_MSR_VP_INDEX);
@@ -196,7 +196,7 @@ static inline void post_test(struct test_data *data, u64 exp1, u64 exp2)
 #define TESTVAL2 0x0202020202020202
 
 /* Main vCPU doing the test */
-static void sender_guest_code(vm_vaddr_t test_data)
+static void sender_guest_code(gva_t test_data)
 {
        struct test_data *data = (struct test_data *)test_data;
        struct hv_tlb_flush *flush = (struct hv_tlb_flush *)data->hcall_gva;
@@ -581,7 +581,7 @@ int main(int argc, char *argv[])
        struct kvm_vm *vm;
        struct kvm_vcpu *vcpu[3];
        pthread_t threads[2];
-       vm_vaddr_t test_data_page, gva;
+       gva_t test_data_page, gva;
        vm_paddr_t gpa;
        uint64_t *pte;
        struct test_data *data;
index d88500c118eb0c8354dbdefd27c1f661e977459e..52014a3210c886dcff344cb6cc2839140084c54e 100644 (file)
@@ -73,7 +73,7 @@ static void guest_code(void *test_data)
 int main(int argc, char *argv[])
 {
        const bool has_nested = kvm_cpu_has(X86_FEATURE_SVM) || kvm_cpu_has(X86_FEATURE_VMX);
-       vm_vaddr_t nested_test_data_gva;
+       gva_t nested_test_data_gva;
        struct kvm_vcpu *vcpu;
        struct kvm_run *run;
        struct kvm_vm *vm;
index 5bc12222d87af696dc2f35e8874c4eb3f58a4f7e..e14f7330302e60fcbd69d05fe9d38c5448c8ead7 100644 (file)
@@ -135,7 +135,7 @@ static void enter_guest(struct kvm_vcpu *vcpu)
 int main(void)
 {
        struct kvm_vcpu *vcpu;
-       vm_vaddr_t pvti_gva;
+       gva_t pvti_gva;
        vm_paddr_t pvti_gpa;
        struct kvm_vm *vm;
        int flags;
index f001cb836bfa38e9abb5ab678fdcbe831baaf1c5..761fec2934080380e8a7865c2d46079a3c61acdd 100644 (file)
@@ -67,7 +67,7 @@ static void l1_guest_code(void *data)
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t guest_gva;
+       gva_t guest_gva;
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
 
index 619229bbd693b2e738849a7cf26587603742ca22..0e67cce8357013c5a4c93370d6c889a7af7958d8 100644 (file)
 #define TEST_SYNC_WRITE_FAULT          BIT(1)
 #define TEST_SYNC_NO_FAULT             BIT(2)
 
-static void l2_guest_code(vm_vaddr_t base)
+static void l2_guest_code(gva_t base)
 {
-       vm_vaddr_t page0 = TEST_GUEST_ADDR(base, 0);
-       vm_vaddr_t page1 = TEST_GUEST_ADDR(base, 1);
+       gva_t page0 = TEST_GUEST_ADDR(base, 0);
+       gva_t page1 = TEST_GUEST_ADDR(base, 1);
 
        READ_ONCE(*(u64 *)page0);
        GUEST_SYNC(page0 | TEST_SYNC_READ_FAULT);
@@ -143,7 +143,7 @@ static void l1_guest_code(void *data)
 static void test_handle_ucall_sync(struct kvm_vm *vm, u64 arg,
                                   unsigned long *bmap)
 {
-       vm_vaddr_t gva = arg & ~(PAGE_SIZE - 1);
+       gva_t gva = arg & ~(PAGE_SIZE - 1);
        int page_nr, i;
 
        /*
@@ -198,7 +198,7 @@ static void test_handle_ucall_sync(struct kvm_vm *vm, u64 arg,
 
 static void test_dirty_log(bool nested_tdp)
 {
-       vm_vaddr_t nested_gva = 0;
+       gva_t nested_gva = 0;
        unsigned long *bmap;
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
index abc824dba04fd47397bee9e70b6d180115de400b..d398add21e4c134431e44fa938269a03cc6a0666 100644 (file)
@@ -122,7 +122,7 @@ static void guest_code(void *test_data)
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t nested_test_data_gva;
+       gva_t nested_test_data_gva;
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
 
index 3641a42934acb799d6c420543848a016095f235e..646cfb0022b32829a4ccb6bb508b487bfbf4cb06 100644 (file)
@@ -216,7 +216,7 @@ static void queue_ss_exception(struct kvm_vcpu *vcpu, bool inject)
  */
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t nested_test_data_gva;
+       gva_t nested_test_data_gva;
        struct kvm_vcpu_events events;
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
index a6b6da9cf7fe1d1d4c613d012bb2c85429a74729..11fd2467d8233516208609d4d305d2553a2496b3 100644 (file)
@@ -78,7 +78,7 @@ int main(int argc, char *argv[])
 {
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
-       vm_vaddr_t guest_gva = 0;
+       gva_t guest_gva = 0;
 
        TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_VMX) ||
                     kvm_cpu_has(X86_FEATURE_SVM));
index 2839f650e5c9daac9646faf5b7d974bb2e9e1cc6..d9238116d30d4c4f836c97a143421e06833e0668 100644 (file)
@@ -125,7 +125,7 @@ static void report(int64_t val)
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t nested_gva;
+       gva_t nested_gva;
        struct kvm_vcpu *vcpu;
 
        TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_VMX) ||
index 4260c9e4f48918f88412f5a00c02eb1e2d7c39e3..b76f29e1e775528d0dbb770dcf3faada1d41a627 100644 (file)
@@ -152,7 +152,7 @@ int main(int argc, char *argv[])
 {
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
-       vm_vaddr_t guest_gva = 0;
+       gva_t guest_gva = 0;
 
        uint64_t tsc_start, tsc_end;
        uint64_t tsc_khz;
index 71717118d6924a4345ab8caaebae8cffd20f9820..85d3f4cc76f395e6d6dc96035eb9c499498fbe36 100644 (file)
@@ -128,7 +128,7 @@ static void l1_guest_code(struct svm_test_data *svm)
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t nested_gva = 0;
+       gva_t nested_gva = 0;
        struct vmcb *test_vmcb[2];
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
index 8bd37a476f15959e6fd9419a63e1dce0e53802da..dcb3aee699b9f9444460d412f563499b66d6f5cb 100644 (file)
@@ -108,7 +108,7 @@ static void test_sync_vmsa(uint32_t type, uint64_t policy)
 {
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
-       vm_vaddr_t gva;
+       gva_t gva;
        void *hva;
 
        double x87val = M_PI;
index ade8412bf94aac5b2452ba2b6422a39d08fda47c..3ede3ed8ae5cae4fef7a876a3a08b1dc145c2396 100644 (file)
@@ -113,7 +113,7 @@ static void guest_code(void *arg)
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t nested_gva = 0;
+       gva_t nested_gva = 0;
 
        struct kvm_vcpu *vcpu;
        struct kvm_regs regs;
index 992a52504a4ab536e5dccddb4464b10394105b43..6797da4bd9d98c3f1221561802388fe231191492 100644 (file)
@@ -258,7 +258,7 @@ void check_nested_state(int stage, struct kvm_x86_state *state)
 int main(int argc, char *argv[])
 {
        uint64_t *xstate_bv, saved_xstate_bv;
-       vm_vaddr_t nested_gva = 0;
+       gva_t nested_gva = 0;
        struct kvm_cpuid2 empty_cpuid = {};
        struct kvm_regs regs1, regs2;
        struct kvm_vcpu *vcpu, *vcpuN;
index 917b6066cfc123e856dee9f191d72029ee59958c..d3cc5e4f788310dfc7f00e14e5f48096e926b240 100644 (file)
@@ -82,7 +82,7 @@ static void l1_guest_code(struct svm_test_data *svm)
 int main(int argc, char *argv[])
 {
        struct kvm_vcpu *vcpu;
-       vm_vaddr_t svm_gva;
+       gva_t svm_gva;
        struct kvm_vm *vm;
        struct ucall uc;
 
index ff99438824d3a365369962330eec3b47f067ae46..7fbfaa054c952b7c005279e3cc564849e5ab4eef 100644 (file)
@@ -97,9 +97,9 @@ void test_lbrv_nested_state(bool nested_lbrv)
 {
        struct kvm_x86_state *state = NULL;
        struct kvm_vcpu *vcpu;
-       vm_vaddr_t svm_gva;
        struct kvm_vm *vm;
        struct ucall uc;
+       gva_t svm_gva;
 
        pr_info("Testing with nested LBRV %s\n", nested_lbrv ? "enabled" : "disabled");
 
index a521a9eed06138915120d7ed558c26d98b952798..6a89eaffc65780e1db04a53cac152c6add2c475a 100644 (file)
@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
 {
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
-       vm_vaddr_t nested_gva = 0;
+       gva_t nested_gva = 0;
 
        TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_SVM));
 
index 00135cbba35eacd98f34b4df3e4968a715228fdd..c6ea3d609a6298d5cbacd231e7c3c6fc7100d008 100644 (file)
@@ -42,7 +42,7 @@ static void l1_guest_code(struct svm_test_data *svm, struct idt_entry *idt)
 int main(int argc, char *argv[])
 {
        struct kvm_vcpu *vcpu;
-       vm_vaddr_t svm_gva;
+       gva_t svm_gva;
        struct kvm_vm *vm;
 
        TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_SVM));
index 4bd1655f9e6d0d09d3df8ce7cb891849a73b7825..c739d071d3b3570757a1dcdc47371f5948cccd59 100644 (file)
@@ -144,8 +144,8 @@ static void run_test(bool is_nmi)
 {
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
-       vm_vaddr_t svm_gva;
-       vm_vaddr_t idt_alt_vm;
+       gva_t svm_gva;
+       gva_t idt_alt_vm;
        struct kvm_guest_debug debug;
 
        pr_info("Running %s test\n", is_nmi ? "NMI" : "soft int");
index 569869bed20b5c3631237f040273dc0de99a1cd7..ae8a10913af76cba36a257dac164e6291070a3c5 100644 (file)
@@ -74,7 +74,7 @@ static u64 unmappable_gpa(struct kvm_vcpu *vcpu)
 
 static void test_invalid_vmcb12(struct kvm_vcpu *vcpu)
 {
-       vm_vaddr_t nested_gva = 0;
+       gva_t nested_gva = 0;
        struct ucall uc;
 
 
@@ -90,7 +90,7 @@ static void test_invalid_vmcb12(struct kvm_vcpu *vcpu)
 
 static void test_unmappable_vmcb12(struct kvm_vcpu *vcpu)
 {
-       vm_vaddr_t nested_gva = 0;
+       gva_t nested_gva = 0;
 
        vcpu_alloc_svm(vcpu->vm, &nested_gva);
        vcpu_args_set(vcpu, 2, nested_gva, unmappable_gpa(vcpu));
@@ -103,7 +103,7 @@ static void test_unmappable_vmcb12(struct kvm_vcpu *vcpu)
 static void test_unmappable_vmcb12_vmexit(struct kvm_vcpu *vcpu)
 {
        struct kvm_x86_state *state;
-       vm_vaddr_t nested_gva = 0;
+       gva_t nested_gva = 0;
        struct ucall uc;
 
        /*
index 8a62cca28cfbb377af77b31b985b3e8694430edf..b1887242f3b8e4240324c823a1b5193d6fd62d35 100644 (file)
@@ -36,7 +36,7 @@ static void l1_guest_code(struct svm_test_data *svm)
 int main(int argc, char *argv[])
 {
        struct kvm_vcpu *vcpu;
-       vm_vaddr_t svm_gva;
+       gva_t svm_gva;
        struct kvm_vm *vm;
 
        TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_SVM));
index 56306a19144a7db90a7f0906aede46e75ee346a1..f1c488e0d4975f08d03dfaf433023eaf10ddb18f 100644 (file)
@@ -72,13 +72,13 @@ int main(void)
 
 
        if (has_vmx) {
-               vm_vaddr_t vmx_pages_gva;
+               gva_t vmx_pages_gva;
 
                vm = vm_create_with_one_vcpu(&vcpu, l1_guest_code_vmx);
                vcpu_alloc_vmx(vm, &vmx_pages_gva);
                vcpu_args_set(vcpu, 1, vmx_pages_gva);
        } else {
-               vm_vaddr_t svm_gva;
+               gva_t svm_gva;
 
                vm = vm_create_with_one_vcpu(&vcpu, l1_guest_code_svm);
                vcpu_alloc_svm(vm, &svm_gva);
index a81a24761aac072a0359305826712a917ed06bba..dc5c3d1db3469c575300353398ab900002662d9a 100644 (file)
@@ -72,7 +72,7 @@ static void l1_guest_code(struct vmx_pages *vmx_pages, unsigned long high_gpa)
 int main(int argc, char *argv[])
 {
        unsigned long apic_access_addr = ~0ul;
-       vm_vaddr_t vmx_pages_gva;
+       gva_t vmx_pages_gva;
        unsigned long high_gpa;
        struct vmx_pages *vmx;
        bool done = false;
index 337c53fddeff2ed2fa13dece110b65d1cb9f7479..7f84cc92feaf7824898bfe3728fef3123c6b2ebb 100644 (file)
@@ -110,7 +110,7 @@ static void l1_guest_code(struct vmx_pages *vmx_pages)
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t vmx_pages_gva;
+       gva_t vmx_pages_gva;
        struct vmx_pages *vmx;
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
index a100ee5f000936e8e397d2112071b19f18192ff5..a2eaceed9ad5207c2c17a88e2d6d4c80d13cc3f9 100644 (file)
@@ -52,7 +52,7 @@ static void l1_guest_code(struct vmx_pages *vmx_pages)
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t vmx_pages_gva;
+       gva_t vmx_pages_gva;
        struct kvm_sregs sregs;
        struct kvm_vcpu *vcpu;
        struct kvm_run *run;
index 915c42001dbaa2cac3b82be1da74f7b9701ced6b..4ffa11a6bcd8e7c86831f8a0917c5e561e838d90 100644 (file)
@@ -73,7 +73,7 @@ void guest_code(struct vmx_pages *vmx_pages)
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t vmx_pages_gva = 0;
+       gva_t vmx_pages_gva = 0;
        struct kvm_vm *vm;
        struct kvm_vcpu *vcpu;
        struct kvm_x86_state *state;
index 00dd2ac07a61e717256e4cf7ee0509745ac2931b..1b7b6ba23de7627ad5f792060ebcd24341866953 100644 (file)
@@ -152,7 +152,7 @@ void guest_code(struct vmx_pages *vmx_pages)
 
 int main(int argc, char *argv[])
 {
-       vm_vaddr_t vmx_pages_gva = 0;
+       gva_t vmx_pages_gva = 0;
 
        struct kvm_regs regs1, regs2;
        struct kvm_vm *vm;
index ae4a4b6c05cad785bcddef182c7a30632d909259..0b10dfbfa3ea21e731cc9cfaa882ca517116a70c 100644 (file)
@@ -393,7 +393,7 @@ int main(int argc, char *argv[])
        int run_secs = 0;
        int delay_usecs = 0;
        struct test_data_page *data;
-       vm_vaddr_t test_data_page_vaddr;
+       gva_t test_data_page_vaddr;
        bool migrate = false;
        pthread_t threads[2];
        struct thread_params params[2];