Commit 6ec982b5 authored by David Matlack's avatar David Matlack Committed by Sean Christopherson
Browse files

KVM: selftests: Use u8 instead of uint8_t



Use u8 instead of uint8_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/uint8_t/u8/g'

Then by manually adjusting whitespace to make checkpatch.pl happy.

No functional change intended.

Signed-off-by: default avatarDavid Matlack <dmatlack@google.com>
Link: https://patch.msgid.link/20260420212004.3938325-11-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 2540ebd6
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ GEN_DEBUG_WRITE_REG(dbgwvr)

static void reset_debug_state(void)
{
	uint8_t brps, wrps, i;
	u8 brps, wrps, i;
	u64 dfr0;

	asm volatile("msr daifset, #8");
@@ -149,7 +149,7 @@ static void enable_monitor_debug_exceptions(void)
	isb();
}

static void install_wp(uint8_t wpn, u64 addr)
static void install_wp(u8 wpn, u64 addr)
{
	u32 wcr;

@@ -162,7 +162,7 @@ static void install_wp(uint8_t wpn, u64 addr)
	enable_monitor_debug_exceptions();
}

static void install_hw_bp(uint8_t bpn, u64 addr)
static void install_hw_bp(u8 bpn, u64 addr)
{
	u32 bcr;

@@ -174,8 +174,7 @@ static void install_hw_bp(uint8_t bpn, u64 addr)
	enable_monitor_debug_exceptions();
}

static void install_wp_ctx(uint8_t addr_wp, uint8_t ctx_bp, u64 addr,
			   u64 ctx)
static void install_wp_ctx(u8 addr_wp, u8 ctx_bp, u64 addr, u64 ctx)
{
	u32 wcr;
	u64 ctx_bcr;
@@ -196,8 +195,7 @@ static void install_wp_ctx(uint8_t addr_wp, uint8_t ctx_bp, u64 addr,
	enable_monitor_debug_exceptions();
}

void install_hw_bp_ctx(uint8_t addr_bp, uint8_t ctx_bp, u64 addr,
		       u64 ctx)
void install_hw_bp_ctx(u8 addr_bp, u8 ctx_bp, u64 addr, u64 ctx)
{
	u32 addr_bcr, ctx_bcr;

@@ -234,7 +232,7 @@ static void install_ss(void)

static volatile char write_data;

static void guest_code(uint8_t bpn, uint8_t wpn, uint8_t ctx_bpn)
static void guest_code(u8 bpn, u8 wpn, u8 ctx_bpn)
{
	u64 ctx = 0xabcdef;	/* a random context number */

@@ -421,7 +419,7 @@ static int debug_version(u64 id_aa64dfr0)
	return FIELD_GET(ID_AA64DFR0_EL1_DebugVer, id_aa64dfr0);
}

static void test_guest_debug_exceptions(uint8_t bpn, uint8_t wpn, uint8_t ctx_bpn)
static void test_guest_debug_exceptions(u8 bpn, u8 wpn, u8 ctx_bpn)
{
	struct kvm_vcpu *vcpu;
	struct kvm_vm *vm;
@@ -535,7 +533,7 @@ void test_single_step_from_userspace(int test_cnt)
 */
void test_guest_debug_exceptions_all(u64 aa64dfr0)
{
	uint8_t brp_num, wrp_num, ctx_brp_num, normal_brp_num, ctx_brp_base;
	u8 brp_num, wrp_num, ctx_brp_num, normal_brp_num, ctx_brp_base;
	int b, w, c;

	/* Number of breakpoints */
+3 −3
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ struct reg_ftr_bits {
	char *name;
	bool sign;
	enum ftr_type type;
	uint8_t shift;
	u8 shift;
	u64 mask;
	/*
	 * For FTR_EXACT, safe_val is used as the exact safe value.
@@ -384,7 +384,7 @@ u64 get_invalid_value(const struct reg_ftr_bits *ftr_bits, u64 ftr)
static u64 test_reg_set_success(struct kvm_vcpu *vcpu, u64 reg,
				const struct reg_ftr_bits *ftr_bits)
{
	uint8_t shift = ftr_bits->shift;
	u8 shift = ftr_bits->shift;
	u64 mask = ftr_bits->mask;
	u64 val, new_val, ftr;

@@ -407,7 +407,7 @@ static u64 test_reg_set_success(struct kvm_vcpu *vcpu, u64 reg,
static void test_reg_set_fail(struct kvm_vcpu *vcpu, u64 reg,
			      const struct reg_ftr_bits *ftr_bits)
{
	uint8_t shift = ftr_bits->shift;
	u8 shift = ftr_bits->shift;
	u64 mask = ftr_bits->mask;
	u64 val, old_val, ftr;
	int r;
+1 −1
Original line number Diff line number Diff line
@@ -402,7 +402,7 @@ static void guest_code(u64 expected_pmcr_n)
static void create_vpmu_vm(void *guest_code)
{
	struct kvm_vcpu_init init;
	uint8_t pmuver, ec;
	u8 pmuver, ec;
	u64 dfr0, irq = 23;
	struct kvm_device_attr irq_attr = {
		.group = KVM_ARM_VCPU_PMU_V3_CTRL,
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ struct kvm_coalesced_io {
	 * amount of #ifdeffery and complexity, without having to sacrifice
	 * verbose error messages.
	 */
	uint8_t pio_port;
	u8 pio_port;
};

static struct kvm_coalesced_io kvm_builtin_io_ring;
+1 −1
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ static void run_test(struct vcpu_reg_list *c)
	 * since we don't know the capabilities of any new registers.
	 */
	for_each_present_blessed_reg(i) {
		uint8_t addr[2048 / 8];
		u8 addr[2048 / 8];
		struct kvm_one_reg reg = {
			.id = reg_list->reg[i],
			.addr = (__u64)&addr,
Loading