Skip to content

Commit a05c4c2

Browse files
committed
KVM: selftests: Use GUEST_FAIL() in ARM's arch timer helpers
Use GUEST_FAIL() in ARM's arch timer helpers now that printf-based guest asserts are the default (and only) style of guest asserts, and say goodbye to the GUEST_ASSERT_1() alias. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 6f32101 commit a05c4c2

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

tools/testing/selftests/kvm/include/aarch64/arch_timer.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static inline uint64_t timer_get_cntct(enum arch_timer timer)
4141
case PHYSICAL:
4242
return read_sysreg(cntpct_el0);
4343
default:
44-
GUEST_ASSERT_1(0, timer);
44+
GUEST_FAIL("Unexpected timer type = %u", timer);
4545
}
4646

4747
/* We should not reach here */
@@ -58,7 +58,7 @@ static inline void timer_set_cval(enum arch_timer timer, uint64_t cval)
5858
write_sysreg(cval, cntp_cval_el0);
5959
break;
6060
default:
61-
GUEST_ASSERT_1(0, timer);
61+
GUEST_FAIL("Unexpected timer type = %u", timer);
6262
}
6363

6464
isb();
@@ -72,7 +72,7 @@ static inline uint64_t timer_get_cval(enum arch_timer timer)
7272
case PHYSICAL:
7373
return read_sysreg(cntp_cval_el0);
7474
default:
75-
GUEST_ASSERT_1(0, timer);
75+
GUEST_FAIL("Unexpected timer type = %u", timer);
7676
}
7777

7878
/* We should not reach here */
@@ -89,7 +89,7 @@ static inline void timer_set_tval(enum arch_timer timer, uint32_t tval)
8989
write_sysreg(tval, cntp_tval_el0);
9090
break;
9191
default:
92-
GUEST_ASSERT_1(0, timer);
92+
GUEST_FAIL("Unexpected timer type = %u", timer);
9393
}
9494

9595
isb();
@@ -105,7 +105,7 @@ static inline void timer_set_ctl(enum arch_timer timer, uint32_t ctl)
105105
write_sysreg(ctl, cntp_ctl_el0);
106106
break;
107107
default:
108-
GUEST_ASSERT_1(0, timer);
108+
GUEST_FAIL("Unexpected timer type = %u", timer);
109109
}
110110

111111
isb();
@@ -119,7 +119,7 @@ static inline uint32_t timer_get_ctl(enum arch_timer timer)
119119
case PHYSICAL:
120120
return read_sysreg(cntp_ctl_el0);
121121
default:
122-
GUEST_ASSERT_1(0, timer);
122+
GUEST_FAIL("Unexpected timer type = %u", timer);
123123
}
124124

125125
/* We should not reach here */

tools/testing/selftests/kvm/include/ucall_common.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,4 @@ do { \
103103
(const char *)(ucall).args[GUEST_FILE], \
104104
(ucall).args[GUEST_LINE], "%s", (ucall).buffer)
105105

106-
/* FIXME: Drop this alias once the param-based guest asserts are gone. */
107-
#define GUEST_ASSERT_1(_condition, arg1) \
108-
__GUEST_ASSERT(_condition, "arg1 = 0x%lx", arg1)
109-
110106
#endif /* SELFTEST_KVM_UCALL_COMMON_H */

0 commit comments

Comments
 (0)