From: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
To: kvm@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Harsh Prateek Bora <harshpb@linux.ibm.com>,
Christophe Leroy <chleroy@kernel.org>,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
Nicholas Piggin <npiggin@gmail.com>,
Misbah Anjum N <misanjum@linux.ibm.com>,
Anushree Mathur <anushree.mathur@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
linux-kernel@vger.kernel.org,
"Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Subject: [RFC v3 06/10] KVM: PPC: selftests: Use u64 instead of uint64_t
Date: Wed, 27 May 2026 18:19:55 +0530 [thread overview]
Message-ID: <0132c8045f8d2718b155eab52e659d9b0a80aefe.1779885589.git.ritesh.list@gmail.com> (raw)
In-Reply-To: <cover.1779885589.git.ritesh.list@gmail.com>
commit 26f8453288d4c ("KVM: selftests: Use u64 instead of uint64_t")
made this change from uint64_t -> u64 for all other kvm selftests.
Do the same for powerpc as well. No functional changes expected.
Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
---
.../selftests/kvm/include/powerpc/hcall.h | 6 +--
.../selftests/kvm/include/powerpc/processor.h | 16 +++----
.../testing/selftests/kvm/lib/powerpc/hcall.c | 6 +--
.../selftests/kvm/lib/powerpc/processor.c | 44 +++++++++----------
4 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/tools/testing/selftests/kvm/include/powerpc/hcall.h b/tools/testing/selftests/kvm/include/powerpc/hcall.h
index 4028baa6c5d8..f923b3f5e233 100644
--- a/tools/testing/selftests/kvm/include/powerpc/hcall.h
+++ b/tools/testing/selftests/kvm/include/powerpc/hcall.h
@@ -10,8 +10,8 @@
/* Ucalls use unimplemented PAPR hcall 0 which exits KVM */
#define H_UCALL 0
-int64_t hcall0(uint64_t token);
-int64_t hcall1(uint64_t token, uint64_t arg1);
-int64_t hcall2(uint64_t token, uint64_t arg1, uint64_t arg2);
+int64_t hcall0(u64 token);
+int64_t hcall1(u64 token, u64 arg1);
+int64_t hcall2(u64 token, u64 arg1, u64 arg2);
#endif
diff --git a/tools/testing/selftests/kvm/include/powerpc/processor.h b/tools/testing/selftests/kvm/include/powerpc/processor.h
index cb75b77c33bb..cbbe390ae244 100644
--- a/tools/testing/selftests/kvm/include/powerpc/processor.h
+++ b/tools/testing/selftests/kvm/include/powerpc/processor.h
@@ -15,16 +15,16 @@ struct kvm_vm;
struct kvm_vcpu;
struct ex_regs {
- uint64_t gprs[32];
- uint64_t nia;
- uint64_t msr;
- uint64_t cfar;
- uint64_t lr;
- uint64_t ctr;
- uint64_t xer;
+ u64 gprs[32];
+ u64 nia;
+ u64 msr;
+ u64 cfar;
+ u64 lr;
+ u64 ctr;
+ u64 xer;
uint32_t cr;
uint32_t trap;
- uint64_t vaddr; /* vaddr of this struct */
+ u64 vaddr; /* vaddr of this struct */
};
void vm_install_exception_handler(struct kvm_vm *vm, int vector,
diff --git a/tools/testing/selftests/kvm/lib/powerpc/hcall.c b/tools/testing/selftests/kvm/lib/powerpc/hcall.c
index efb4318252be..cd10022572a5 100644
--- a/tools/testing/selftests/kvm/lib/powerpc/hcall.c
+++ b/tools/testing/selftests/kvm/lib/powerpc/hcall.c
@@ -5,7 +5,7 @@
#include "kvm_util.h"
#include "hcall.h"
-int64_t hcall0(uint64_t token)
+int64_t hcall0(u64 token)
{
register uintptr_t r3 asm ("r3") = token;
@@ -17,7 +17,7 @@ int64_t hcall0(uint64_t token)
return r3;
}
-int64_t hcall1(uint64_t token, uint64_t arg1)
+int64_t hcall1(u64 token, u64 arg1)
{
register uintptr_t r3 asm ("r3") = token;
register uintptr_t r4 asm ("r4") = arg1;
@@ -30,7 +30,7 @@ int64_t hcall1(uint64_t token, uint64_t arg1)
return r3;
}
-int64_t hcall2(uint64_t token, uint64_t arg1, uint64_t arg2)
+int64_t hcall2(u64 token, u64 arg1, u64 arg2)
{
register uintptr_t r3 asm ("r3") = token;
register uintptr_t r4 asm ("r4") = arg1;
diff --git a/tools/testing/selftests/kvm/lib/powerpc/processor.c b/tools/testing/selftests/kvm/lib/powerpc/processor.c
index 9846ec26a32a..ac5c3421ec81 100644
--- a/tools/testing/selftests/kvm/lib/powerpc/processor.c
+++ b/tools/testing/selftests/kvm/lib/powerpc/processor.c
@@ -14,9 +14,9 @@
#define RADIX_TREE_SIZE ((0x2UL << 61) | (0x5UL << 5)) /* 52-bits */
#define RADIX_PGD_INDEX_SIZE 13
-static void set_proc_table(struct kvm_vm *vm, int pid, uint64_t dw0, uint64_t dw1)
+static void set_proc_table(struct kvm_vm *vm, int pid, u64 dw0, u64 dw1)
{
- uint64_t *proc_table;
+ u64 *proc_table;
proc_table = addr_gpa2hva(vm, vm->arch.prtb);
proc_table[pid * 2 + 0] = cpu_to_be64(dw0);
@@ -81,9 +81,9 @@ static int pt_shift(struct kvm_vm *vm, int level)
}
}
-static uint64_t pt_entry_coverage(struct kvm_vm *vm, int level)
+static u64 pt_entry_coverage(struct kvm_vm *vm, int level)
{
- uint64_t size = vm->page_size;
+ u64 size = vm->page_size;
if (level == 4)
return size;
@@ -97,7 +97,7 @@ static uint64_t pt_entry_coverage(struct kvm_vm *vm, int level)
return size;
}
-static int pt_idx(struct kvm_vm *vm, uint64_t vaddr, int level, uint64_t *nls)
+static int pt_idx(struct kvm_vm *vm, u64 vaddr, int level, u64 *nls)
{
switch (level) {
case 1:
@@ -128,11 +128,11 @@ static int pt_idx(struct kvm_vm *vm, uint64_t vaddr, int level, uint64_t *nls)
}
}
-static uint64_t *virt_get_pte(struct kvm_vm *vm, gpa_t pt,
- uint64_t vaddr, int level, uint64_t *nls)
+static u64 *virt_get_pte(struct kvm_vm *vm, gpa_t pt,
+ u64 vaddr, int level, u64 *nls)
{
int idx = pt_idx(vm, vaddr, level, nls);
- uint64_t *ptep = addr_gpa2hva(vm, pt + idx * 8);
+ u64 *ptep = addr_gpa2hva(vm, pt + idx * 8);
return ptep;
}
@@ -151,7 +151,7 @@ static uint64_t *virt_get_pte(struct kvm_vm *vm, gpa_t pt,
#define PDE_NLS 0x0000000000000011ull
#define PDE_PT_MASK 0x0fffffffffffff00ull
-static gpa_t __vm_alloc_pt(struct kvm_vm *vm, uint64_t pt_shift)
+static gpa_t __vm_alloc_pt(struct kvm_vm *vm, u64 pt_shift)
{
gpa_t pt;
@@ -189,16 +189,16 @@ static gpa_t __vm_alloc_pt(struct kvm_vm *vm, uint64_t pt_shift)
return pt;
}
-void virt_arch_pg_map(struct kvm_vm *vm, uint64_t gva, uint64_t gpa)
+void virt_arch_pg_map(struct kvm_vm *vm, u64 gva, u64 gpa)
{
gpa_t pt = vm->mmu.pgd;
- uint64_t *ptep, pte;
+ u64 *ptep, pte;
int level;
for (level = 1; level <= 3; level++) {
- uint64_t nls;
- uint64_t *pdep = virt_get_pte(vm, pt, gva, level, &nls);
- uint64_t pde = be64_to_cpu(*pdep);
+ u64 nls;
+ u64 *pdep = virt_get_pte(vm, pt, gva, level, &nls);
+ u64 pde = be64_to_cpu(*pdep);
if (pde) {
TEST_ASSERT((pde & PDE_VALID) && !(pde & PTE_LEAF),
@@ -227,13 +227,13 @@ void virt_arch_pg_map(struct kvm_vm *vm, uint64_t gva, uint64_t gpa)
gpa_t addr_arch_gva2gpa(struct kvm_vm *vm, gva_t gva)
{
gpa_t pt = vm->mmu.pgd;
- uint64_t *ptep, pte;
+ u64 *ptep, pte;
int level;
for (level = 1; level <= 3; level++) {
- uint64_t nls;
- uint64_t *pdep = virt_get_pte(vm, pt, gva, level, &nls);
- uint64_t pde = be64_to_cpu(*pdep);
+ u64 nls;
+ u64 *pdep = virt_get_pte(vm, pt, gva, level, &nls);
+ u64 pde = be64_to_cpu(*pdep);
TEST_ASSERT((pde & PDE_VALID) && !(pde & PTE_LEAF),
"PDE not present at level: %u gva: 0x%lx pde:0x%lx\n",
@@ -263,8 +263,8 @@ static void virt_dump_pt(FILE *stream, struct kvm_vm *vm, gpa_t pt,
size = 1U << (pt_shift(vm, level) + 3);
for (idx = 0; idx < size; idx += 8, va += pt_entry_coverage(vm, level)) {
- uint64_t *page_table = addr_gpa2hva(vm, pt + idx);
- uint64_t pte = be64_to_cpu(*page_table);
+ u64 *page_table = addr_gpa2hva(vm, pt + idx);
+ u64 pte = be64_to_cpu(*page_table);
if (!(pte & PTE_VALID))
continue;
@@ -320,7 +320,7 @@ struct kvm_vcpu *vm_arch_vcpu_add(struct kvm_vm *vm, uint32_t vcpu_id)
struct ex_regs *ex_regs;
struct kvm_regs regs;
struct kvm_vcpu *vcpu;
- uint64_t lpcr;
+ u64 lpcr;
stack_vaddr = __vm_alloc(vm, stack_size,
DEFAULT_GUEST_STACK_VADDR_MIN,
@@ -374,7 +374,7 @@ void vcpu_args_set(struct kvm_vcpu *vcpu, unsigned int num, ...)
vcpu_regs_get(vcpu, ®s);
for (i = 0; i < num; i++)
- regs.gpr[i + 3] = va_arg(ap, uint64_t);
+ regs.gpr[i + 3] = va_arg(ap, u64);
vcpu_regs_set(vcpu, ®s);
va_end(ap);
--
2.39.5
next prev parent reply other threads:[~2026-05-27 12:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 12:49 [RFC v3 00/10] KVM: selftests: add powerpc support Ritesh Harjani (IBM)
2026-05-27 12:49 ` [RFC v3 01/10] KVM: selftests: Move pgd_created check into virt_pgd_alloc Ritesh Harjani (IBM)
2026-05-27 12:49 ` [RFC v3 02/10] KVM: selftests: Add aligned guest physical page allocator Ritesh Harjani (IBM)
2026-05-27 12:49 ` [RFC v3 03/10] KVM: PPC: selftests: add support for powerpc Ritesh Harjani (IBM)
2026-05-27 12:49 ` [RFC v3 04/10] KVM: PPC: selftests: powerpc enable kvm_create_max_vcpus test Ritesh Harjani (IBM)
2026-05-27 12:49 ` [RFC v3 05/10] KVM: selftests: Print the vcpu_id when KVM_CREATE_VCPU ioctl fails Ritesh Harjani (IBM)
2026-05-27 12:49 ` Ritesh Harjani (IBM) [this message]
2026-05-27 12:49 ` [RFC v3 07/10] KVM: PPC: selftests: Use s64 instead of int64_t Ritesh Harjani (IBM)
2026-05-27 12:49 ` [RFC v3 08/10] KVM: PPC: selftests: Use u32 instead of uint32_t Ritesh Harjani (IBM)
2026-05-27 12:49 ` [RFC v3 09/10] KVM: PPC: selftests: Use u8 instead of uint8_t Ritesh Harjani (IBM)
2026-05-27 12:49 ` [RFC v3 10/10] KVM: PPC: selftests: Replace u64 gpa, u64 gva|vaddr with gpa_t and gva_t Ritesh Harjani (IBM)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0132c8045f8d2718b155eab52e659d9b0a80aefe.1779885589.git.ritesh.list@gmail.com \
--to=ritesh.list@gmail.com \
--cc=anushree.mathur@linux.ibm.com \
--cc=chleroy@kernel.org \
--cc=harshpb@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=misanjum@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=venkat88@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®