From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>,
Tianrui Zhao <zhaotianrui@loongson.cn>,
Bibo Mao <maobibo@loongson.cn>,
Huacai Chen <chenhuacai@kernel.org>,
Anup Patel <anup@brainfault.org>, Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
Sean Christopherson <seanjc@google.com>
Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
kvmarm@lists.linux.dev, loongarch@lists.linux.dev,
kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org,
David Matlack <dmatlack@google.com>
Subject: [PATCH v3 07/19] KVM: selftests: Use s32 instead of int32_t
Date: Mon, 20 Apr 2026 14:19:52 -0700 [thread overview]
Message-ID: <20260420212004.3938325-8-seanjc@google.com> (raw)
In-Reply-To: <20260420212004.3938325-1-seanjc@google.com>
From: David Matlack <dmatlack@google.com>
Use s32 instead of int32_t to make the KVM selftests code more concise
and more similar to the kernel (since selftests are primarily developed
by kernel developers).
This commit was generated with the following command:
git ls-files tools/testing/selftests/kvm | xargs sed -i 's/int32_t/s32/g'
Then by manually adjusting whitespace to make checkpatch.pl happy.
No functional change intended.
Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
.../kvm/arm64/arch_timer_edge_cases.c | 24 +++++++++----------
.../selftests/kvm/include/arm64/arch_timer.h | 4 ++--
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c b/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c
index f8b183f13864..f7625eb711d6 100644
--- a/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c
+++ b/tools/testing/selftests/kvm/arm64/arch_timer_edge_cases.c
@@ -25,8 +25,8 @@
/* Depends on counter width. */
static u64 CVAL_MAX;
/* tval is a signed 32-bit int. */
-static const int32_t TVAL_MAX = INT32_MAX;
-static const int32_t TVAL_MIN = INT32_MIN;
+static const s32 TVAL_MAX = INT32_MAX;
+static const s32 TVAL_MIN = INT32_MIN;
/* After how much time we say there is no IRQ. */
static const u32 TIMEOUT_NO_IRQ_US = 50000;
@@ -355,7 +355,7 @@ static void test_timer_cval(enum arch_timer timer, u64 cval,
test_timer_xval(timer, cval, TIMER_CVAL, wm, reset_state, reset_cnt);
}
-static void test_timer_tval(enum arch_timer timer, int32_t tval,
+static void test_timer_tval(enum arch_timer timer, s32 tval,
irq_wait_method_t wm, bool reset_state,
u64 reset_cnt)
{
@@ -385,10 +385,10 @@ static void test_cval_no_irq(enum arch_timer timer, u64 cval,
test_xval_check_no_irq(timer, cval, usec, TIMER_CVAL, wm);
}
-static void test_tval_no_irq(enum arch_timer timer, int32_t tval, u64 usec,
+static void test_tval_no_irq(enum arch_timer timer, s32 tval, u64 usec,
sleep_method_t wm)
{
- /* tval will be cast to an int32_t in test_xval_check_no_irq */
+ /* tval will be cast to an s32 in test_xval_check_no_irq */
test_xval_check_no_irq(timer, (u64)tval, usec, TIMER_TVAL, wm);
}
@@ -463,7 +463,7 @@ static void test_timers_fired_multiple_times(enum arch_timer timer)
* timeout for the wait: we use the wfi instruction.
*/
static void test_reprogramming_timer(enum arch_timer timer, irq_wait_method_t wm,
- int32_t delta_1_ms, int32_t delta_2_ms)
+ s32 delta_1_ms, s32 delta_2_ms)
{
local_irq_disable();
reset_timer_state(timer, DEF_CNT);
@@ -504,7 +504,7 @@ static void test_reprogram_timers(enum arch_timer timer)
static void test_basic_functionality(enum arch_timer timer)
{
- int32_t tval = (int32_t) msec_to_cycles(test_args.wait_ms);
+ s32 tval = (s32)msec_to_cycles(test_args.wait_ms);
u64 cval = DEF_CNT + msec_to_cycles(test_args.wait_ms);
int i;
@@ -685,7 +685,7 @@ static void test_set_cnt_after_xval_no_irq(enum arch_timer timer,
}
static void test_set_cnt_after_tval(enum arch_timer timer, u64 cnt_1,
- int32_t tval, u64 cnt_2,
+ s32 tval, u64 cnt_2,
irq_wait_method_t wm)
{
test_set_cnt_after_xval(timer, cnt_1, tval, cnt_2, wm, TIMER_TVAL);
@@ -699,7 +699,7 @@ static void test_set_cnt_after_cval(enum arch_timer timer, u64 cnt_1,
}
static void test_set_cnt_after_tval_no_irq(enum arch_timer timer,
- u64 cnt_1, int32_t tval,
+ u64 cnt_1, s32 tval,
u64 cnt_2, sleep_method_t wm)
{
test_set_cnt_after_xval_no_irq(timer, cnt_1, tval, cnt_2, wm,
@@ -718,7 +718,7 @@ static void test_set_cnt_after_cval_no_irq(enum arch_timer timer,
static void test_move_counters_ahead_of_timers(enum arch_timer timer)
{
int i;
- int32_t tval;
+ s32 tval;
for (i = 0; i < ARRAY_SIZE(irq_wait_method); i++) {
irq_wait_method_t wm = irq_wait_method[i];
@@ -753,7 +753,7 @@ static void test_move_counters_behind_timers(enum arch_timer timer)
static void test_timers_in_the_past(enum arch_timer timer)
{
- int32_t tval = -1 * (int32_t) msec_to_cycles(test_args.wait_ms);
+ s32 tval = -1 * (s32)msec_to_cycles(test_args.wait_ms);
u64 cval;
int i;
@@ -789,7 +789,7 @@ static void test_timers_in_the_past(enum arch_timer timer)
static void test_long_timer_delays(enum arch_timer timer)
{
- int32_t tval = (int32_t) msec_to_cycles(test_args.long_wait_ms);
+ s32 tval = (s32)msec_to_cycles(test_args.long_wait_ms);
u64 cval = DEF_CNT + msec_to_cycles(test_args.long_wait_ms);
int i;
diff --git a/tools/testing/selftests/kvm/include/arm64/arch_timer.h b/tools/testing/selftests/kvm/include/arm64/arch_timer.h
index 4fe0e0d07584..a5836d4ab7ee 100644
--- a/tools/testing/selftests/kvm/include/arm64/arch_timer.h
+++ b/tools/testing/selftests/kvm/include/arm64/arch_timer.h
@@ -79,7 +79,7 @@ static inline u64 timer_get_cval(enum arch_timer timer)
return 0;
}
-static inline void timer_set_tval(enum arch_timer timer, int32_t tval)
+static inline void timer_set_tval(enum arch_timer timer, s32 tval)
{
switch (timer) {
case VIRTUAL:
@@ -95,7 +95,7 @@ static inline void timer_set_tval(enum arch_timer timer, int32_t tval)
isb();
}
-static inline int32_t timer_get_tval(enum arch_timer timer)
+static inline s32 timer_get_tval(enum arch_timer timer)
{
isb();
switch (timer) {
--
2.54.0.rc1.555.g9c883467ad-goog
next prev parent reply other threads:[~2026-04-20 21:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 21:19 [PATCH v3 00/19] KVM: selftests: Use kernel-style integer and g[vp]a_t types Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 01/19] KVM: selftests: Use gva_t instead of vm_vaddr_t Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 02/19] KVM: selftests: Use gpa_t instead of vm_paddr_t Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 03/19] KVM: selftests: Use gpa_t for GPAs in Hyper-V selftests Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 04/19] KVM: selftests: Use u64 instead of uint64_t Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 05/19] KVM: selftests: Use s64 instead of int64_t Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 06/19] KVM: selftests: Use u32 instead of uint32_t Sean Christopherson
2026-04-20 21:19 ` Sean Christopherson [this message]
2026-04-20 21:19 ` [PATCH v3 08/19] KVM: selftests: Use u16 instead of uint16_t Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 09/19] KVM: selftests: Use s16 instead of int16_t Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 10/19] KVM: selftests: Use u8 instead of uint8_t Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 11/19] KVM: selftests: Drop "vaddr_" from APIs that allocate memory for a given VM Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 12/19] KVM: selftests: Rename vm_vaddr_unused_gap() => vm_unused_gva_gap() Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 13/19] KVM: selftests: Rename vm_vaddr_populate_bitmap() => vm_populate_gva_bitmap() Sean Christopherson
2026-04-20 21:19 ` [PATCH v3 14/19] KVM: selftests: Rename translate_to_host_paddr() => translate_hva_to_hpa() Sean Christopherson
2026-04-20 21:20 ` [PATCH v3 15/19] KVM: selftests: Clarify that arm64's inject_uer() takes a host PA, not a guest PA Sean Christopherson
2026-04-20 21:20 ` [PATCH v3 16/19] KVM: selftests: Replace "vaddr" with "gva" throughout Sean Christopherson
2026-04-20 21:20 ` [PATCH v3 17/19] KVM: selftests: Replace "u64 gpa" with "gpa_t" throughout Sean Christopherson
2026-04-20 21:20 ` [PATCH v3 18/19] KVM: selftests: Replace "u64 nested_paddr" with "gpa_t l2_gpa" Sean Christopherson
2026-04-20 21:20 ` [PATCH v3 19/19] KVM: selftests: Replace "paddr" with "gpa" throughout Sean Christopherson
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=20260420212004.3938325-8-seanjc@google.com \
--to=seanjc@google.com \
--cc=anup@brainfault.org \
--cc=aou@eecs.berkeley.edu \
--cc=borntraeger@linux.ibm.com \
--cc=chenhuacai@kernel.org \
--cc=dmatlack@google.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm-riscv@lists.infradead.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=loongarch@lists.linux.dev \
--cc=maobibo@loongson.cn \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=pjw@kernel.org \
--cc=zhaotianrui@loongson.cn \
/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