Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: David Matlack <dmatlack@google.com>
Link: https://patch.msgid.link/20260420212004.3938325-11-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>

authored by

David Matlack and committed by
Sean Christopherson
6ec982b5 2540ebd6

+201 -205
+8 -10
tools/testing/selftests/kvm/arm64/debug-exceptions.c
··· 102 102 103 103 static void reset_debug_state(void) 104 104 { 105 - uint8_t brps, wrps, i; 105 + u8 brps, wrps, i; 106 106 u64 dfr0; 107 107 108 108 asm volatile("msr daifset, #8"); ··· 149 149 isb(); 150 150 } 151 151 152 - static void install_wp(uint8_t wpn, u64 addr) 152 + static void install_wp(u8 wpn, u64 addr) 153 153 { 154 154 u32 wcr; 155 155 ··· 162 162 enable_monitor_debug_exceptions(); 163 163 } 164 164 165 - static void install_hw_bp(uint8_t bpn, u64 addr) 165 + static void install_hw_bp(u8 bpn, u64 addr) 166 166 { 167 167 u32 bcr; 168 168 ··· 174 174 enable_monitor_debug_exceptions(); 175 175 } 176 176 177 - static void install_wp_ctx(uint8_t addr_wp, uint8_t ctx_bp, u64 addr, 178 - u64 ctx) 177 + static void install_wp_ctx(u8 addr_wp, u8 ctx_bp, u64 addr, u64 ctx) 179 178 { 180 179 u32 wcr; 181 180 u64 ctx_bcr; ··· 195 196 enable_monitor_debug_exceptions(); 196 197 } 197 198 198 - void install_hw_bp_ctx(uint8_t addr_bp, uint8_t ctx_bp, u64 addr, 199 - u64 ctx) 199 + void install_hw_bp_ctx(u8 addr_bp, u8 ctx_bp, u64 addr, u64 ctx) 200 200 { 201 201 u32 addr_bcr, ctx_bcr; 202 202 ··· 232 234 233 235 static volatile char write_data; 234 236 235 - static void guest_code(uint8_t bpn, uint8_t wpn, uint8_t ctx_bpn) 237 + static void guest_code(u8 bpn, u8 wpn, u8 ctx_bpn) 236 238 { 237 239 u64 ctx = 0xabcdef; /* a random context number */ 238 240 ··· 419 421 return FIELD_GET(ID_AA64DFR0_EL1_DebugVer, id_aa64dfr0); 420 422 } 421 423 422 - static void test_guest_debug_exceptions(uint8_t bpn, uint8_t wpn, uint8_t ctx_bpn) 424 + static void test_guest_debug_exceptions(u8 bpn, u8 wpn, u8 ctx_bpn) 423 425 { 424 426 struct kvm_vcpu *vcpu; 425 427 struct kvm_vm *vm; ··· 533 535 */ 534 536 void test_guest_debug_exceptions_all(u64 aa64dfr0) 535 537 { 536 - uint8_t brp_num, wrp_num, ctx_brp_num, normal_brp_num, ctx_brp_base; 538 + u8 brp_num, wrp_num, ctx_brp_num, normal_brp_num, ctx_brp_base; 537 539 int b, w, c; 538 540 539 541 /* Number of breakpoints */
+3 -3
tools/testing/selftests/kvm/arm64/set_id_regs.c
··· 30 30 char *name; 31 31 bool sign; 32 32 enum ftr_type type; 33 - uint8_t shift; 33 + u8 shift; 34 34 u64 mask; 35 35 /* 36 36 * For FTR_EXACT, safe_val is used as the exact safe value. ··· 384 384 static u64 test_reg_set_success(struct kvm_vcpu *vcpu, u64 reg, 385 385 const struct reg_ftr_bits *ftr_bits) 386 386 { 387 - uint8_t shift = ftr_bits->shift; 387 + u8 shift = ftr_bits->shift; 388 388 u64 mask = ftr_bits->mask; 389 389 u64 val, new_val, ftr; 390 390 ··· 407 407 static void test_reg_set_fail(struct kvm_vcpu *vcpu, u64 reg, 408 408 const struct reg_ftr_bits *ftr_bits) 409 409 { 410 - uint8_t shift = ftr_bits->shift; 410 + u8 shift = ftr_bits->shift; 411 411 u64 mask = ftr_bits->mask; 412 412 u64 val, old_val, ftr; 413 413 int r;
+1 -1
tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
··· 402 402 static void create_vpmu_vm(void *guest_code) 403 403 { 404 404 struct kvm_vcpu_init init; 405 - uint8_t pmuver, ec; 405 + u8 pmuver, ec; 406 406 u64 dfr0, irq = 23; 407 407 struct kvm_device_attr irq_attr = { 408 408 .group = KVM_ARM_VCPU_PMU_V3_CTRL,
+1 -1
tools/testing/selftests/kvm/coalesced_io_test.c
··· 23 23 * amount of #ifdeffery and complexity, without having to sacrifice 24 24 * verbose error messages. 25 25 */ 26 - uint8_t pio_port; 26 + u8 pio_port; 27 27 }; 28 28 29 29 static struct kvm_coalesced_io kvm_builtin_io_ring;
+1 -1
tools/testing/selftests/kvm/get-reg-list.c
··· 216 216 * since we don't know the capabilities of any new registers. 217 217 */ 218 218 for_each_present_blessed_reg(i) { 219 - uint8_t addr[2048 / 8]; 219 + u8 addr[2048 / 8]; 220 220 struct kvm_one_reg reg = { 221 221 .id = reg_list->reg[i], 222 222 .addr = (__u64)&addr,
+2 -2
tools/testing/selftests/kvm/guest_memfd_test.c
··· 470 470 kvm_vm_free(vm); 471 471 } 472 472 473 - static void guest_code(uint8_t *mem, u64 size) 473 + static void guest_code(u8 *mem, u64 size) 474 474 { 475 475 size_t i; 476 476 ··· 494 494 495 495 struct kvm_vcpu *vcpu; 496 496 struct kvm_vm *vm; 497 - uint8_t *mem; 497 + u8 *mem; 498 498 size_t size; 499 499 int fd, i; 500 500
+7 -7
tools/testing/selftests/kvm/include/kvm_util.h
··· 214 214 215 215 struct vm_shape { 216 216 u32 type; 217 - uint8_t mode; 218 - uint8_t pad0; 217 + u8 mode; 218 + u8 pad0; 219 219 u16 pad1; 220 220 }; 221 221 ··· 475 475 void kvm_vm_elf_load(struct kvm_vm *vm, const char *filename); 476 476 int kvm_memfd_alloc(size_t size, bool hugepages); 477 477 478 - void vm_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent); 478 + void vm_dump(FILE *stream, struct kvm_vm *vm, u8 indent); 479 479 480 480 static inline void kvm_vm_get_dirty_log(struct kvm_vm *vm, int slot, void *log) 481 481 { ··· 1155 1155 void assert_on_unhandled_exception(struct kvm_vcpu *vcpu); 1156 1156 1157 1157 void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, 1158 - uint8_t indent); 1158 + u8 indent); 1159 1159 1160 1160 static inline void vcpu_dump(FILE *stream, struct kvm_vcpu *vcpu, 1161 - uint8_t indent) 1161 + u8 indent) 1162 1162 { 1163 1163 vcpu_arch_dump(stream, vcpu, indent); 1164 1164 } ··· 1263 1263 * Dumps to the FILE stream given by @stream, the contents of all the 1264 1264 * virtual translation tables for the VM given by @vm. 1265 1265 */ 1266 - void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent); 1266 + void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent); 1267 1267 1268 - static inline void virt_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent) 1268 + static inline void virt_dump(FILE *stream, struct kvm_vm *vm, u8 indent) 1269 1269 { 1270 1270 virt_arch_dump(stream, vm, indent); 1271 1271 }
+1 -1
tools/testing/selftests/kvm/include/test_util.h
··· 119 119 u32 guest_random_u32(struct guest_random_state *state); 120 120 121 121 static inline bool __guest_random_bool(struct guest_random_state *state, 122 - uint8_t percent) 122 + u8 percent) 123 123 { 124 124 return (guest_random_u32(state) % 100) < percent; 125 125 }
+3 -3
tools/testing/selftests/kvm/include/x86/apic.h
··· 99 99 return rdmsr(APIC_BASE_MSR + (reg >> 4)); 100 100 } 101 101 102 - static inline uint8_t x2apic_write_reg_safe(unsigned int reg, u64 value) 102 + static inline u8 x2apic_write_reg_safe(unsigned int reg, u64 value) 103 103 { 104 104 return wrmsr_safe(APIC_BASE_MSR + (reg >> 4), value); 105 105 } 106 106 107 107 static inline void x2apic_write_reg(unsigned int reg, u64 value) 108 108 { 109 - uint8_t fault = x2apic_write_reg_safe(reg, value); 109 + u8 fault = x2apic_write_reg_safe(reg, value); 110 110 111 111 __GUEST_ASSERT(!fault, "Unexpected fault 0x%x on WRMSR(%x) = %lx\n", 112 112 fault, APIC_BASE_MSR + (reg >> 4), value); ··· 114 114 115 115 static inline void x2apic_write_reg_fault(unsigned int reg, u64 value) 116 116 { 117 - uint8_t fault = x2apic_write_reg_safe(reg, value); 117 + u8 fault = x2apic_write_reg_safe(reg, value); 118 118 119 119 __GUEST_ASSERT(fault == GP_VECTOR, 120 120 "Wanted #GP on WRMSR(%x) = %lx, got 0x%x\n",
+5 -5
tools/testing/selftests/kvm/include/x86/hyperv.h
··· 254 254 * Issue a Hyper-V hypercall. Returns exception vector raised or 0, 'hv_status' 255 255 * is set to the hypercall status (if no exception occurred). 256 256 */ 257 - static inline uint8_t __hyperv_hypercall(u64 control, gva_t input_address, 258 - gva_t output_address, 259 - u64 *hv_status) 257 + static inline u8 __hyperv_hypercall(u64 control, gva_t input_address, 258 + gva_t output_address, 259 + u64 *hv_status) 260 260 { 261 261 u64 error_code; 262 - uint8_t vector; 262 + u8 vector; 263 263 264 264 /* Note both the hypercall and the "asm safe" clobber r9-r11. */ 265 265 asm volatile("mov %[output_address], %%r8\n\t" ··· 278 278 gva_t output_address) 279 279 { 280 280 u64 hv_status; 281 - uint8_t vector; 281 + u8 vector; 282 282 283 283 vector = __hyperv_hypercall(control, input_address, output_address, &hv_status); 284 284
+13 -14
tools/testing/selftests/kvm/include/x86/processor.h
··· 724 724 return this_cpu_vendor_string_is("HygonGenuine"); 725 725 } 726 726 727 - static inline u32 __this_cpu_has(u32 function, u32 index, 728 - uint8_t reg, uint8_t lo, uint8_t hi) 727 + static inline u32 __this_cpu_has(u32 function, u32 index, u8 reg, u8 lo, u8 hi) 729 728 { 730 729 u32 gprs[4]; 731 730 ··· 1104 1105 void vcpu_set_cpuid_property(struct kvm_vcpu *vcpu, 1105 1106 struct kvm_x86_cpu_property property, 1106 1107 u32 value); 1107 - void vcpu_set_cpuid_maxphyaddr(struct kvm_vcpu *vcpu, uint8_t maxphyaddr); 1108 + void vcpu_set_cpuid_maxphyaddr(struct kvm_vcpu *vcpu, u8 maxphyaddr); 1108 1109 1109 1110 void vcpu_clear_cpuid_entry(struct kvm_vcpu *vcpu, u32 function); 1110 1111 ··· 1261 1262 1262 1263 #define kvm_asm_safe(insn, inputs...) \ 1263 1264 ({ \ 1264 - u64 ign_error_code; \ 1265 - uint8_t vector; \ 1265 + u64 ign_error_code; \ 1266 + u8 vector; \ 1266 1267 \ 1267 1268 asm volatile(KVM_ASM_SAFE(insn) \ 1268 1269 : KVM_ASM_SAFE_OUTPUTS(vector, ign_error_code) \ ··· 1273 1274 1274 1275 #define kvm_asm_safe_ec(insn, error_code, inputs...) \ 1275 1276 ({ \ 1276 - uint8_t vector; \ 1277 + u8 vector; \ 1277 1278 \ 1278 1279 asm volatile(KVM_ASM_SAFE(insn) \ 1279 1280 : KVM_ASM_SAFE_OUTPUTS(vector, error_code) \ ··· 1284 1285 1285 1286 #define kvm_asm_safe_fep(insn, inputs...) \ 1286 1287 ({ \ 1287 - u64 ign_error_code; \ 1288 - uint8_t vector; \ 1288 + u64 ign_error_code; \ 1289 + u8 vector; \ 1289 1290 \ 1290 1291 asm volatile(KVM_ASM_SAFE_FEP(insn) \ 1291 1292 : KVM_ASM_SAFE_OUTPUTS(vector, ign_error_code) \ ··· 1296 1297 1297 1298 #define kvm_asm_safe_ec_fep(insn, error_code, inputs...) \ 1298 1299 ({ \ 1299 - uint8_t vector; \ 1300 + u8 vector; \ 1300 1301 \ 1301 1302 asm volatile(KVM_ASM_SAFE_FEP(insn) \ 1302 1303 : KVM_ASM_SAFE_OUTPUTS(vector, error_code) \ ··· 1306 1307 }) 1307 1308 1308 1309 #define BUILD_READ_U64_SAFE_HELPER(insn, _fep, _FEP) \ 1309 - static inline uint8_t insn##_safe ##_fep(u32 idx, u64 *val) \ 1310 + static inline u8 insn##_safe ##_fep(u32 idx, u64 *val) \ 1310 1311 { \ 1311 - u64 error_code; \ 1312 - uint8_t vector; \ 1312 + u64 error_code; \ 1313 + u8 vector; \ 1313 1314 u32 a, d; \ 1314 1315 \ 1315 1316 asm volatile(KVM_ASM_SAFE##_FEP(#insn) \ ··· 1334 1335 BUILD_READ_U64_SAFE_HELPERS(rdpmc) 1335 1336 BUILD_READ_U64_SAFE_HELPERS(xgetbv) 1336 1337 1337 - static inline uint8_t wrmsr_safe(u32 msr, u64 val) 1338 + static inline u8 wrmsr_safe(u32 msr, u64 val) 1338 1339 { 1339 1340 return kvm_asm_safe("wrmsr", "a"(val & -1u), "d"(val >> 32), "c"(msr)); 1340 1341 } 1341 1342 1342 - static inline uint8_t xsetbv_safe(u32 index, u64 value) 1343 + static inline u8 xsetbv_safe(u32 index, u64 value) 1343 1344 { 1344 1345 u32 eax = value; 1345 1346 u32 edx = value >> 32;
+3 -3
tools/testing/selftests/kvm/include/x86/sev.h
··· 47 47 } 48 48 49 49 void sev_vm_launch(struct kvm_vm *vm, u32 policy); 50 - void sev_vm_launch_measure(struct kvm_vm *vm, uint8_t *measurement); 50 + void sev_vm_launch_measure(struct kvm_vm *vm, u8 *measurement); 51 51 void sev_vm_launch_finish(struct kvm_vm *vm); 52 52 void snp_vm_launch_start(struct kvm_vm *vm, u64 policy); 53 53 void snp_vm_launch_update(struct kvm_vm *vm); ··· 55 55 56 56 struct kvm_vm *vm_sev_create_with_one_vcpu(u32 type, void *guest_code, 57 57 struct kvm_vcpu **cpu); 58 - void vm_sev_launch(struct kvm_vm *vm, u64 policy, uint8_t *measurement); 58 + void vm_sev_launch(struct kvm_vm *vm, u64 policy, u8 *measurement); 59 59 60 60 kvm_static_assert(SEV_RET_SUCCESS == 0); 61 61 ··· 132 132 } 133 133 134 134 static inline void snp_launch_update_data(struct kvm_vm *vm, gpa_t gpa, 135 - u64 hva, u64 size, uint8_t type) 135 + u64 hva, u64 size, u8 type) 136 136 { 137 137 struct kvm_sev_snp_launch_update update_data = { 138 138 .uaddr = hva,
+6 -6
tools/testing/selftests/kvm/include/x86/vmx.h
··· 294 294 295 295 static inline int vmxon(u64 phys) 296 296 { 297 - uint8_t ret; 297 + u8 ret; 298 298 299 299 __asm__ __volatile__ ("vmxon %[pa]; setna %[ret]" 300 300 : [ret]"=rm"(ret) ··· 311 311 312 312 static inline int vmclear(u64 vmcs_pa) 313 313 { 314 - uint8_t ret; 314 + u8 ret; 315 315 316 316 __asm__ __volatile__ ("vmclear %[pa]; setna %[ret]" 317 317 : [ret]"=rm"(ret) ··· 323 323 324 324 static inline int vmptrld(u64 vmcs_pa) 325 325 { 326 - uint8_t ret; 326 + u8 ret; 327 327 328 328 if (enable_evmcs) 329 329 return -1; ··· 339 339 static inline int vmptrst(u64 *value) 340 340 { 341 341 u64 tmp; 342 - uint8_t ret; 342 + u8 ret; 343 343 344 344 if (enable_evmcs) 345 345 return evmcs_vmptrst(value); ··· 450 450 static inline int vmread(u64 encoding, u64 *value) 451 451 { 452 452 u64 tmp; 453 - uint8_t ret; 453 + u8 ret; 454 454 455 455 if (enable_evmcs) 456 456 return evmcs_vmread(encoding, value); ··· 477 477 478 478 static inline int vmwrite(u64 encoding, u64 value) 479 479 { 480 - uint8_t ret; 480 + u8 ret; 481 481 482 482 if (enable_evmcs) 483 483 return evmcs_vmwrite(encoding, value);
+4 -4
tools/testing/selftests/kvm/lib/arm64/processor.c
··· 124 124 static void _virt_pg_map(struct kvm_vm *vm, u64 vaddr, u64 paddr, 125 125 u64 flags) 126 126 { 127 - uint8_t attr_idx = flags & (PTE_ATTRINDX_MASK >> PTE_ATTRINDX_SHIFT); 127 + u8 attr_idx = flags & (PTE_ATTRINDX_MASK >> PTE_ATTRINDX_SHIFT); 128 128 u64 pg_attr; 129 129 u64 *ptep; 130 130 ··· 237 237 return pte_addr(vm, *ptep) + (gva & (vm->page_size - 1)); 238 238 } 239 239 240 - static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, u64 page, int level) 240 + static void pte_dump(FILE *stream, struct kvm_vm *vm, u8 indent, u64 page, int level) 241 241 { 242 242 #ifdef DEBUG 243 243 static const char * const type[] = { "", "pud", "pmd", "pte" }; ··· 256 256 #endif 257 257 } 258 258 259 - void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent) 259 + void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent) 260 260 { 261 261 int level = 4 - (vm->mmu.pgtable_levels - 1); 262 262 u64 pgd, *ptep; ··· 397 397 HCR_EL2_RW | HCR_EL2_TGE | HCR_EL2_E2H); 398 398 } 399 399 400 - void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, uint8_t indent) 400 + void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, u8 indent) 401 401 { 402 402 u64 pstate, pc; 403 403
+1 -1
tools/testing/selftests/kvm/lib/guest_sprintf.c
··· 216 216 while (--field_width > 0) 217 217 APPEND_BUFFER_SAFE(str, end, ' '); 218 218 APPEND_BUFFER_SAFE(str, end, 219 - (uint8_t)va_arg(args, int)); 219 + (u8)va_arg(args, int)); 220 220 while (--field_width > 0) 221 221 APPEND_BUFFER_SAFE(str, end, ' '); 222 222 continue;
+1 -1
tools/testing/selftests/kvm/lib/kvm_util.c
··· 1951 1951 * Dumps the current state of the VM given by vm, to the FILE stream 1952 1952 * given by stream. 1953 1953 */ 1954 - void vm_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent) 1954 + void vm_dump(FILE *stream, struct kvm_vm *vm, u8 indent) 1955 1955 { 1956 1956 int ctr; 1957 1957 struct userspace_mem_region *region;
+3 -3
tools/testing/selftests/kvm/lib/loongarch/processor.c
··· 140 140 WRITE_ONCE(*ptep, paddr | prot_bits); 141 141 } 142 142 143 - static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, u64 page, int level) 143 + static void pte_dump(FILE *stream, struct kvm_vm *vm, u8 indent, u64 page, int level) 144 144 { 145 145 u64 pte, *ptep; 146 146 static const char * const type[] = { "pte", "pmd", "pud", "pgd"}; ··· 158 158 } 159 159 } 160 160 161 - void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent) 161 + void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent) 162 162 { 163 163 int level; 164 164 ··· 169 169 pte_dump(stream, vm, indent, vm->mmu.pgd, level); 170 170 } 171 171 172 - void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, uint8_t indent) 172 + void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, u8 indent) 173 173 { 174 174 } 175 175
+3 -3
tools/testing/selftests/kvm/lib/riscv/processor.c
··· 148 148 exit(1); 149 149 } 150 150 151 - static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, 151 + static void pte_dump(FILE *stream, struct kvm_vm *vm, u8 indent, 152 152 u64 page, int level) 153 153 { 154 154 #ifdef DEBUG ··· 170 170 #endif 171 171 } 172 172 173 - void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent) 173 + void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent) 174 174 { 175 175 struct kvm_mmu *mmu = &vm->mmu; 176 176 int level = mmu->pgtable_levels - 1; ··· 233 233 vcpu_set_reg(vcpu, RISCV_GENERAL_CSR_REG(satp), satp); 234 234 } 235 235 236 - void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, uint8_t indent) 236 + void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, u8 indent) 237 237 { 238 238 struct kvm_riscv_core core; 239 239
+4 -4
tools/testing/selftests/kvm/lib/s390/processor.c
··· 111 111 return (entry[idx] & ~0xffful) + (gva & 0xffful); 112 112 } 113 113 114 - static void virt_dump_ptes(FILE *stream, struct kvm_vm *vm, uint8_t indent, 114 + static void virt_dump_ptes(FILE *stream, struct kvm_vm *vm, u8 indent, 115 115 u64 ptea_start) 116 116 { 117 117 u64 *pte, ptea; ··· 125 125 } 126 126 } 127 127 128 - static void virt_dump_region(FILE *stream, struct kvm_vm *vm, uint8_t indent, 128 + static void virt_dump_region(FILE *stream, struct kvm_vm *vm, u8 indent, 129 129 u64 reg_tab_addr) 130 130 { 131 131 u64 addr, *entry; ··· 147 147 } 148 148 } 149 149 150 - void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent) 150 + void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent) 151 151 { 152 152 if (!vm->mmu.pgd_created) 153 153 return; ··· 212 212 va_end(ap); 213 213 } 214 214 215 - void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, uint8_t indent) 215 + void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, u8 indent) 216 216 { 217 217 fprintf(stream, "%*spstate: psw: 0x%.16llx:0x%.16llx\n", 218 218 indent, "", vcpu->run->psw_mask, vcpu->run->psw_addr);
+1 -1
tools/testing/selftests/kvm/lib/sparsebit.c
··· 2074 2074 { 2075 2075 s = sparsebit_alloc(); 2076 2076 for (;;) { 2077 - uint8_t op = get8() & 0xf; 2077 + u8 op = get8() & 0xf; 2078 2078 u64 first = get64(); 2079 2079 u64 last = get64(); 2080 2080
+8 -8
tools/testing/selftests/kvm/lib/x86/processor.c
··· 62 62 } 63 63 } 64 64 65 - static void regs_dump(FILE *stream, struct kvm_regs *regs, uint8_t indent) 65 + static void regs_dump(FILE *stream, struct kvm_regs *regs, u8 indent) 66 66 { 67 67 fprintf(stream, "%*srax: 0x%.16llx rbx: 0x%.16llx " 68 68 "rcx: 0x%.16llx rdx: 0x%.16llx\n", ··· 86 86 } 87 87 88 88 static void segment_dump(FILE *stream, struct kvm_segment *segment, 89 - uint8_t indent) 89 + u8 indent) 90 90 { 91 91 fprintf(stream, "%*sbase: 0x%.16llx limit: 0x%.8x " 92 92 "selector: 0x%.4x type: 0x%.2x\n", ··· 103 103 } 104 104 105 105 static void dtable_dump(FILE *stream, struct kvm_dtable *dtable, 106 - uint8_t indent) 106 + u8 indent) 107 107 { 108 108 fprintf(stream, "%*sbase: 0x%.16llx limit: 0x%.4x " 109 109 "padding: 0x%.4x 0x%.4x 0x%.4x\n", ··· 111 111 dtable->padding[0], dtable->padding[1], dtable->padding[2]); 112 112 } 113 113 114 - static void sregs_dump(FILE *stream, struct kvm_sregs *sregs, uint8_t indent) 114 + static void sregs_dump(FILE *stream, struct kvm_sregs *sregs, u8 indent) 115 115 { 116 116 unsigned int i; 117 117 ··· 407 407 return __vm_get_page_table_entry(vm, &vm->mmu, vaddr, &level); 408 408 } 409 409 410 - void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent) 410 + void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent) 411 411 { 412 412 struct kvm_mmu *mmu = &vm->mmu; 413 413 u64 *pml4e, *pml4e_start; ··· 909 909 910 910 static u32 __kvm_cpu_has(const struct kvm_cpuid2 *cpuid, 911 911 u32 function, u32 index, 912 - uint8_t reg, uint8_t lo, uint8_t hi) 912 + u8 reg, u8 lo, u8 hi) 913 913 { 914 914 const struct kvm_cpuid_entry2 *entry; 915 915 int i; ··· 1127 1127 va_end(ap); 1128 1128 } 1129 1129 1130 - void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, uint8_t indent) 1130 + void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, u8 indent) 1131 1131 { 1132 1132 struct kvm_regs regs; 1133 1133 struct kvm_sregs sregs; ··· 1378 1378 { 1379 1379 const unsigned long num_ht_pages = 12 << (30 - vm->page_shift); /* 12 GiB */ 1380 1380 unsigned long ht_gfn, max_gfn, max_pfn; 1381 - uint8_t maxphyaddr, guest_maxphyaddr; 1381 + u8 maxphyaddr, guest_maxphyaddr; 1382 1382 1383 1383 /* 1384 1384 * Use "guest MAXPHYADDR" from KVM if it's available. Guest MAXPHYADDR
+3 -3
tools/testing/selftests/kvm/lib/x86/sev.c
··· 15 15 * expression would cause us to quit the loop. 16 16 */ 17 17 static void encrypt_region(struct kvm_vm *vm, struct userspace_mem_region *region, 18 - uint8_t page_type, bool private) 18 + u8 page_type, bool private) 19 19 { 20 20 const struct sparsebit *protected_phy_pages = region->protected_phy_pages; 21 21 const gpa_t gpa_base = region->region.guest_phys_addr; ··· 103 103 vm->arch.is_pt_protected = true; 104 104 } 105 105 106 - void sev_vm_launch_measure(struct kvm_vm *vm, uint8_t *measurement) 106 + void sev_vm_launch_measure(struct kvm_vm *vm, u8 *measurement) 107 107 { 108 108 struct kvm_sev_launch_measure launch_measure; 109 109 struct kvm_sev_guest_status guest_status; ··· 174 174 return vm; 175 175 } 176 176 177 - void vm_sev_launch(struct kvm_vm *vm, u64 policy, uint8_t *measurement) 177 + void vm_sev_launch(struct kvm_vm *vm, u64 policy, u8 *measurement) 178 178 { 179 179 if (is_sev_snp_vm(vm)) { 180 180 vm_enable_cap(vm, KVM_CAP_EXIT_HYPERCALL, BIT(KVM_HC_MAP_GPA_RANGE));
+1 -1
tools/testing/selftests/kvm/memslot_perf_test.c
··· 217 217 } 218 218 219 219 base = data->hva_slots[slot]; 220 - return (uint8_t *)base + slotoffs * guest_page_size + pgoffs; 220 + return (u8 *)base + slotoffs * guest_page_size + pgoffs; 221 221 } 222 222 223 223 static u64 vm_slot2gpa(struct vm_data *data, u32 slot)
+1 -1
tools/testing/selftests/kvm/mmu_stress_test.c
··· 347 347 348 348 /* Pre-fault the memory to avoid taking mmap_sem on guest page faults. */ 349 349 for (i = 0; i < slot_size; i += vm->page_size) 350 - ((uint8_t *)mem)[i] = 0xaa; 350 + ((u8 *)mem)[i] = 0xaa; 351 351 352 352 gpa = 0; 353 353 for (slot = first_slot; slot < max_slots; slot++) {
+14 -14
tools/testing/selftests/kvm/s390/memop.c
··· 48 48 void *buf; 49 49 u32 sida_offset; 50 50 void *old; 51 - uint8_t old_value[16]; 51 + u8 old_value[16]; 52 52 bool *cmpxchg_success; 53 - uint8_t ar; 54 - uint8_t key; 53 + u8 ar; 54 + u8 key; 55 55 }; 56 56 57 - const uint8_t NO_KEY = 0xff; 57 + const u8 NO_KEY = 0xff; 58 58 59 59 static struct kvm_s390_mem_op ksmo_from_desc(struct mop_desc *desc) 60 60 { ··· 230 230 #define CR0_FETCH_PROTECTION_OVERRIDE (1UL << (63 - 38)) 231 231 #define CR0_STORAGE_PROTECTION_OVERRIDE (1UL << (63 - 39)) 232 232 233 - static uint8_t __aligned(PAGE_SIZE) mem1[65536]; 234 - static uint8_t __aligned(PAGE_SIZE) mem2[65536]; 233 + static u8 __aligned(PAGE_SIZE) mem1[65536]; 234 + static u8 __aligned(PAGE_SIZE) mem2[65536]; 235 235 236 236 struct test_default { 237 237 struct kvm_vm *kvm_vm; ··· 296 296 TEST_ASSERT(!memcmp(p1, p2, size), "Memory contents do not match!") 297 297 298 298 static void default_write_read(struct test_info copy_cpu, struct test_info mop_cpu, 299 - enum mop_target mop_target, u32 size, uint8_t key) 299 + enum mop_target mop_target, u32 size, u8 key) 300 300 { 301 301 prepare_mem12(); 302 302 CHECK_N_DO(MOP, mop_cpu, mop_target, WRITE, mem1, size, ··· 308 308 } 309 309 310 310 static void default_read(struct test_info copy_cpu, struct test_info mop_cpu, 311 - enum mop_target mop_target, u32 size, uint8_t key) 311 + enum mop_target mop_target, u32 size, u8 key) 312 312 { 313 313 prepare_mem12(); 314 314 CHECK_N_DO(MOP, mop_cpu, mop_target, WRITE, mem1, size, GADDR_V(mem1)); ··· 318 318 ASSERT_MEM_EQ(mem1, mem2, size); 319 319 } 320 320 321 - static void default_cmpxchg(struct test_default *test, uint8_t key) 321 + static void default_cmpxchg(struct test_default *test, u8 key) 322 322 { 323 323 for (int size = 1; size <= 16; size *= 2) { 324 324 for (int offset = 0; offset < 16; offset += size) { 325 - uint8_t __aligned(16) new[16] = {}; 326 - uint8_t __aligned(16) old[16]; 325 + u8 __aligned(16) new[16] = {}; 326 + u8 __aligned(16) old[16]; 327 327 bool succ; 328 328 329 329 prepare_mem12(); ··· 400 400 kvm_vm_free(t.kvm_vm); 401 401 } 402 402 403 - static void set_storage_key_range(void *addr, size_t len, uint8_t key) 403 + static void set_storage_key_range(void *addr, size_t len, u8 key) 404 404 { 405 405 uintptr_t _addr, abs, i; 406 406 int not_mapped = 0; ··· 483 483 { 484 484 switch (size) { 485 485 case 1: 486 - return (uint8_t)val; 486 + return (u8)val; 487 487 case 2: 488 488 return (u16)val; 489 489 case 4: ··· 553 553 if (swap) { 554 554 int i, j; 555 555 __uint128_t new; 556 - uint8_t byte0, byte1; 556 + u8 byte0, byte1; 557 557 558 558 rand = rand * 3 + 1; 559 559 i = rand % size;
+1 -1
tools/testing/selftests/kvm/s390/resets.c
··· 20 20 21 21 struct kvm_s390_irq buf[ARBITRARY_NON_ZERO_VCPU_ID + LOCAL_IRQS]; 22 22 23 - static uint8_t regs_null[512]; 23 + static u8 regs_null[512]; 24 24 25 25 static void guest_code_initial(void) 26 26 {
+1 -1
tools/testing/selftests/kvm/s390/shared_zeropage_test.c
··· 13 13 #include "kselftest.h" 14 14 #include "ucall_common.h" 15 15 16 - static void set_storage_key(void *addr, uint8_t skey) 16 + static void set_storage_key(void *addr, u8 skey) 17 17 { 18 18 asm volatile("sske %0,%1" : : "d" (skey), "a" (addr)); 19 19 }
+6 -6
tools/testing/selftests/kvm/s390/tprot.c
··· 14 14 #define CR0_FETCH_PROTECTION_OVERRIDE (1UL << (63 - 38)) 15 15 #define CR0_STORAGE_PROTECTION_OVERRIDE (1UL << (63 - 39)) 16 16 17 - static __aligned(PAGE_SIZE) uint8_t pages[2][PAGE_SIZE]; 18 - static uint8_t *const page_store_prot = pages[0]; 19 - static uint8_t *const page_fetch_prot = pages[1]; 17 + static __aligned(PAGE_SIZE) u8 pages[2][PAGE_SIZE]; 18 + static u8 *const page_store_prot = pages[0]; 19 + static u8 *const page_fetch_prot = pages[1]; 20 20 21 21 /* Nonzero return value indicates that address not mapped */ 22 - static int set_storage_key(void *addr, uint8_t key) 22 + static int set_storage_key(void *addr, u8 key) 23 23 { 24 24 int not_mapped = 0; 25 25 ··· 44 44 TRANSL_UNAVAIL = 3, 45 45 }; 46 46 47 - static enum permission test_protection(void *addr, uint8_t key) 47 + static enum permission test_protection(void *addr, u8 key) 48 48 { 49 49 u64 mask; 50 50 ··· 72 72 struct test { 73 73 enum stage stage; 74 74 void *addr; 75 - uint8_t key; 75 + u8 key; 76 76 enum permission expected; 77 77 } tests[] = { 78 78 /*
+1 -1
tools/testing/selftests/kvm/set_memory_region_test.c
··· 556 556 set_idt(&idt_desc); 557 557 558 558 /* Generate a #GP by dereferencing a non-canonical address */ 559 - *((uint8_t *)NONCANONICAL) = 0x1; 559 + *((u8 *)NONCANONICAL) = 0x1; 560 560 561 561 GUEST_ASSERT(0); 562 562 }
+2 -2
tools/testing/selftests/kvm/steal_time.c
··· 245 245 u32 sequence; 246 246 u32 flags; 247 247 u64 steal; 248 - uint8_t preempted; 249 - uint8_t pad[47]; 248 + u8 preempted; 249 + u8 pad[47]; 250 250 } __packed; 251 251 252 252 static void sta_set_shmem(gpa_t gpa, unsigned long flags)
+1 -1
tools/testing/selftests/kvm/x86/aperfmperf_test.c
··· 108 108 static void guest_no_aperfmperf(void) 109 109 { 110 110 u64 msr_val; 111 - uint8_t vector; 111 + u8 vector; 112 112 113 113 vector = rdmsr_safe(MSR_IA32_APERF, &msr_val); 114 114 GUEST_ASSERT(vector == GP_VECTOR);
+1 -1
tools/testing/selftests/kvm/x86/evmcs_smm_controls_test.c
··· 29 29 * SMI handler: runs in real-address mode. 30 30 * Reports SMRAM_STAGE via port IO, then does RSM. 31 31 */ 32 - static uint8_t smi_handler[] = { 32 + static u8 smi_handler[] = { 33 33 0xb0, SMRAM_STAGE, /* mov $SMRAM_STAGE, %al */ 34 34 0xe4, SYNC_PORT, /* in $SYNC_PORT, %al */ 35 35 0x0f, 0xaa, /* rsm */
+4 -4
tools/testing/selftests/kvm/x86/fastops_test.c
··· 77 77 #define guest_test_fastop_cl(insn, type_t, __val1, __val2) \ 78 78 ({ \ 79 79 type_t output = __val2, ex_output = __val2, input = __val2; \ 80 - uint8_t shift = __val1; \ 80 + u8 shift = __val1; \ 81 81 u64 flags, ex_flags; \ 82 82 \ 83 83 guest_execute_fastop_cl("", insn, shift, ex_output, ex_flags); \ ··· 95 95 #define guest_execute_fastop_div(__KVM_ASM_SAFE, insn, __a, __d, __rm, __flags) \ 96 96 ({ \ 97 97 u64 ign_error_code; \ 98 - uint8_t vector; \ 98 + u8 vector; \ 99 99 \ 100 100 __asm__ __volatile__(fastop(__KVM_ASM_SAFE(insn " %[denom]")) \ 101 101 : "+a"(__a), "+d"(__d), flags_constraint(__flags), \ ··· 110 110 type_t _a = __val1, _d = __val1, rm = __val2; \ 111 111 type_t a = _a, d = _d, ex_a = _a, ex_d = _d; \ 112 112 u64 flags, ex_flags; \ 113 - uint8_t v, ex_v; \ 113 + u8 v, ex_v; \ 114 114 \ 115 115 ex_v = guest_execute_fastop_div(KVM_ASM_SAFE, insn, ex_a, ex_d, rm, ex_flags); \ 116 116 v = guest_execute_fastop_div(KVM_ASM_SAFE_FEP, insn, a, d, rm, flags); \ ··· 185 185 186 186 static void guest_code(void) 187 187 { 188 - guest_test_fastops(uint8_t, "b"); 188 + guest_test_fastops(u8, "b"); 189 189 guest_test_fastops(u16, "w"); 190 190 guest_test_fastops(u32, "l"); 191 191 guest_test_fastops(u64, "q");
+6 -6
tools/testing/selftests/kvm/x86/fix_hypercall_test.c
··· 26 26 regs->rip += HYPERCALL_INSN_SIZE; 27 27 } 28 28 29 - static const uint8_t vmx_vmcall[HYPERCALL_INSN_SIZE] = { 0x0f, 0x01, 0xc1 }; 30 - static const uint8_t svm_vmmcall[HYPERCALL_INSN_SIZE] = { 0x0f, 0x01, 0xd9 }; 29 + static const u8 vmx_vmcall[HYPERCALL_INSN_SIZE] = { 0x0f, 0x01, 0xc1 }; 30 + static const u8 svm_vmmcall[HYPERCALL_INSN_SIZE] = { 0x0f, 0x01, 0xd9 }; 31 31 32 - extern uint8_t hypercall_insn[HYPERCALL_INSN_SIZE]; 33 - static u64 do_sched_yield(uint8_t apic_id) 32 + extern u8 hypercall_insn[HYPERCALL_INSN_SIZE]; 33 + static u64 do_sched_yield(u8 apic_id) 34 34 { 35 35 u64 ret; 36 36 ··· 45 45 46 46 static void guest_main(void) 47 47 { 48 - const uint8_t *native_hypercall_insn; 49 - const uint8_t *other_hypercall_insn; 48 + const u8 *native_hypercall_insn; 49 + const u8 *other_hypercall_insn; 50 50 u64 ret; 51 51 52 52 if (host_cpu_is_intel) {
+1 -1
tools/testing/selftests/kvm/x86/flds_emulation.h
··· 21 21 { 22 22 struct kvm_run *run = vcpu->run; 23 23 struct kvm_regs regs; 24 - uint8_t *insn_bytes; 24 + u8 *insn_bytes; 25 25 u64 flags; 26 26 27 27 TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_INTERNAL_ERROR);
+2 -2
tools/testing/selftests/kvm/x86/hyperv_features.c
··· 41 41 42 42 static void guest_msr(struct msr_data *msr) 43 43 { 44 - uint8_t vector = 0; 44 + u8 vector = 0; 45 45 u64 msr_val = 0; 46 46 47 47 GUEST_ASSERT(msr->idx); ··· 85 85 static void guest_hcall(gpa_t pgs_gpa, struct hcall_data *hcall) 86 86 { 87 87 u64 res, input, output; 88 - uint8_t vector; 88 + u8 vector; 89 89 90 90 GUEST_ASSERT_NE(hcall->control, 0); 91 91
+1 -1
tools/testing/selftests/kvm/x86/kvm_pv_test.c
··· 41 41 static void test_msr(struct msr_data *msr) 42 42 { 43 43 u64 ignored; 44 - uint8_t vector; 44 + u8 vector; 45 45 46 46 PR_MSR(msr); 47 47
+4 -4
tools/testing/selftests/kvm/x86/nested_emulation_test.c
··· 13 13 14 14 struct emulated_instruction { 15 15 const char name[32]; 16 - uint8_t opcode[15]; 16 + u8 opcode[15]; 17 17 u32 exit_reason[NR_VIRTUALIZATION_FLAVORS]; 18 18 }; 19 19 ··· 32 32 }, 33 33 }; 34 34 35 - static uint8_t kvm_fep[] = { 0x0f, 0x0b, 0x6b, 0x76, 0x6d }; /* ud2 ; .ascii "kvm" */ 36 - static uint8_t l2_guest_code[sizeof(kvm_fep) + 15]; 37 - static uint8_t *l2_instruction = &l2_guest_code[sizeof(kvm_fep)]; 35 + static u8 kvm_fep[] = { 0x0f, 0x0b, 0x6b, 0x76, 0x6d }; /* ud2 ; .ascii "kvm" */ 36 + static u8 l2_guest_code[sizeof(kvm_fep) + 15]; 37 + static u8 *l2_instruction = &l2_guest_code[sizeof(kvm_fep)]; 38 38 39 39 static u32 get_instruction_length(struct emulated_instruction *insn) 40 40 {
+1 -1
tools/testing/selftests/kvm/x86/platform_info_test.c
··· 24 24 static void guest_code(void) 25 25 { 26 26 u64 msr_platform_info; 27 - uint8_t vector; 27 + u8 vector; 28 28 29 29 GUEST_SYNC(true); 30 30 msr_platform_info = rdmsr(MSR_PLATFORM_INFO);
+30 -31
tools/testing/selftests/kvm/x86/pmu_counters_test.c
··· 32 32 /* Track which architectural events are supported by hardware. */ 33 33 static u32 hardware_pmu_arch_events; 34 34 35 - static uint8_t kvm_pmu_version; 35 + static u8 kvm_pmu_version; 36 36 static bool kvm_has_perf_caps; 37 37 38 38 #define X86_PMU_FEATURE_NULL \ ··· 57 57 * kvm_x86_pmu_feature use syntax that's only valid in function scope, and the 58 58 * compiler often thinks the feature definitions aren't compile-time constants. 59 59 */ 60 - static struct kvm_intel_pmu_event intel_event_to_feature(uint8_t idx) 60 + static struct kvm_intel_pmu_event intel_event_to_feature(u8 idx) 61 61 { 62 62 const struct kvm_intel_pmu_event __intel_event_to_feature[] = { 63 63 [INTEL_ARCH_CPU_CYCLES_INDEX] = { X86_PMU_FEATURE_CPU_CYCLES, X86_PMU_FEATURE_CPU_CYCLES_FIXED }, ··· 89 89 90 90 static struct kvm_vm *pmu_vm_create_with_one_vcpu(struct kvm_vcpu **vcpu, 91 91 void *guest_code, 92 - uint8_t pmu_version, 92 + u8 pmu_version, 93 93 u64 perf_capabilities) 94 94 { 95 95 struct kvm_vm *vm; ··· 132 132 } while (uc.cmd != UCALL_DONE); 133 133 } 134 134 135 - static uint8_t guest_get_pmu_version(void) 135 + static u8 guest_get_pmu_version(void) 136 136 { 137 137 /* 138 138 * Return the effective PMU version, i.e. the minimum between what KVM ··· 141 141 * supported by KVM to verify KVM doesn't freak out and do something 142 142 * bizarre with an architecturally valid, but unsupported, version. 143 143 */ 144 - return min_t(uint8_t, kvm_pmu_version, this_cpu_property(X86_PROPERTY_PMU_VERSION)); 144 + return min_t(u8, kvm_pmu_version, this_cpu_property(X86_PROPERTY_PMU_VERSION)); 145 145 } 146 146 147 147 /* ··· 153 153 * Sanity check that in all cases, the event doesn't count when it's disabled, 154 154 * and that KVM correctly emulates the write of an arbitrary value. 155 155 */ 156 - static void guest_assert_event_count(uint8_t idx, u32 pmc, u32 pmc_msr) 156 + static void guest_assert_event_count(u8 idx, u32 pmc, u32 pmc_msr) 157 157 { 158 158 u64 count; 159 159 ··· 255 255 guest_assert_event_count(_idx, _pmc, _pmc_msr); \ 256 256 } while (0) 257 257 258 - static void __guest_test_arch_event(uint8_t idx, u32 pmc, u32 pmc_msr, 258 + static void __guest_test_arch_event(u8 idx, u32 pmc, u32 pmc_msr, 259 259 u32 ctrl_msr, u64 ctrl_msr_value) 260 260 { 261 261 GUEST_TEST_EVENT(idx, pmc, pmc_msr, ctrl_msr, ctrl_msr_value, ""); ··· 264 264 GUEST_TEST_EVENT(idx, pmc, pmc_msr, ctrl_msr, ctrl_msr_value, KVM_FEP); 265 265 } 266 266 267 - static void guest_test_arch_event(uint8_t idx) 267 + static void guest_test_arch_event(u8 idx) 268 268 { 269 269 u32 nr_gp_counters = this_cpu_property(X86_PROPERTY_PMU_NR_GP_COUNTERS); 270 270 u32 pmu_version = guest_get_pmu_version(); ··· 320 320 321 321 static void guest_test_arch_events(void) 322 322 { 323 - uint8_t i; 323 + u8 i; 324 324 325 325 for (i = 0; i < NR_INTEL_ARCH_EVENTS; i++) 326 326 guest_test_arch_event(i); ··· 328 328 GUEST_DONE(); 329 329 } 330 330 331 - static void test_arch_events(uint8_t pmu_version, u64 perf_capabilities, 332 - uint8_t length, u32 unavailable_mask) 331 + static void test_arch_events(u8 pmu_version, u64 perf_capabilities, 332 + u8 length, u32 unavailable_mask) 333 333 { 334 334 struct kvm_vcpu *vcpu; 335 335 struct kvm_vm *vm; ··· 376 376 static void guest_test_rdpmc(u32 rdpmc_idx, bool expect_success, 377 377 u64 expected_val) 378 378 { 379 - uint8_t vector; 379 + u8 vector; 380 380 u64 val; 381 381 382 382 vector = rdpmc_safe(rdpmc_idx, &val); ··· 393 393 GUEST_ASSERT_PMC_VALUE(RDPMC, rdpmc_idx, val, expected_val); 394 394 } 395 395 396 - static void guest_rd_wr_counters(u32 base_msr, uint8_t nr_possible_counters, 397 - uint8_t nr_counters, u32 or_mask) 396 + static void guest_rd_wr_counters(u32 base_msr, u8 nr_possible_counters, 397 + u8 nr_counters, u32 or_mask) 398 398 { 399 399 const bool pmu_has_fast_mode = !guest_get_pmu_version(); 400 - uint8_t i; 400 + u8 i; 401 401 402 402 for (i = 0; i < nr_possible_counters; i++) { 403 403 /* ··· 422 422 const bool expect_gp = !expect_success && msr != MSR_P6_PERFCTR0 && 423 423 msr != MSR_P6_PERFCTR1; 424 424 u32 rdpmc_idx; 425 - uint8_t vector; 425 + u8 vector; 426 426 u64 val; 427 427 428 428 vector = wrmsr_safe(msr, test_val); ··· 461 461 462 462 static void guest_test_gp_counters(void) 463 463 { 464 - uint8_t pmu_version = guest_get_pmu_version(); 465 - uint8_t nr_gp_counters = 0; 464 + u8 pmu_version = guest_get_pmu_version(); 465 + u8 nr_gp_counters = 0; 466 466 u32 base_msr; 467 467 468 468 if (pmu_version) ··· 495 495 GUEST_DONE(); 496 496 } 497 497 498 - static void test_gp_counters(uint8_t pmu_version, u64 perf_capabilities, 499 - uint8_t nr_gp_counters) 498 + static void test_gp_counters(u8 pmu_version, u64 perf_capabilities, 499 + u8 nr_gp_counters) 500 500 { 501 501 struct kvm_vcpu *vcpu; 502 502 struct kvm_vm *vm; ··· 515 515 static void guest_test_fixed_counters(void) 516 516 { 517 517 u64 supported_bitmask = 0; 518 - uint8_t nr_fixed_counters = 0; 519 - uint8_t i; 518 + u8 nr_fixed_counters = 0; 519 + u8 i; 520 520 521 521 /* Fixed counters require Architectural vPMU Version 2+. */ 522 522 if (guest_get_pmu_version() >= 2) ··· 533 533 nr_fixed_counters, supported_bitmask); 534 534 535 535 for (i = 0; i < MAX_NR_FIXED_COUNTERS; i++) { 536 - uint8_t vector; 536 + u8 vector; 537 537 u64 val; 538 538 539 539 if (i >= nr_fixed_counters && !(supported_bitmask & BIT_ULL(i))) { ··· 561 561 GUEST_DONE(); 562 562 } 563 563 564 - static void test_fixed_counters(uint8_t pmu_version, u64 perf_capabilities, 565 - uint8_t nr_fixed_counters, 566 - u32 supported_bitmask) 564 + static void test_fixed_counters(u8 pmu_version, u64 perf_capabilities, 565 + u8 nr_fixed_counters, u32 supported_bitmask) 567 566 { 568 567 struct kvm_vcpu *vcpu; 569 568 struct kvm_vm *vm; ··· 582 583 583 584 static void test_intel_counters(void) 584 585 { 585 - uint8_t nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS); 586 - uint8_t nr_gp_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_GP_COUNTERS); 587 - uint8_t pmu_version = kvm_cpu_property(X86_PROPERTY_PMU_VERSION); 586 + u8 nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS); 587 + u8 nr_gp_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_GP_COUNTERS); 588 + u8 pmu_version = kvm_cpu_property(X86_PROPERTY_PMU_VERSION); 588 589 unsigned int i; 589 - uint8_t v, j; 590 + u8 v, j; 590 591 u32 k; 591 592 592 593 const u64 perf_caps[] = { ··· 619 620 * Intel, i.e. is the last version that is guaranteed to be backwards 620 621 * compatible with KVM's existing behavior. 621 622 */ 622 - uint8_t max_pmu_version = max_t(typeof(pmu_version), pmu_version, 5); 623 + u8 max_pmu_version = max_t(typeof(pmu_version), pmu_version, 5); 623 624 624 625 /* 625 626 * Detect the existence of events that aren't supported by selftests.
+6 -6
tools/testing/selftests/kvm/x86/pmu_event_filter_test.c
··· 685 685 686 686 static void test_filter_ioctl(struct kvm_vcpu *vcpu) 687 687 { 688 - uint8_t nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS); 688 + u8 nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS); 689 689 struct __kvm_pmu_event_filter f; 690 690 u64 e = ~0ul; 691 691 int r; ··· 729 729 TEST_ASSERT(!r, "Masking non-existent fixed counters should be allowed"); 730 730 } 731 731 732 - static void intel_run_fixed_counter_guest_code(uint8_t idx) 732 + static void intel_run_fixed_counter_guest_code(u8 idx) 733 733 { 734 734 for (;;) { 735 735 wrmsr(MSR_CORE_PERF_GLOBAL_CTRL, 0); ··· 770 770 return run_vcpu_to_sync(vcpu); 771 771 } 772 772 773 - static void __test_fixed_counter_bitmap(struct kvm_vcpu *vcpu, uint8_t idx, 774 - uint8_t nr_fixed_counters) 773 + static void __test_fixed_counter_bitmap(struct kvm_vcpu *vcpu, u8 idx, 774 + u8 nr_fixed_counters) 775 775 { 776 776 unsigned int i; 777 777 u32 bitmap; ··· 815 815 816 816 static void test_fixed_counter_bitmap(void) 817 817 { 818 - uint8_t nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS); 818 + u8 nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS); 819 819 struct kvm_vm *vm; 820 820 struct kvm_vcpu *vcpu; 821 - uint8_t idx; 821 + u8 idx; 822 822 823 823 /* 824 824 * Check that pmu_event_filter works as expected when it's applied to
+12 -12
tools/testing/selftests/kvm/x86/private_mem_conversions_test.c
··· 29 29 /* Horrific macro so that the line info is captured accurately :-( */ 30 30 #define memcmp_g(gpa, pattern, size) \ 31 31 do { \ 32 - uint8_t *mem = (uint8_t *)gpa; \ 32 + u8 *mem = (u8 *)gpa; \ 33 33 size_t i; \ 34 34 \ 35 35 for (i = 0; i < size; i++) \ ··· 38 38 pattern, i, gpa + i, mem[i]); \ 39 39 } while (0) 40 40 41 - static void memcmp_h(uint8_t *mem, u64 gpa, uint8_t pattern, size_t size) 41 + static void memcmp_h(u8 *mem, u64 gpa, u8 pattern, size_t size) 42 42 { 43 43 size_t i; 44 44 ··· 71 71 }; 72 72 73 73 static void guest_sync_shared(u64 gpa, u64 size, 74 - uint8_t current_pattern, uint8_t new_pattern) 74 + u8 current_pattern, u8 new_pattern) 75 75 { 76 76 GUEST_SYNC5(SYNC_SHARED, gpa, size, current_pattern, new_pattern); 77 77 } 78 78 79 - static void guest_sync_private(u64 gpa, u64 size, uint8_t pattern) 79 + static void guest_sync_private(u64 gpa, u64 size, u8 pattern) 80 80 { 81 81 GUEST_SYNC4(SYNC_PRIVATE, gpa, size, pattern); 82 82 } ··· 121 121 122 122 static void guest_test_explicit_conversion(u64 base_gpa, bool do_fallocate) 123 123 { 124 - const uint8_t def_p = 0xaa; 125 - const uint8_t init_p = 0xcc; 124 + const u8 def_p = 0xaa; 125 + const u8 init_p = 0xcc; 126 126 u64 j; 127 127 int i; 128 128 ··· 136 136 for (i = 0; i < ARRAY_SIZE(test_ranges); i++) { 137 137 u64 gpa = base_gpa + test_ranges[i].offset; 138 138 u64 size = test_ranges[i].size; 139 - uint8_t p1 = 0x11; 140 - uint8_t p2 = 0x22; 141 - uint8_t p3 = 0x33; 142 - uint8_t p4 = 0x44; 139 + u8 p1 = 0x11; 140 + u8 p2 = 0x22; 141 + u8 p3 = 0x33; 142 + u8 p4 = 0x44; 143 143 144 144 /* 145 145 * Set the test region to pattern one to differentiate it from ··· 229 229 */ 230 230 static void guest_test_punch_hole(u64 base_gpa, bool precise) 231 231 { 232 - const uint8_t init_p = 0xcc; 232 + const u8 init_p = 0xcc; 233 233 int i; 234 234 235 235 /* ··· 347 347 348 348 for (i = 0; i < size; i += vm->page_size) { 349 349 size_t nr_bytes = min_t(size_t, vm->page_size, size - i); 350 - uint8_t *hva = addr_gpa2hva(vm, gpa + i); 350 + u8 *hva = addr_gpa2hva(vm, gpa + i); 351 351 352 352 /* In all cases, the host should observe the shared data. */ 353 353 memcmp_h(hva, gpa + i, uc.args[3], nr_bytes);
+1 -1
tools/testing/selftests/kvm/x86/smm_test.c
··· 34 34 * independent subset of asm here. 35 35 * SMI handler always report back fixed stage SMRAM_STAGE. 36 36 */ 37 - uint8_t smi_handler[] = { 37 + u8 smi_handler[] = { 38 38 0xb0, SMRAM_STAGE, /* mov $SMRAM_STAGE, %al */ 39 39 0xe4, SYNC_PORT, /* in $SYNC_PORT, %al */ 40 40 0x0f, 0xaa, /* rsm */
+2 -2
tools/testing/selftests/kvm/x86/state_test.c
··· 145 145 146 146 if (this_cpu_has(X86_FEATURE_XSAVE)) { 147 147 u64 supported_xcr0 = this_cpu_supported_xcr0(); 148 - uint8_t buffer[PAGE_SIZE]; 148 + u8 buffer[PAGE_SIZE]; 149 149 150 150 memset(buffer, 0xcc, sizeof(buffer)); 151 151 ··· 331 331 * supported features, even if something goes awry in saving 332 332 * the original snapshot. 333 333 */ 334 - xstate_bv = (void *)&((uint8_t *)state->xsave->region)[512]; 334 + xstate_bv = (void *)&((u8 *)state->xsave->region)[512]; 335 335 saved_xstate_bv = *xstate_bv; 336 336 337 337 vcpuN = __vm_vcpu_add(vm, vcpu->id + 1);
+2 -2
tools/testing/selftests/kvm/x86/userspace_io_test.c
··· 10 10 #include "kvm_util.h" 11 11 #include "processor.h" 12 12 13 - static void guest_ins_port80(uint8_t *buffer, unsigned int count) 13 + static void guest_ins_port80(u8 *buffer, unsigned int count) 14 14 { 15 15 unsigned long end; 16 16 ··· 26 26 27 27 static void guest_code(void) 28 28 { 29 - uint8_t buffer[8192]; 29 + u8 buffer[8192]; 30 30 int i; 31 31 32 32 /*
+7 -7
tools/testing/selftests/kvm/x86/userspace_msr_exit_test.c
··· 23 23 .nmsrs = 1, 24 24 /* Test an MSR the kernel knows about. */ 25 25 .base = MSR_IA32_XSS, 26 - .bitmap = (uint8_t*)&deny_bits, 26 + .bitmap = (u8 *)&deny_bits, 27 27 }, { 28 28 .flags = KVM_MSR_FILTER_READ | 29 29 KVM_MSR_FILTER_WRITE, 30 30 .nmsrs = 1, 31 31 /* Test an MSR the kernel doesn't know about. */ 32 32 .base = MSR_IA32_FLUSH_CMD, 33 - .bitmap = (uint8_t*)&deny_bits, 33 + .bitmap = (u8 *)&deny_bits, 34 34 }, { 35 35 .flags = KVM_MSR_FILTER_READ | 36 36 KVM_MSR_FILTER_WRITE, 37 37 .nmsrs = 1, 38 38 /* Test a fabricated MSR that no one knows about. */ 39 39 .base = MSR_NON_EXISTENT, 40 - .bitmap = (uint8_t*)&deny_bits, 40 + .bitmap = (u8 *)&deny_bits, 41 41 }, 42 42 }, 43 43 }; ··· 49 49 .flags = KVM_MSR_FILTER_READ, 50 50 .nmsrs = 1, 51 51 .base = MSR_FS_BASE, 52 - .bitmap = (uint8_t*)&deny_bits, 52 + .bitmap = (u8 *)&deny_bits, 53 53 }, 54 54 }, 55 55 }; ··· 61 61 .flags = KVM_MSR_FILTER_READ, 62 62 .nmsrs = 1, 63 63 .base = MSR_GS_BASE, 64 - .bitmap = (uint8_t*)&deny_bits, 64 + .bitmap = (u8 *)&deny_bits, 65 65 }, 66 66 }, 67 67 }; ··· 77 77 static u8 bitmap_c0000000_read[KVM_MSR_FILTER_MAX_BITMAP_SIZE]; 78 78 static u8 bitmap_deadbeef[1] = { 0x1 }; 79 79 80 - static void deny_msr(uint8_t *bitmap, u32 msr) 80 + static void deny_msr(u8 *bitmap, u32 msr) 81 81 { 82 82 u32 idx = msr & (KVM_MSR_FILTER_MAX_BITMAP_SIZE - 1); 83 83 ··· 732 732 .flags = KVM_MSR_FILTER_READ, 733 733 .nmsrs = 1, 734 734 .base = 0, 735 - .bitmap = (uint8_t *)&deny_bits, 735 + .bitmap = (u8 *)&deny_bits, 736 736 }, 737 737 }, 738 738 };
+1 -1
tools/testing/selftests/kvm/x86/vmx_pmu_caps_test.c
··· 54 54 55 55 static void guest_test_perf_capabilities_gp(u64 val) 56 56 { 57 - uint8_t vector = wrmsr_safe(MSR_IA32_PERF_CAPABILITIES, val); 57 + u8 vector = wrmsr_safe(MSR_IA32_PERF_CAPABILITIES, val); 58 58 59 59 __GUEST_ASSERT(vector == GP_VECTOR, 60 60 "Expected #GP for value '0x%lx', got %s",
+8 -8
tools/testing/selftests/kvm/x86/xapic_tpr_test.c
··· 69 69 } 70 70 } 71 71 72 - static uint8_t tpr_guest_tpr_get(void) 72 + static u8 tpr_guest_tpr_get(void) 73 73 { 74 74 u32 taskpri; 75 75 ··· 81 81 return GET_APIC_PRI(taskpri); 82 82 } 83 83 84 - static uint8_t tpr_guest_ppr_get(void) 84 + static u8 tpr_guest_ppr_get(void) 85 85 { 86 86 u32 procpri; 87 87 ··· 93 93 return GET_APIC_PRI(procpri); 94 94 } 95 95 96 - static uint8_t tpr_guest_cr8_get(void) 96 + static u8 tpr_guest_cr8_get(void) 97 97 { 98 98 u64 cr8; 99 99 ··· 104 104 105 105 static void tpr_guest_check_tpr_ppr_cr8_equal(void) 106 106 { 107 - uint8_t tpr; 107 + u8 tpr; 108 108 109 109 tpr = tpr_guest_tpr_get(); 110 110 ··· 157 157 GUEST_DONE(); 158 158 } 159 159 160 - static uint8_t lapic_tpr_get(struct kvm_lapic_state *xapic) 160 + static u8 lapic_tpr_get(struct kvm_lapic_state *xapic) 161 161 { 162 162 return GET_APIC_PRI(*((u32 *)&xapic->regs[APIC_TASKPRI])); 163 163 } 164 164 165 - static void lapic_tpr_set(struct kvm_lapic_state *xapic, uint8_t val) 165 + static void lapic_tpr_set(struct kvm_lapic_state *xapic, u8 val) 166 166 { 167 167 u32 *taskpri = (u32 *)&xapic->regs[APIC_TASKPRI]; 168 168 169 169 *taskpri = SET_APIC_PRI(*taskpri, val); 170 170 } 171 171 172 - static uint8_t sregs_tpr(struct kvm_sregs *sregs) 172 + static u8 sregs_tpr(struct kvm_sregs *sregs) 173 173 { 174 174 return sregs->cr8 & GENMASK(3, 0); 175 175 } ··· 197 197 static void test_tpr_set_tpr_for_irq(struct kvm_vcpu *vcpu, bool mask) 198 198 { 199 199 struct kvm_lapic_state xapic; 200 - uint8_t tpr; 200 + u8 tpr; 201 201 202 202 static_assert(IRQ_VECTOR >= 16, "invalid IRQ vector number"); 203 203 tpr = IRQ_VECTOR / 16;
+2 -2
tools/testing/selftests/kvm/x86/xen_shinfo_test.c
··· 133 133 }; 134 134 135 135 struct vcpu_info { 136 - uint8_t evtchn_upcall_pending; 137 - uint8_t evtchn_upcall_mask; 136 + u8 evtchn_upcall_pending; 137 + u8 evtchn_upcall_mask; 138 138 unsigned long evtchn_pending_sel; 139 139 struct arch_vcpu_info arch; 140 140 struct pvclock_vcpu_time_info time;