]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: selftests: Use gpa_t for GPAs in Hyper-V selftests
authorDavid Matlack <dmatlack@google.com>
Mon, 20 Apr 2026 21:19:48 +0000 (14:19 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 20 Apr 2026 21:54:16 +0000 (14:54 -0700)
Fix various Hyper-V selftests to use gpa_t for variables that contain
guest physical addresses, rather than gva_t.  In practice, the bugs are
benign as both gva_t and gpa_t are u64 typedefs, i.e. gpa_t and gva_t are
interchangeable from a functional perspective, the code is just confusing.

No functional change intended.

Signed-off-by: David Matlack <dmatlack@google.com>
[sean: call out that both are u64 typedefs]
Link: https://patch.msgid.link/20260420212004.3938325-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86/hyperv_evmcs.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

index c2de5ac799ee6de3a40a985c10104de56573442a..2d1733f9303a053ac45b6e4ad28910d80da1759e 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,
-               gva_t hv_hcall_page_gpa)
+               gpa_t hv_hcall_page_gpa)
 {
 #define L2_GUEST_STACK_SIZE 64
        unsigned long l2_guest_stack[L2_GUEST_STACK_SIZE];
index 1059fcc460e3a7ba6b3ffe1a2ca92c40b0e57d97..0360fa5915c0ccd5fe45ee6cf69ce01f1cc39feb 100644 (file)
@@ -82,7 +82,7 @@ done:
        GUEST_DONE();
 }
 
-static void guest_hcall(gva_t pgs_gpa, struct hcall_data *hcall)
+static void guest_hcall(gpa_t pgs_gpa, struct hcall_data *hcall)
 {
        u64 res, input, output;
        uint8_t vector;
index 7d648219833cb861dc5c25d2b44ae27c4bcc5e13..5369867efac3cb4c5725ab90f319553a766b7b0e 100644 (file)
@@ -45,13 +45,13 @@ struct hv_send_ipi_ex {
        struct hv_vpset vp_set;
 };
 
-static inline void hv_init(gva_t pgs_gpa)
+static inline void hv_init(gpa_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, gva_t pgs_gpa)
+static void receiver_code(void *hcall_page, gpa_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, gva_t pgs_gpa)
+static void sender_guest_code(void *hcall_page, gpa_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;
index e0caf5ea14bda05c8f5872e10d4a59e5b56a8e04..54a1a6dad4d5d03bbaa2ddc97dd518e903953e38 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,
-                                                   gva_t pgs_gpa)
+                                                   gpa_t pgs_gpa)
 {
        unsigned long l2_guest_stack[L2_GUEST_STACK_SIZE];
        struct vmcb *vmcb = svm->vmcb;