]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: selftests: Use u8 instead of uint8_t
authorDavid Matlack <dmatlack@google.com>
Mon, 20 Apr 2026 21:19:55 +0000 (14:19 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 20 Apr 2026 21:54:17 +0000 (14:54 -0700)
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>
49 files changed:
tools/testing/selftests/kvm/arm64/debug-exceptions.c
tools/testing/selftests/kvm/arm64/set_id_regs.c
tools/testing/selftests/kvm/arm64/vpmu_counter_access.c
tools/testing/selftests/kvm/coalesced_io_test.c
tools/testing/selftests/kvm/get-reg-list.c
tools/testing/selftests/kvm/guest_memfd_test.c
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/include/test_util.h
tools/testing/selftests/kvm/include/x86/apic.h
tools/testing/selftests/kvm/include/x86/hyperv.h
tools/testing/selftests/kvm/include/x86/processor.h
tools/testing/selftests/kvm/include/x86/sev.h
tools/testing/selftests/kvm/include/x86/vmx.h
tools/testing/selftests/kvm/lib/arm64/processor.c
tools/testing/selftests/kvm/lib/guest_sprintf.c
tools/testing/selftests/kvm/lib/kvm_util.c
tools/testing/selftests/kvm/lib/loongarch/processor.c
tools/testing/selftests/kvm/lib/riscv/processor.c
tools/testing/selftests/kvm/lib/s390/processor.c
tools/testing/selftests/kvm/lib/sparsebit.c
tools/testing/selftests/kvm/lib/x86/processor.c
tools/testing/selftests/kvm/lib/x86/sev.c
tools/testing/selftests/kvm/memslot_perf_test.c
tools/testing/selftests/kvm/mmu_stress_test.c
tools/testing/selftests/kvm/s390/memop.c
tools/testing/selftests/kvm/s390/resets.c
tools/testing/selftests/kvm/s390/shared_zeropage_test.c
tools/testing/selftests/kvm/s390/tprot.c
tools/testing/selftests/kvm/set_memory_region_test.c
tools/testing/selftests/kvm/steal_time.c
tools/testing/selftests/kvm/x86/aperfmperf_test.c
tools/testing/selftests/kvm/x86/evmcs_smm_controls_test.c
tools/testing/selftests/kvm/x86/fastops_test.c
tools/testing/selftests/kvm/x86/fix_hypercall_test.c
tools/testing/selftests/kvm/x86/flds_emulation.h
tools/testing/selftests/kvm/x86/hyperv_features.c
tools/testing/selftests/kvm/x86/kvm_pv_test.c
tools/testing/selftests/kvm/x86/nested_emulation_test.c
tools/testing/selftests/kvm/x86/platform_info_test.c
tools/testing/selftests/kvm/x86/pmu_counters_test.c
tools/testing/selftests/kvm/x86/pmu_event_filter_test.c
tools/testing/selftests/kvm/x86/private_mem_conversions_test.c
tools/testing/selftests/kvm/x86/smm_test.c
tools/testing/selftests/kvm/x86/state_test.c
tools/testing/selftests/kvm/x86/userspace_io_test.c
tools/testing/selftests/kvm/x86/userspace_msr_exit_test.c
tools/testing/selftests/kvm/x86/vmx_pmu_caps_test.c
tools/testing/selftests/kvm/x86/xapic_tpr_test.c
tools/testing/selftests/kvm/x86/xen_shinfo_test.c

index 5931915ea00a19dfa681af7bbda526c97614f43b..3eb4b1b6682dcaa5a7549ab075fe7837e34b532b 100644 (file)
@@ -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 */
index 8bf9c717b698b8f71a3e5b1c5ef1e3ec43714c50..8bb53dd4f32186d879257b7bd0513091ae22130e 100644 (file)
@@ -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;
index 4ceab07604471ecc1bc46951f14b44b086ff0570..22223395969e0f8d97796d86d030a996b61e7179 100644 (file)
@@ -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,
index f5ab412d2042831c6f52d46fcdec9b6fca4ec3dc..df4ed5e3877c11aa89fd9232d225d628dbf6f7a1 100644 (file)
@@ -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;
index f4644c9d2d3b42cf24f6e595496dabe477f815b3..216f10644c1aa6f8bd7a707b547fe08841e84bee 100644 (file)
@@ -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,
index ad17ea62555f5ddd59d28ecbd2e092f39872e1ff..9cbd3ad7f44a791eb8280949dc64e3b0938d5e5d 100644 (file)
@@ -470,7 +470,7 @@ static void test_guest_memfd(unsigned long vm_type)
        kvm_vm_free(vm);
 }
 
-static void guest_code(uint8_t *mem, u64 size)
+static void guest_code(u8 *mem, u64 size)
 {
        size_t i;
 
@@ -494,7 +494,7 @@ static void test_guest_memfd_guest(void)
 
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
-       uint8_t *mem;
+       u8 *mem;
        size_t size;
        int fd, i;
 
index 34c8a7d949976f4cc1e2104ba993115793d56a4e..676e3ccb1462cd5869cc6621d81b6b258ea8f299 100644 (file)
@@ -214,8 +214,8 @@ enum vm_guest_mode {
 
 struct vm_shape {
        u32 type;
-       uint8_t  mode;
-       uint8_t  pad0;
+       u8  mode;
+       u8  pad0;
        u16 pad1;
 };
 
@@ -475,7 +475,7 @@ void kvm_vm_release(struct kvm_vm *vmp);
 void kvm_vm_elf_load(struct kvm_vm *vm, const char *filename);
 int kvm_memfd_alloc(size_t size, bool hugepages);
 
-void vm_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent);
+void vm_dump(FILE *stream, struct kvm_vm *vm, u8 indent);
 
 static inline void kvm_vm_get_dirty_log(struct kvm_vm *vm, int slot, void *log)
 {
@@ -1155,10 +1155,10 @@ vm_adjust_num_guest_pages(enum vm_guest_mode mode, unsigned int num_guest_pages)
 void assert_on_unhandled_exception(struct kvm_vcpu *vcpu);
 
 void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu,
-                   uint8_t indent);
+                   u8 indent);
 
 static inline void vcpu_dump(FILE *stream, struct kvm_vcpu *vcpu,
-                            uint8_t indent)
+                            u8 indent)
 {
        vcpu_arch_dump(stream, vcpu, indent);
 }
@@ -1263,9 +1263,9 @@ static inline gpa_t addr_gva2gpa(struct kvm_vm *vm, gva_t gva)
  * Dumps to the FILE stream given by @stream, the contents of all the
  * virtual translation tables for the VM given by @vm.
  */
-void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent);
+void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent);
 
-static inline void virt_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent)
+static inline void virt_dump(FILE *stream, struct kvm_vm *vm, u8 indent)
 {
        virt_arch_dump(stream, vm, indent);
 }
index fb24347c6e6c1a2b61c73df136aca5680393cece..d9b433b834f1b6e53e681d6172843790b5b7e0df 100644 (file)
@@ -119,7 +119,7 @@ struct guest_random_state new_guest_random_state(u32 seed);
 u32 guest_random_u32(struct guest_random_state *state);
 
 static inline bool __guest_random_bool(struct guest_random_state *state,
-                                      uint8_t percent)
+                                      u8 percent)
 {
        return (guest_random_u32(state) % 100) < percent;
 }
index 74eaa3bd335d82fccea0056ef03fac3db49a6e0a..31887bdc3d6c407cc71c3a2e7142a312eee034b1 100644 (file)
@@ -99,14 +99,14 @@ static inline u64 x2apic_read_reg(unsigned int reg)
        return rdmsr(APIC_BASE_MSR + (reg >> 4));
 }
 
-static inline uint8_t x2apic_write_reg_safe(unsigned int reg, u64 value)
+static inline u8 x2apic_write_reg_safe(unsigned int reg, u64 value)
 {
        return wrmsr_safe(APIC_BASE_MSR + (reg >> 4), value);
 }
 
 static inline void x2apic_write_reg(unsigned int reg, u64 value)
 {
-       uint8_t fault = x2apic_write_reg_safe(reg, value);
+       u8 fault = x2apic_write_reg_safe(reg, value);
 
        __GUEST_ASSERT(!fault, "Unexpected fault 0x%x on WRMSR(%x) = %lx\n",
                       fault, APIC_BASE_MSR + (reg >> 4), value);
@@ -114,7 +114,7 @@ static inline void x2apic_write_reg(unsigned int reg, u64 value)
 
 static inline void x2apic_write_reg_fault(unsigned int reg, u64 value)
 {
-       uint8_t fault = x2apic_write_reg_safe(reg, value);
+       u8 fault = x2apic_write_reg_safe(reg, value);
 
        __GUEST_ASSERT(fault == GP_VECTOR,
                       "Wanted #GP on WRMSR(%x) = %lx, got 0x%x\n",
index 2add2123e37b70497455825618eeb843dfe783f1..78003f5a22f3964ed39b8a51f6120a30e33c7762 100644 (file)
  * Issue a Hyper-V hypercall. Returns exception vector raised or 0, 'hv_status'
  * is set to the hypercall status (if no exception occurred).
  */
-static inline uint8_t __hyperv_hypercall(u64 control, gva_t input_address,
-                                        gva_t output_address,
-                                        u64 *hv_status)
+static inline u8 __hyperv_hypercall(u64 control, gva_t input_address,
+                                   gva_t output_address,
+                                   u64 *hv_status)
 {
        u64 error_code;
-       uint8_t vector;
+       u8 vector;
 
        /* Note both the hypercall and the "asm safe" clobber r9-r11. */
        asm volatile("mov %[output_address], %%r8\n\t"
@@ -278,7 +278,7 @@ static inline void hyperv_hypercall(u64 control, gva_t input_address,
                                    gva_t output_address)
 {
        u64 hv_status;
-       uint8_t vector;
+       u8 vector;
 
        vector = __hyperv_hypercall(control, input_address, output_address, &hv_status);
 
index 8700d37a572702cf440255c8324ac4cdce5b7561..4efa6c9421924251697e6d8c3b8a8178ee2a760f 100644 (file)
@@ -724,8 +724,7 @@ static inline bool this_cpu_is_hygon(void)
        return this_cpu_vendor_string_is("HygonGenuine");
 }
 
-static inline u32 __this_cpu_has(u32 function, u32 index,
-                                uint8_t reg, uint8_t lo, uint8_t hi)
+static inline u32 __this_cpu_has(u32 function, u32 index, u8 reg, u8 lo, u8 hi)
 {
        u32 gprs[4];
 
@@ -1105,7 +1104,7 @@ static inline void vcpu_set_cpuid(struct kvm_vcpu *vcpu)
 void vcpu_set_cpuid_property(struct kvm_vcpu *vcpu,
                             struct kvm_x86_cpu_property property,
                             u32 value);
-void vcpu_set_cpuid_maxphyaddr(struct kvm_vcpu *vcpu, uint8_t maxphyaddr);
+void vcpu_set_cpuid_maxphyaddr(struct kvm_vcpu *vcpu, u8 maxphyaddr);
 
 void vcpu_clear_cpuid_entry(struct kvm_vcpu *vcpu, u32 function);
 
@@ -1262,8 +1261,8 @@ void vm_install_exception_handler(struct kvm_vm *vm, int vector,
 
 #define kvm_asm_safe(insn, inputs...)                                  \
 ({                                                                     \
-       u64 ign_error_code;                                     \
-       uint8_t vector;                                                 \
+       u64 ign_error_code;                                             \
+       u8 vector;                                                      \
                                                                        \
        asm volatile(KVM_ASM_SAFE(insn)                                 \
                     : KVM_ASM_SAFE_OUTPUTS(vector, ign_error_code)     \
@@ -1274,7 +1273,7 @@ void vm_install_exception_handler(struct kvm_vm *vm, int vector,
 
 #define kvm_asm_safe_ec(insn, error_code, inputs...)                   \
 ({                                                                     \
-       uint8_t vector;                                                 \
+       u8 vector;                                                      \
                                                                        \
        asm volatile(KVM_ASM_SAFE(insn)                                 \
                     : KVM_ASM_SAFE_OUTPUTS(vector, error_code)         \
@@ -1285,8 +1284,8 @@ void vm_install_exception_handler(struct kvm_vm *vm, int vector,
 
 #define kvm_asm_safe_fep(insn, inputs...)                              \
 ({                                                                     \
-       u64 ign_error_code;                                     \
-       uint8_t vector;                                                 \
+       u64 ign_error_code;                                             \
+       u8 vector;                                                      \
                                                                        \
        asm volatile(KVM_ASM_SAFE_FEP(insn)                             \
                     : KVM_ASM_SAFE_OUTPUTS(vector, ign_error_code)     \
@@ -1297,7 +1296,7 @@ void vm_install_exception_handler(struct kvm_vm *vm, int vector,
 
 #define kvm_asm_safe_ec_fep(insn, error_code, inputs...)               \
 ({                                                                     \
-       uint8_t vector;                                                 \
+       u8 vector;                                                      \
                                                                        \
        asm volatile(KVM_ASM_SAFE_FEP(insn)                             \
                     : KVM_ASM_SAFE_OUTPUTS(vector, error_code)         \
@@ -1307,10 +1306,10 @@ void vm_install_exception_handler(struct kvm_vm *vm, int vector,
 })
 
 #define BUILD_READ_U64_SAFE_HELPER(insn, _fep, _FEP)                   \
-static inline uint8_t insn##_safe ##_fep(u32 idx, u64 *val)    \
+static inline u8 insn##_safe ##_fep(u32 idx, u64 *val)                 \
 {                                                                      \
-       u64 error_code;                                         \
-       uint8_t vector;                                                 \
+       u64 error_code;                                                 \
+       u8 vector;                                                      \
        u32 a, d;                                                       \
                                                                        \
        asm volatile(KVM_ASM_SAFE##_FEP(#insn)                          \
@@ -1335,12 +1334,12 @@ BUILD_READ_U64_SAFE_HELPERS(rdmsr)
 BUILD_READ_U64_SAFE_HELPERS(rdpmc)
 BUILD_READ_U64_SAFE_HELPERS(xgetbv)
 
-static inline uint8_t wrmsr_safe(u32 msr, u64 val)
+static inline u8 wrmsr_safe(u32 msr, u64 val)
 {
        return kvm_asm_safe("wrmsr", "a"(val & -1u), "d"(val >> 32), "c"(msr));
 }
 
-static inline uint8_t xsetbv_safe(u32 index, u64 value)
+static inline u8 xsetbv_safe(u32 index, u64 value)
 {
        u32 eax = value;
        u32 edx = value >> 32;
index 4f91c1179416bfbbab16435b6c59cf88238720d6..1af44c151d60ae4e2dfc111eea93977d89a304d8 100644 (file)
@@ -47,7 +47,7 @@ static inline bool is_sev_vm(struct kvm_vm *vm)
 }
 
 void sev_vm_launch(struct kvm_vm *vm, u32 policy);
-void sev_vm_launch_measure(struct kvm_vm *vm, uint8_t *measurement);
+void sev_vm_launch_measure(struct kvm_vm *vm, u8 *measurement);
 void sev_vm_launch_finish(struct kvm_vm *vm);
 void snp_vm_launch_start(struct kvm_vm *vm, u64 policy);
 void snp_vm_launch_update(struct kvm_vm *vm);
@@ -55,7 +55,7 @@ void snp_vm_launch_finish(struct kvm_vm *vm);
 
 struct kvm_vm *vm_sev_create_with_one_vcpu(u32 type, void *guest_code,
                                           struct kvm_vcpu **cpu);
-void vm_sev_launch(struct kvm_vm *vm, u64 policy, uint8_t *measurement);
+void vm_sev_launch(struct kvm_vm *vm, u64 policy, u8 *measurement);
 
 kvm_static_assert(SEV_RET_SUCCESS == 0);
 
@@ -132,7 +132,7 @@ static inline void sev_launch_update_data(struct kvm_vm *vm, gpa_t gpa,
 }
 
 static inline void snp_launch_update_data(struct kvm_vm *vm, gpa_t gpa,
-                                         u64 hva, u64 size, uint8_t type)
+                                         u64 hva, u64 size, u8 type)
 {
        struct kvm_sev_snp_launch_update update_data = {
                .uaddr = hva,
index 6cd6bb7efbc240841dd78c5504b45021aab534bc..90fffaf915958351e34682c2f20b69ae259dcf83 100644 (file)
@@ -294,7 +294,7 @@ struct vmx_msr_entry {
 
 static inline int vmxon(u64 phys)
 {
-       uint8_t ret;
+       u8 ret;
 
        __asm__ __volatile__ ("vmxon %[pa]; setna %[ret]"
                : [ret]"=rm"(ret)
@@ -311,7 +311,7 @@ static inline void vmxoff(void)
 
 static inline int vmclear(u64 vmcs_pa)
 {
-       uint8_t ret;
+       u8 ret;
 
        __asm__ __volatile__ ("vmclear %[pa]; setna %[ret]"
                : [ret]"=rm"(ret)
@@ -323,7 +323,7 @@ static inline int vmclear(u64 vmcs_pa)
 
 static inline int vmptrld(u64 vmcs_pa)
 {
-       uint8_t ret;
+       u8 ret;
 
        if (enable_evmcs)
                return -1;
@@ -339,7 +339,7 @@ static inline int vmptrld(u64 vmcs_pa)
 static inline int vmptrst(u64 *value)
 {
        u64 tmp;
-       uint8_t ret;
+       u8 ret;
 
        if (enable_evmcs)
                return evmcs_vmptrst(value);
@@ -450,7 +450,7 @@ static inline void vmcall(void)
 static inline int vmread(u64 encoding, u64 *value)
 {
        u64 tmp;
-       uint8_t ret;
+       u8 ret;
 
        if (enable_evmcs)
                return evmcs_vmread(encoding, value);
@@ -477,7 +477,7 @@ static inline u64 vmreadz(u64 encoding)
 
 static inline int vmwrite(u64 encoding, u64 value)
 {
-       uint8_t ret;
+       u8 ret;
 
        if (enable_evmcs)
                return evmcs_vmwrite(encoding, value);
index f96513262c5b32a31b1de27cee0569478d0267e4..7ba3a48911e3d4e0e0dc6b7075e5d05c2fbc2dc0 100644 (file)
@@ -124,7 +124,7 @@ void virt_arch_pgd_alloc(struct kvm_vm *vm)
 static void _virt_pg_map(struct kvm_vm *vm, u64 vaddr, u64 paddr,
                         u64 flags)
 {
-       uint8_t attr_idx = flags & (PTE_ATTRINDX_MASK >> PTE_ATTRINDX_SHIFT);
+       u8 attr_idx = flags & (PTE_ATTRINDX_MASK >> PTE_ATTRINDX_SHIFT);
        u64 pg_attr;
        u64 *ptep;
 
@@ -237,7 +237,7 @@ gpa_t addr_arch_gva2gpa(struct kvm_vm *vm, gva_t gva)
        return pte_addr(vm, *ptep) + (gva & (vm->page_size - 1));
 }
 
-static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, u64 page, int level)
+static void pte_dump(FILE *stream, struct kvm_vm *vm, u8 indent, u64 page, int level)
 {
 #ifdef DEBUG
        static const char * const type[] = { "", "pud", "pmd", "pte" };
@@ -256,7 +256,7 @@ static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, u64 page,
 #endif
 }
 
-void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent)
+void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent)
 {
        int level = 4 - (vm->mmu.pgtable_levels - 1);
        u64 pgd, *ptep;
@@ -397,7 +397,7 @@ void aarch64_vcpu_setup(struct kvm_vcpu *vcpu, struct kvm_vcpu_init *init)
                     HCR_EL2_RW | HCR_EL2_TGE | HCR_EL2_E2H);
 }
 
-void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, uint8_t indent)
+void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, u8 indent)
 {
        u64 pstate, pc;
 
index 2a3ab9c168f04695ad1a7749bf40255dba3e4fa3..7a33965349a7fd5c34dcc310f704904676c1527d 100644 (file)
@@ -216,7 +216,7 @@ repeat:
                                while (--field_width > 0)
                                        APPEND_BUFFER_SAFE(str, end, ' ');
                        APPEND_BUFFER_SAFE(str, end,
-                                           (uint8_t)va_arg(args, int));
+                                           (u8)va_arg(args, int));
                        while (--field_width > 0)
                                APPEND_BUFFER_SAFE(str, end, ' ');
                        continue;
index 9f80e2e030012ca23042304284d6b6913b298755..050ae9c92681ef870c472af8f6017268fdbcfce0 100644 (file)
@@ -1951,7 +1951,7 @@ void kvm_gsi_routing_write(struct kvm_vm *vm, struct kvm_irq_routing *routing)
  * Dumps the current state of the VM given by vm, to the FILE stream
  * given by stream.
  */
-void vm_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent)
+void vm_dump(FILE *stream, struct kvm_vm *vm, u8 indent)
 {
        int ctr;
        struct userspace_mem_region *region;
index 38ee62c6cbfb97b81ae8de54d4dfae0b81d6db6d..2982196db3b2d452d8b2792a3110d292dc1dcda8 100644 (file)
@@ -140,7 +140,7 @@ void virt_arch_pg_map(struct kvm_vm *vm, u64 vaddr, u64 paddr)
        WRITE_ONCE(*ptep, paddr | prot_bits);
 }
 
-static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, u64 page, int level)
+static void pte_dump(FILE *stream, struct kvm_vm *vm, u8 indent, u64 page, int level)
 {
        u64 pte, *ptep;
        static const char * const type[] = { "pte", "pmd", "pud", "pgd"};
@@ -158,7 +158,7 @@ static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent, u64 page,
        }
 }
 
-void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent)
+void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent)
 {
        int level;
 
@@ -169,7 +169,7 @@ void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent)
        pte_dump(stream, vm, indent, vm->mmu.pgd, level);
 }
 
-void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, uint8_t indent)
+void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, u8 indent)
 {
 }
 
index d7646eebcfabd77f914444ec1ef63a0417e52bd0..7336d5a20419d2daddbdce4b1b0e507c0a0a2465 100644 (file)
@@ -148,7 +148,7 @@ unmapped_gva:
        exit(1);
 }
 
-static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent,
+static void pte_dump(FILE *stream, struct kvm_vm *vm, u8 indent,
                     u64 page, int level)
 {
 #ifdef DEBUG
@@ -170,7 +170,7 @@ static void pte_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent,
 #endif
 }
 
-void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent)
+void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent)
 {
        struct kvm_mmu *mmu = &vm->mmu;
        int level = mmu->pgtable_levels - 1;
@@ -233,7 +233,7 @@ void riscv_vcpu_mmu_setup(struct kvm_vcpu *vcpu)
        vcpu_set_reg(vcpu, RISCV_GENERAL_CSR_REG(satp), satp);
 }
 
-void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, uint8_t indent)
+void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, u8 indent)
 {
        struct kvm_riscv_core core;
 
index 7591c5167927163b8ce99b762f6ad6011b2c7248..d35f23a4db124a0949af48aa9e78d68817c0e590 100644 (file)
@@ -111,7 +111,7 @@ gpa_t addr_arch_gva2gpa(struct kvm_vm *vm, gva_t gva)
        return (entry[idx] & ~0xffful) + (gva & 0xffful);
 }
 
-static void virt_dump_ptes(FILE *stream, struct kvm_vm *vm, uint8_t indent,
+static void virt_dump_ptes(FILE *stream, struct kvm_vm *vm, u8 indent,
                           u64 ptea_start)
 {
        u64 *pte, ptea;
@@ -125,7 +125,7 @@ static void virt_dump_ptes(FILE *stream, struct kvm_vm *vm, uint8_t indent,
        }
 }
 
-static void virt_dump_region(FILE *stream, struct kvm_vm *vm, uint8_t indent,
+static void virt_dump_region(FILE *stream, struct kvm_vm *vm, u8 indent,
                             u64 reg_tab_addr)
 {
        u64 addr, *entry;
@@ -147,7 +147,7 @@ static void virt_dump_region(FILE *stream, struct kvm_vm *vm, uint8_t indent,
        }
 }
 
-void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent)
+void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent)
 {
        if (!vm->mmu.pgd_created)
                return;
@@ -212,7 +212,7 @@ void vcpu_args_set(struct kvm_vcpu *vcpu, unsigned int num, ...)
        va_end(ap);
 }
 
-void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, uint8_t indent)
+void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, u8 indent)
 {
        fprintf(stream, "%*spstate: psw: 0x%.16llx:0x%.16llx\n",
                indent, "", vcpu->run->psw_mask, vcpu->run->psw_addr);
index 7e7734088f2f5a05d53d55f560434e25eb5bd6bb..4d845000de154fc662331fa81f05f3b4f7e99a4c 100644 (file)
@@ -2074,7 +2074,7 @@ int main(void)
 {
        s = sparsebit_alloc();
        for (;;) {
-               uint8_t op = get8() & 0xf;
+               u8 op = get8() & 0xf;
                u64 first = get64();
                u64 last = get64();
 
index 8e6393384fa41e9a89faf235815ece08824b920d..723a5200c4bb9e690c46191c1e0ccb22e04b639d 100644 (file)
@@ -62,7 +62,7 @@ const char *ex_str(int vector)
        }
 }
 
-static void regs_dump(FILE *stream, struct kvm_regs *regs, uint8_t indent)
+static void regs_dump(FILE *stream, struct kvm_regs *regs, u8 indent)
 {
        fprintf(stream, "%*srax: 0x%.16llx rbx: 0x%.16llx "
                "rcx: 0x%.16llx rdx: 0x%.16llx\n",
@@ -86,7 +86,7 @@ static void regs_dump(FILE *stream, struct kvm_regs *regs, uint8_t indent)
 }
 
 static void segment_dump(FILE *stream, struct kvm_segment *segment,
-                        uint8_t indent)
+                        u8 indent)
 {
        fprintf(stream, "%*sbase: 0x%.16llx limit: 0x%.8x "
                "selector: 0x%.4x type: 0x%.2x\n",
@@ -103,7 +103,7 @@ static void segment_dump(FILE *stream, struct kvm_segment *segment,
 }
 
 static void dtable_dump(FILE *stream, struct kvm_dtable *dtable,
-                       uint8_t indent)
+                       u8 indent)
 {
        fprintf(stream, "%*sbase: 0x%.16llx limit: 0x%.4x "
                "padding: 0x%.4x 0x%.4x 0x%.4x\n",
@@ -111,7 +111,7 @@ static void dtable_dump(FILE *stream, struct kvm_dtable *dtable,
                dtable->padding[0], dtable->padding[1], dtable->padding[2]);
 }
 
-static void sregs_dump(FILE *stream, struct kvm_sregs *sregs, uint8_t indent)
+static void sregs_dump(FILE *stream, struct kvm_sregs *sregs, u8 indent)
 {
        unsigned int i;
 
@@ -407,7 +407,7 @@ u64 *vm_get_pte(struct kvm_vm *vm, u64 vaddr)
        return __vm_get_page_table_entry(vm, &vm->mmu, vaddr, &level);
 }
 
-void virt_arch_dump(FILE *stream, struct kvm_vm *vm, uint8_t indent)
+void virt_arch_dump(FILE *stream, struct kvm_vm *vm, u8 indent)
 {
        struct kvm_mmu *mmu = &vm->mmu;
        u64 *pml4e, *pml4e_start;
@@ -909,7 +909,7 @@ const struct kvm_cpuid2 *kvm_get_supported_cpuid(void)
 
 static u32 __kvm_cpu_has(const struct kvm_cpuid2 *cpuid,
                         u32 function, u32 index,
-                        uint8_t reg, uint8_t lo, uint8_t hi)
+                        u8 reg, u8 lo, u8 hi)
 {
        const struct kvm_cpuid_entry2 *entry;
        int i;
@@ -1127,7 +1127,7 @@ void vcpu_args_set(struct kvm_vcpu *vcpu, unsigned int num, ...)
        va_end(ap);
 }
 
-void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, uint8_t indent)
+void vcpu_arch_dump(FILE *stream, struct kvm_vcpu *vcpu, u8 indent)
 {
        struct kvm_regs regs;
        struct kvm_sregs sregs;
@@ -1378,7 +1378,7 @@ unsigned long vm_compute_max_gfn(struct kvm_vm *vm)
 {
        const unsigned long num_ht_pages = 12 << (30 - vm->page_shift); /* 12 GiB */
        unsigned long ht_gfn, max_gfn, max_pfn;
-       uint8_t maxphyaddr, guest_maxphyaddr;
+       u8 maxphyaddr, guest_maxphyaddr;
 
        /*
         * Use "guest MAXPHYADDR" from KVM if it's available.  Guest MAXPHYADDR
index d82f677b7c5e5eb5580c24cbcd39c3818c6ce80e..93f91690346174d88700291a1895b5006dd65a53 100644 (file)
@@ -15,7 +15,7 @@
  * expression would cause us to quit the loop.
  */
 static void encrypt_region(struct kvm_vm *vm, struct userspace_mem_region *region,
-                          uint8_t page_type, bool private)
+                          u8 page_type, bool private)
 {
        const struct sparsebit *protected_phy_pages = region->protected_phy_pages;
        const gpa_t gpa_base = region->region.guest_phys_addr;
@@ -103,7 +103,7 @@ void sev_vm_launch(struct kvm_vm *vm, u32 policy)
        vm->arch.is_pt_protected = true;
 }
 
-void sev_vm_launch_measure(struct kvm_vm *vm, uint8_t *measurement)
+void sev_vm_launch_measure(struct kvm_vm *vm, u8 *measurement)
 {
        struct kvm_sev_launch_measure launch_measure;
        struct kvm_sev_guest_status guest_status;
@@ -174,7 +174,7 @@ struct kvm_vm *vm_sev_create_with_one_vcpu(u32 type, void *guest_code,
        return vm;
 }
 
-void vm_sev_launch(struct kvm_vm *vm, u64 policy, uint8_t *measurement)
+void vm_sev_launch(struct kvm_vm *vm, u64 policy, u8 *measurement)
 {
        if (is_sev_snp_vm(vm)) {
                vm_enable_cap(vm, KVM_CAP_EXIT_HYPERCALL, BIT(KVM_HC_MAP_GPA_RANGE));
index c2b36a4ac638c9a035ac40ea904ac2ba7f1fc892..51f8be50c7e4851d06b9932d9540a8b34030d923 100644 (file)
@@ -217,7 +217,7 @@ static void *vm_gpa2hva(struct vm_data *data, u64 gpa, u64 *rempages)
        }
 
        base = data->hva_slots[slot];
-       return (uint8_t *)base + slotoffs * guest_page_size + pgoffs;
+       return (u8 *)base + slotoffs * guest_page_size + pgoffs;
 }
 
 static u64 vm_slot2gpa(struct vm_data *data, u32 slot)
index c1f1e318e0591a9df2b041952e2a99f024f45a4b..e0975a5dcff1de6411a676d2b68e939f1fd571c9 100644 (file)
@@ -347,7 +347,7 @@ int main(int argc, char *argv[])
 
        /* Pre-fault the memory to avoid taking mmap_sem on guest page faults. */
        for (i = 0; i < slot_size; i += vm->page_size)
-               ((uint8_t *)mem)[i] = 0xaa;
+               ((u8 *)mem)[i] = 0xaa;
 
        gpa = 0;
        for (slot = first_slot; slot < max_slots; slot++) {
index aa92fdf0664d7f213e6bc69f1720acec4fd5a91b..9855b5bfb5ed55b29921d572cb2593665f8f0b1f 100644 (file)
@@ -48,13 +48,13 @@ struct mop_desc {
        void *buf;
        u32 sida_offset;
        void *old;
-       uint8_t old_value[16];
+       u8 old_value[16];
        bool *cmpxchg_success;
-       uint8_t ar;
-       uint8_t key;
+       u8 ar;
+       u8 key;
 };
 
-const uint8_t NO_KEY = 0xff;
+const u8 NO_KEY = 0xff;
 
 static struct kvm_s390_mem_op ksmo_from_desc(struct mop_desc *desc)
 {
@@ -230,8 +230,8 @@ static void memop_ioctl(struct test_info info, struct kvm_s390_mem_op *ksmo,
 #define CR0_FETCH_PROTECTION_OVERRIDE  (1UL << (63 - 38))
 #define CR0_STORAGE_PROTECTION_OVERRIDE        (1UL << (63 - 39))
 
-static uint8_t __aligned(PAGE_SIZE) mem1[65536];
-static uint8_t __aligned(PAGE_SIZE) mem2[65536];
+static u8 __aligned(PAGE_SIZE) mem1[65536];
+static u8 __aligned(PAGE_SIZE) mem2[65536];
 
 struct test_default {
        struct kvm_vm *kvm_vm;
@@ -296,7 +296,7 @@ static void prepare_mem12(void)
        TEST_ASSERT(!memcmp(p1, p2, size), "Memory contents do not match!")
 
 static void default_write_read(struct test_info copy_cpu, struct test_info mop_cpu,
-                              enum mop_target mop_target, u32 size, uint8_t key)
+                              enum mop_target mop_target, u32 size, u8 key)
 {
        prepare_mem12();
        CHECK_N_DO(MOP, mop_cpu, mop_target, WRITE, mem1, size,
@@ -308,7 +308,7 @@ static void default_write_read(struct test_info copy_cpu, struct test_info mop_c
 }
 
 static void default_read(struct test_info copy_cpu, struct test_info mop_cpu,
-                        enum mop_target mop_target, u32 size, uint8_t key)
+                        enum mop_target mop_target, u32 size, u8 key)
 {
        prepare_mem12();
        CHECK_N_DO(MOP, mop_cpu, mop_target, WRITE, mem1, size, GADDR_V(mem1));
@@ -318,12 +318,12 @@ static void default_read(struct test_info copy_cpu, struct test_info mop_cpu,
        ASSERT_MEM_EQ(mem1, mem2, size);
 }
 
-static void default_cmpxchg(struct test_default *test, uint8_t key)
+static void default_cmpxchg(struct test_default *test, u8 key)
 {
        for (int size = 1; size <= 16; size *= 2) {
                for (int offset = 0; offset < 16; offset += size) {
-                       uint8_t __aligned(16) new[16] = {};
-                       uint8_t __aligned(16) old[16];
+                       u8 __aligned(16) new[16] = {};
+                       u8 __aligned(16) old[16];
                        bool succ;
 
                        prepare_mem12();
@@ -400,7 +400,7 @@ static void test_copy_access_register(void)
        kvm_vm_free(t.kvm_vm);
 }
 
-static void set_storage_key_range(void *addr, size_t len, uint8_t key)
+static void set_storage_key_range(void *addr, size_t len, u8 key)
 {
        uintptr_t _addr, abs, i;
        int not_mapped = 0;
@@ -483,7 +483,7 @@ static __uint128_t cut_to_size(int size, __uint128_t val)
 {
        switch (size) {
        case 1:
-               return (uint8_t)val;
+               return (u8)val;
        case 2:
                return (u16)val;
        case 4:
@@ -553,7 +553,7 @@ static __uint128_t permutate_bits(bool guest, int i, int size, __uint128_t old)
        if (swap) {
                int i, j;
                __uint128_t new;
-               uint8_t byte0, byte1;
+               u8 byte0, byte1;
 
                rand = rand * 3 + 1;
                i = rand % size;
index 7a81d07500bde0fe68e4d3dd952c13125f531900..e3c7a2f148f9ad0763b049fb4c369d4596766773 100644 (file)
@@ -20,7 +20,7 @@
 
 struct kvm_s390_irq buf[ARBITRARY_NON_ZERO_VCPU_ID + LOCAL_IRQS];
 
-static uint8_t regs_null[512];
+static u8 regs_null[512];
 
 static void guest_code_initial(void)
 {
index bba0d9a6dcc8746e9eff1fd2747e53d5fc7b8092..a9e5a01200b8a2d47273021a8efe789bb0e438da 100644 (file)
@@ -13,7 +13,7 @@
 #include "kselftest.h"
 #include "ucall_common.h"
 
-static void set_storage_key(void *addr, uint8_t skey)
+static void set_storage_key(void *addr, u8 skey)
 {
        asm volatile("sske %0,%1" : : "d" (skey), "a" (addr));
 }
index e94a640f6f32e8a57058cd33c0c03c96c7e520c0..e021e198b28e365c597deed00f8483c59bbbd92a 100644 (file)
 #define CR0_FETCH_PROTECTION_OVERRIDE  (1UL << (63 - 38))
 #define CR0_STORAGE_PROTECTION_OVERRIDE        (1UL << (63 - 39))
 
-static __aligned(PAGE_SIZE) uint8_t pages[2][PAGE_SIZE];
-static uint8_t *const page_store_prot = pages[0];
-static uint8_t *const page_fetch_prot = pages[1];
+static __aligned(PAGE_SIZE) u8 pages[2][PAGE_SIZE];
+static u8 *const page_store_prot = pages[0];
+static u8 *const page_fetch_prot = pages[1];
 
 /* Nonzero return value indicates that address not mapped */
-static int set_storage_key(void *addr, uint8_t key)
+static int set_storage_key(void *addr, u8 key)
 {
        int not_mapped = 0;
 
@@ -44,7 +44,7 @@ enum permission {
        TRANSL_UNAVAIL = 3,
 };
 
-static enum permission test_protection(void *addr, uint8_t key)
+static enum permission test_protection(void *addr, u8 key)
 {
        u64 mask;
 
@@ -72,7 +72,7 @@ enum stage {
 struct test {
        enum stage stage;
        void *addr;
-       uint8_t key;
+       u8 key;
        enum permission expected;
 } tests[] = {
        /*
index 59a6eae30946bbe21ff9b50c84a1db7f49e36ff4..5551dd0f9fad3ac352895cc9ff40795211d9d9dd 100644 (file)
@@ -556,7 +556,7 @@ static void guest_code_mmio_during_vectoring(void)
        set_idt(&idt_desc);
 
        /* Generate a #GP by dereferencing a non-canonical address */
-       *((uint8_t *)NONCANONICAL) = 0x1;
+       *((u8 *)NONCANONICAL) = 0x1;
 
        GUEST_ASSERT(0);
 }
index 85fabe262864254d1ac8971bef5cbe4b3f3c6d0b..d46968f5579e9226480d90492efb4925412ab28a 100644 (file)
@@ -245,8 +245,8 @@ struct sta_struct {
        u32 sequence;
        u32 flags;
        u64 steal;
-       uint8_t preempted;
-       uint8_t pad[47];
+       u8 preempted;
+       u8 pad[47];
 } __packed;
 
 static void sta_set_shmem(gpa_t gpa, unsigned long flags)
index 620809cf35da8ff6e6433decd90a56f6b852cffb..c91660103137b0feb221866d4756aa4a8e13af70 100644 (file)
@@ -108,7 +108,7 @@ static void guest_code(void *nested_test_data)
 static void guest_no_aperfmperf(void)
 {
        u64 msr_val;
-       uint8_t vector;
+       u8 vector;
 
        vector = rdmsr_safe(MSR_IA32_APERF, &msr_val);
        GUEST_ASSERT(vector == GP_VECTOR);
index 9ff24d4851f5f4a4e52e5400de53b4a2ce3048db..5b3aef109cfc5cf0206032bdfc777f79f6503eed 100644 (file)
@@ -29,7 +29,7 @@
  * SMI handler: runs in real-address mode.
  * Reports SMRAM_STAGE via port IO, then does RSM.
  */
-static uint8_t smi_handler[] = {
+static u8 smi_handler[] = {
        0xb0, SMRAM_STAGE,    /* mov $SMRAM_STAGE, %al */
        0xe4, SYNC_PORT,      /* in $SYNC_PORT, %al */
        0x0f, 0xaa,           /* rsm */
index 721f56d38f49a0a733a376c25505c0a973d1bbc8..c0d30ccd87674658ff3d9eb8b1b6feb2b5c583aa 100644 (file)
@@ -77,7 +77,7 @@
 #define guest_test_fastop_cl(insn, type_t, __val1, __val2)                             \
 ({                                                                                     \
        type_t output = __val2, ex_output = __val2, input = __val2;                     \
-       uint8_t shift = __val1;                                                         \
+       u8 shift = __val1;                                                              \
        u64 flags, ex_flags;                                                            \
                                                                                        \
        guest_execute_fastop_cl("", insn, shift, ex_output, ex_flags);                  \
@@ -95,7 +95,7 @@
 #define guest_execute_fastop_div(__KVM_ASM_SAFE, insn, __a, __d, __rm, __flags)                \
 ({                                                                                     \
        u64 ign_error_code;                                                             \
-       uint8_t vector;                                                                 \
+       u8 vector;                                                                      \
                                                                                        \
        __asm__ __volatile__(fastop(__KVM_ASM_SAFE(insn " %[denom]"))                   \
                             : "+a"(__a), "+d"(__d), flags_constraint(__flags),         \
        type_t _a = __val1, _d = __val1, rm = __val2;                                   \
        type_t a = _a, d = _d, ex_a = _a, ex_d = _d;                                    \
        u64 flags, ex_flags;                                                            \
-       uint8_t v, ex_v;                                                                \
+       u8 v, ex_v;                                                                     \
                                                                                        \
        ex_v = guest_execute_fastop_div(KVM_ASM_SAFE, insn, ex_a, ex_d, rm, ex_flags);  \
        v = guest_execute_fastop_div(KVM_ASM_SAFE_FEP, insn, a, d, rm, flags);          \
@@ -185,7 +185,7 @@ if (sizeof(type_t) != 1) {                                                  \
 
 static void guest_code(void)
 {
-       guest_test_fastops(uint8_t, "b");
+       guest_test_fastops(u8, "b");
        guest_test_fastops(u16, "w");
        guest_test_fastops(u32, "l");
        guest_test_fastops(u64, "q");
index df7a94400d3d7b6b3df030f3c0e969a84d862b7d..753a0e730ea8d8307ae01e9f6374f3fbe7a69ed3 100644 (file)
@@ -26,11 +26,11 @@ static void guest_ud_handler(struct ex_regs *regs)
        regs->rip += HYPERCALL_INSN_SIZE;
 }
 
-static const uint8_t vmx_vmcall[HYPERCALL_INSN_SIZE]  = { 0x0f, 0x01, 0xc1 };
-static const uint8_t svm_vmmcall[HYPERCALL_INSN_SIZE] = { 0x0f, 0x01, 0xd9 };
+static const u8 vmx_vmcall[HYPERCALL_INSN_SIZE]  = { 0x0f, 0x01, 0xc1 };
+static const u8 svm_vmmcall[HYPERCALL_INSN_SIZE] = { 0x0f, 0x01, 0xd9 };
 
-extern uint8_t hypercall_insn[HYPERCALL_INSN_SIZE];
-static u64 do_sched_yield(uint8_t apic_id)
+extern u8 hypercall_insn[HYPERCALL_INSN_SIZE];
+static u64 do_sched_yield(u8 apic_id)
 {
        u64 ret;
 
@@ -45,8 +45,8 @@ static u64 do_sched_yield(uint8_t apic_id)
 
 static void guest_main(void)
 {
-       const uint8_t *native_hypercall_insn;
-       const uint8_t *other_hypercall_insn;
+       const u8 *native_hypercall_insn;
+       const u8 *other_hypercall_insn;
        u64 ret;
 
        if (host_cpu_is_intel) {
index c7e4f08765fb6fbbc55c0e6bc53caf961eee6d8d..fd6b6c67199a1d1f68cd423edfa5f3f41d948687 100644 (file)
@@ -21,7 +21,7 @@ static inline void handle_flds_emulation_failure_exit(struct kvm_vcpu *vcpu)
 {
        struct kvm_run *run = vcpu->run;
        struct kvm_regs regs;
-       uint8_t *insn_bytes;
+       u8 *insn_bytes;
        u64 flags;
 
        TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_INTERNAL_ERROR);
index 80588b7ea259038486270176ed1b3844bd26e713..52dbd52ce606c44aabad74b9e533b0fdf92eccc5 100644 (file)
@@ -41,7 +41,7 @@ static bool is_write_only_msr(u32 msr)
 
 static void guest_msr(struct msr_data *msr)
 {
-       uint8_t vector = 0;
+       u8 vector = 0;
        u64 msr_val = 0;
 
        GUEST_ASSERT(msr->idx);
@@ -85,7 +85,7 @@ done:
 static void guest_hcall(gpa_t pgs_gpa, struct hcall_data *hcall)
 {
        u64 res, input, output;
-       uint8_t vector;
+       u8 vector;
 
        GUEST_ASSERT_NE(hcall->control, 0);
 
index babf0f95165aa3d66c366e517933ee0736ea2dcb..8ed5fa6350211d5196da58b37b7d5b86e9756698 100644 (file)
@@ -41,7 +41,7 @@ static struct msr_data msrs_to_test[] = {
 static void test_msr(struct msr_data *msr)
 {
        u64 ignored;
-       uint8_t vector;
+       u8 vector;
 
        PR_MSR(msr);
 
index 42fd24567e26b34e9bd12828ec39e8b574513445..fb7dcbe53ac73d36d0382cc3a65cdf64d0676f91 100644 (file)
@@ -13,7 +13,7 @@ enum {
 
 struct emulated_instruction {
        const char name[32];
-       uint8_t opcode[15];
+       u8 opcode[15];
        u32 exit_reason[NR_VIRTUALIZATION_FLAVORS];
 };
 
@@ -32,9 +32,9 @@ static struct emulated_instruction instructions[] = {
        },
 };
 
-static uint8_t kvm_fep[] = { 0x0f, 0x0b, 0x6b, 0x76, 0x6d };   /* ud2 ; .ascii "kvm" */
-static uint8_t l2_guest_code[sizeof(kvm_fep) + 15];
-static uint8_t *l2_instruction = &l2_guest_code[sizeof(kvm_fep)];
+static u8 kvm_fep[] = { 0x0f, 0x0b, 0x6b, 0x76, 0x6d };        /* ud2 ; .ascii "kvm" */
+static u8 l2_guest_code[sizeof(kvm_fep) + 15];
+static u8 *l2_instruction = &l2_guest_code[sizeof(kvm_fep)];
 
 static u32 get_instruction_length(struct emulated_instruction *insn)
 {
index 86d1ab0db1e88c6e9cf318dbb060a692d5cc508b..80bb07e6531cfe1c1c32ab276b10ff824b3260c4 100644 (file)
@@ -24,7 +24,7 @@
 static void guest_code(void)
 {
        u64 msr_platform_info;
-       uint8_t vector;
+       u8 vector;
 
        GUEST_SYNC(true);
        msr_platform_info = rdmsr(MSR_PLATFORM_INFO);
index 2a12c2d4269738b7ca97d6cfaef169259825ac8d..dc6afac3aa9195502f69392605e906d5c8ba4f17 100644 (file)
@@ -32,7 +32,7 @@
 /* Track which architectural events are supported by hardware. */
 static u32 hardware_pmu_arch_events;
 
-static uint8_t kvm_pmu_version;
+static u8 kvm_pmu_version;
 static bool kvm_has_perf_caps;
 
 #define X86_PMU_FEATURE_NULL                                           \
@@ -57,7 +57,7 @@ struct kvm_intel_pmu_event {
  * kvm_x86_pmu_feature use syntax that's only valid in function scope, and the
  * compiler often thinks the feature definitions aren't compile-time constants.
  */
-static struct kvm_intel_pmu_event intel_event_to_feature(uint8_t idx)
+static struct kvm_intel_pmu_event intel_event_to_feature(u8 idx)
 {
        const struct kvm_intel_pmu_event __intel_event_to_feature[] = {
                [INTEL_ARCH_CPU_CYCLES_INDEX]            = { X86_PMU_FEATURE_CPU_CYCLES, X86_PMU_FEATURE_CPU_CYCLES_FIXED },
@@ -89,7 +89,7 @@ static struct kvm_intel_pmu_event intel_event_to_feature(uint8_t idx)
 
 static struct kvm_vm *pmu_vm_create_with_one_vcpu(struct kvm_vcpu **vcpu,
                                                  void *guest_code,
-                                                 uint8_t pmu_version,
+                                                 u8 pmu_version,
                                                  u64 perf_capabilities)
 {
        struct kvm_vm *vm;
@@ -132,7 +132,7 @@ static void run_vcpu(struct kvm_vcpu *vcpu)
        } while (uc.cmd != UCALL_DONE);
 }
 
-static uint8_t guest_get_pmu_version(void)
+static u8 guest_get_pmu_version(void)
 {
        /*
         * Return the effective PMU version, i.e. the minimum between what KVM
@@ -141,7 +141,7 @@ static uint8_t guest_get_pmu_version(void)
         * supported by KVM to verify KVM doesn't freak out and do something
         * bizarre with an architecturally valid, but unsupported, version.
         */
-       return min_t(uint8_t, kvm_pmu_version, this_cpu_property(X86_PROPERTY_PMU_VERSION));
+       return min_t(u8, kvm_pmu_version, this_cpu_property(X86_PROPERTY_PMU_VERSION));
 }
 
 /*
@@ -153,7 +153,7 @@ static uint8_t guest_get_pmu_version(void)
  * Sanity check that in all cases, the event doesn't count when it's disabled,
  * and that KVM correctly emulates the write of an arbitrary value.
  */
-static void guest_assert_event_count(uint8_t idx, u32 pmc, u32 pmc_msr)
+static void guest_assert_event_count(u8 idx, u32 pmc, u32 pmc_msr)
 {
        u64 count;
 
@@ -255,7 +255,7 @@ do {                                                                                \
        guest_assert_event_count(_idx, _pmc, _pmc_msr);                         \
 } while (0)
 
-static void __guest_test_arch_event(uint8_t idx, u32 pmc, u32 pmc_msr,
+static void __guest_test_arch_event(u8 idx, u32 pmc, u32 pmc_msr,
                                    u32 ctrl_msr, u64 ctrl_msr_value)
 {
        GUEST_TEST_EVENT(idx, pmc, pmc_msr, ctrl_msr, ctrl_msr_value, "");
@@ -264,7 +264,7 @@ static void __guest_test_arch_event(uint8_t idx, u32 pmc, u32 pmc_msr,
                GUEST_TEST_EVENT(idx, pmc, pmc_msr, ctrl_msr, ctrl_msr_value, KVM_FEP);
 }
 
-static void guest_test_arch_event(uint8_t idx)
+static void guest_test_arch_event(u8 idx)
 {
        u32 nr_gp_counters = this_cpu_property(X86_PROPERTY_PMU_NR_GP_COUNTERS);
        u32 pmu_version = guest_get_pmu_version();
@@ -320,7 +320,7 @@ static void guest_test_arch_event(uint8_t idx)
 
 static void guest_test_arch_events(void)
 {
-       uint8_t i;
+       u8 i;
 
        for (i = 0; i < NR_INTEL_ARCH_EVENTS; i++)
                guest_test_arch_event(i);
@@ -328,8 +328,8 @@ static void guest_test_arch_events(void)
        GUEST_DONE();
 }
 
-static void test_arch_events(uint8_t pmu_version, u64 perf_capabilities,
-                            uint8_t length, u32 unavailable_mask)
+static void test_arch_events(u8 pmu_version, u64 perf_capabilities,
+                            u8 length, u32 unavailable_mask)
 {
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
@@ -376,7 +376,7 @@ __GUEST_ASSERT(expect_gp ? vector == GP_VECTOR : !vector,                   \
 static void guest_test_rdpmc(u32 rdpmc_idx, bool expect_success,
                             u64 expected_val)
 {
-       uint8_t vector;
+       u8 vector;
        u64 val;
 
        vector = rdpmc_safe(rdpmc_idx, &val);
@@ -393,11 +393,11 @@ static void guest_test_rdpmc(u32 rdpmc_idx, bool expect_success,
                GUEST_ASSERT_PMC_VALUE(RDPMC, rdpmc_idx, val, expected_val);
 }
 
-static void guest_rd_wr_counters(u32 base_msr, uint8_t nr_possible_counters,
-                                uint8_t nr_counters, u32 or_mask)
+static void guest_rd_wr_counters(u32 base_msr, u8 nr_possible_counters,
+                                u8 nr_counters, u32 or_mask)
 {
        const bool pmu_has_fast_mode = !guest_get_pmu_version();
-       uint8_t i;
+       u8 i;
 
        for (i = 0; i < nr_possible_counters; i++) {
                /*
@@ -422,7 +422,7 @@ static void guest_rd_wr_counters(u32 base_msr, uint8_t nr_possible_counters,
                const bool expect_gp = !expect_success && msr != MSR_P6_PERFCTR0 &&
                                       msr != MSR_P6_PERFCTR1;
                u32 rdpmc_idx;
-               uint8_t vector;
+               u8 vector;
                u64 val;
 
                vector = wrmsr_safe(msr, test_val);
@@ -461,8 +461,8 @@ static void guest_rd_wr_counters(u32 base_msr, uint8_t nr_possible_counters,
 
 static void guest_test_gp_counters(void)
 {
-       uint8_t pmu_version = guest_get_pmu_version();
-       uint8_t nr_gp_counters = 0;
+       u8 pmu_version = guest_get_pmu_version();
+       u8 nr_gp_counters = 0;
        u32 base_msr;
 
        if (pmu_version)
@@ -495,8 +495,8 @@ static void guest_test_gp_counters(void)
        GUEST_DONE();
 }
 
-static void test_gp_counters(uint8_t pmu_version, u64 perf_capabilities,
-                            uint8_t nr_gp_counters)
+static void test_gp_counters(u8 pmu_version, u64 perf_capabilities,
+                            u8 nr_gp_counters)
 {
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
@@ -515,8 +515,8 @@ static void test_gp_counters(uint8_t pmu_version, u64 perf_capabilities,
 static void guest_test_fixed_counters(void)
 {
        u64 supported_bitmask = 0;
-       uint8_t nr_fixed_counters = 0;
-       uint8_t i;
+       u8 nr_fixed_counters = 0;
+       u8 i;
 
        /* Fixed counters require Architectural vPMU Version 2+. */
        if (guest_get_pmu_version() >= 2)
@@ -533,7 +533,7 @@ static void guest_test_fixed_counters(void)
                             nr_fixed_counters, supported_bitmask);
 
        for (i = 0; i < MAX_NR_FIXED_COUNTERS; i++) {
-               uint8_t vector;
+               u8 vector;
                u64 val;
 
                if (i >= nr_fixed_counters && !(supported_bitmask & BIT_ULL(i))) {
@@ -561,9 +561,8 @@ static void guest_test_fixed_counters(void)
        GUEST_DONE();
 }
 
-static void test_fixed_counters(uint8_t pmu_version, u64 perf_capabilities,
-                               uint8_t nr_fixed_counters,
-                               u32 supported_bitmask)
+static void test_fixed_counters(u8 pmu_version, u64 perf_capabilities,
+                               u8 nr_fixed_counters, u32 supported_bitmask)
 {
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
@@ -583,11 +582,11 @@ static void test_fixed_counters(uint8_t pmu_version, u64 perf_capabilities,
 
 static void test_intel_counters(void)
 {
-       uint8_t nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS);
-       uint8_t nr_gp_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_GP_COUNTERS);
-       uint8_t pmu_version = kvm_cpu_property(X86_PROPERTY_PMU_VERSION);
+       u8 nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS);
+       u8 nr_gp_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_GP_COUNTERS);
+       u8 pmu_version = kvm_cpu_property(X86_PROPERTY_PMU_VERSION);
        unsigned int i;
-       uint8_t v, j;
+       u8 v, j;
        u32 k;
 
        const u64 perf_caps[] = {
@@ -620,7 +619,7 @@ static void test_intel_counters(void)
         * Intel, i.e. is the last version that is guaranteed to be backwards
         * compatible with KVM's existing behavior.
         */
-       uint8_t max_pmu_version = max_t(typeof(pmu_version), pmu_version, 5);
+       u8 max_pmu_version = max_t(typeof(pmu_version), pmu_version, 5);
 
        /*
         * Detect the existence of events that aren't supported by selftests.
index 5d607b114aeb151193f4ae4ed68533038a456bf0..c1232344fda89e7ac49f59db4c839cd8f63d2193 100644 (file)
@@ -685,7 +685,7 @@ static int set_pmu_single_event_filter(struct kvm_vcpu *vcpu, u64 event,
 
 static void test_filter_ioctl(struct kvm_vcpu *vcpu)
 {
-       uint8_t nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS);
+       u8 nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS);
        struct __kvm_pmu_event_filter f;
        u64 e = ~0ul;
        int r;
@@ -729,7 +729,7 @@ static void test_filter_ioctl(struct kvm_vcpu *vcpu)
        TEST_ASSERT(!r, "Masking non-existent fixed counters should be allowed");
 }
 
-static void intel_run_fixed_counter_guest_code(uint8_t idx)
+static void intel_run_fixed_counter_guest_code(u8 idx)
 {
        for (;;) {
                wrmsr(MSR_CORE_PERF_GLOBAL_CTRL, 0);
@@ -770,8 +770,8 @@ static u64 test_set_gp_and_fixed_event_filter(struct kvm_vcpu *vcpu,
        return run_vcpu_to_sync(vcpu);
 }
 
-static void __test_fixed_counter_bitmap(struct kvm_vcpu *vcpu, uint8_t idx,
-                                       uint8_t nr_fixed_counters)
+static void __test_fixed_counter_bitmap(struct kvm_vcpu *vcpu, u8 idx,
+                                       u8 nr_fixed_counters)
 {
        unsigned int i;
        u32 bitmap;
@@ -815,10 +815,10 @@ static void __test_fixed_counter_bitmap(struct kvm_vcpu *vcpu, uint8_t idx,
 
 static void test_fixed_counter_bitmap(void)
 {
-       uint8_t nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS);
+       u8 nr_fixed_counters = kvm_cpu_property(X86_PROPERTY_PMU_NR_FIXED_COUNTERS);
        struct kvm_vm *vm;
        struct kvm_vcpu *vcpu;
-       uint8_t idx;
+       u8 idx;
 
        /*
         * Check that pmu_event_filter works as expected when it's applied to
index 0bf86d822ee0924a16c4b0246c43a1bfd57cb29e..27675d7d04c09a2ab9704b2b99e11428215b20fe 100644 (file)
@@ -29,7 +29,7 @@
 /* Horrific macro so that the line info is captured accurately :-( */
 #define memcmp_g(gpa, pattern,  size)                                                          \
 do {                                                                                           \
-       uint8_t *mem = (uint8_t *)gpa;                                                          \
+       u8 *mem = (u8 *)gpa;                                                                    \
        size_t i;                                                                               \
                                                                                                \
        for (i = 0; i < size; i++)                                                              \
@@ -38,7 +38,7 @@ do {                                                                                          \
                               pattern, i, gpa + i, mem[i]);                                    \
 } while (0)
 
-static void memcmp_h(uint8_t *mem, u64 gpa, uint8_t pattern, size_t size)
+static void memcmp_h(u8 *mem, u64 gpa, u8 pattern, size_t size)
 {
        size_t i;
 
@@ -71,12 +71,12 @@ enum ucall_syncs {
 };
 
 static void guest_sync_shared(u64 gpa, u64 size,
-                             uint8_t current_pattern, uint8_t new_pattern)
+                             u8 current_pattern, u8 new_pattern)
 {
        GUEST_SYNC5(SYNC_SHARED, gpa, size, current_pattern, new_pattern);
 }
 
-static void guest_sync_private(u64 gpa, u64 size, uint8_t pattern)
+static void guest_sync_private(u64 gpa, u64 size, u8 pattern)
 {
        GUEST_SYNC4(SYNC_PRIVATE, gpa, size, pattern);
 }
@@ -121,8 +121,8 @@ struct {
 
 static void guest_test_explicit_conversion(u64 base_gpa, bool do_fallocate)
 {
-       const uint8_t def_p = 0xaa;
-       const uint8_t init_p = 0xcc;
+       const u8 def_p = 0xaa;
+       const u8 init_p = 0xcc;
        u64 j;
        int i;
 
@@ -136,10 +136,10 @@ static void guest_test_explicit_conversion(u64 base_gpa, bool do_fallocate)
        for (i = 0; i < ARRAY_SIZE(test_ranges); i++) {
                u64 gpa = base_gpa + test_ranges[i].offset;
                u64 size = test_ranges[i].size;
-               uint8_t p1 = 0x11;
-               uint8_t p2 = 0x22;
-               uint8_t p3 = 0x33;
-               uint8_t p4 = 0x44;
+               u8 p1 = 0x11;
+               u8 p2 = 0x22;
+               u8 p3 = 0x33;
+               u8 p4 = 0x44;
 
                /*
                 * Set the test region to pattern one to differentiate it from
@@ -229,7 +229,7 @@ static void guest_punch_hole(u64 gpa, u64 size)
  */
 static void guest_test_punch_hole(u64 base_gpa, bool precise)
 {
-       const uint8_t init_p = 0xcc;
+       const u8 init_p = 0xcc;
        int i;
 
        /*
@@ -347,7 +347,7 @@ static void *__test_mem_conversions(void *__vcpu)
 
                        for (i = 0; i < size; i += vm->page_size) {
                                size_t nr_bytes = min_t(size_t, vm->page_size, size - i);
-                               uint8_t *hva = addr_gpa2hva(vm, gpa + i);
+                               u8 *hva = addr_gpa2hva(vm, gpa + i);
 
                                /* In all cases, the host should observe the shared data. */
                                memcmp_h(hva, gpa + i, uc.args[3], nr_bytes);
index 39e89350c2e70550363e8ff2248e7333d86cae8b..740051167dbd44b1179ba40c5c13b668f121c57b 100644 (file)
@@ -34,7 +34,7 @@
  * independent subset of asm here.
  * SMI handler always report back fixed stage SMRAM_STAGE.
  */
-uint8_t smi_handler[] = {
+u8 smi_handler[] = {
        0xb0, SMRAM_STAGE,    /* mov $SMRAM_STAGE, %al */
        0xe4, SYNC_PORT,      /* in $SYNC_PORT, %al */
        0x0f, 0xaa,           /* rsm */
index 62e14843e5af324fd825cc03284dbdb49ae49bd9..409c6cc9f9214f7d46a373912d5d41a709dfae00 100644 (file)
@@ -145,7 +145,7 @@ static void __attribute__((__flatten__)) guest_code(void *arg)
 
        if (this_cpu_has(X86_FEATURE_XSAVE)) {
                u64 supported_xcr0 = this_cpu_supported_xcr0();
-               uint8_t buffer[PAGE_SIZE];
+               u8 buffer[PAGE_SIZE];
 
                memset(buffer, 0xcc, sizeof(buffer));
 
@@ -331,7 +331,7 @@ int main(int argc, char *argv[])
                 * supported features, even if something goes awry in saving
                 * the original snapshot.
                 */
-               xstate_bv = (void *)&((uint8_t *)state->xsave->region)[512];
+               xstate_bv = (void *)&((u8 *)state->xsave->region)[512];
                saved_xstate_bv = *xstate_bv;
 
                vcpuN = __vm_vcpu_add(vm, vcpu->id + 1);
index be7d72f3c029ffdceb91461e9bed2ea0773ad883..9c5a87576c2e95eaf44566bc39efcb715807236a 100644 (file)
@@ -10,7 +10,7 @@
 #include "kvm_util.h"
 #include "processor.h"
 
-static void guest_ins_port80(uint8_t *buffer, unsigned int count)
+static void guest_ins_port80(u8 *buffer, unsigned int count)
 {
        unsigned long end;
 
@@ -26,7 +26,7 @@ static void guest_ins_port80(uint8_t *buffer, unsigned int count)
 
 static void guest_code(void)
 {
-       uint8_t buffer[8192];
+       u8 buffer[8192];
        int i;
 
        /*
index 98b8d285dbb7028556444075e4517973ef4ff5a2..2808ce727e5f5943ba28b53cfb5efd8984e376a4 100644 (file)
@@ -23,21 +23,21 @@ struct kvm_msr_filter filter_allow = {
                        .nmsrs = 1,
                        /* Test an MSR the kernel knows about. */
                        .base = MSR_IA32_XSS,
-                       .bitmap = (uint8_t*)&deny_bits,
+                       .bitmap = (u*)&deny_bits,
                }, {
                        .flags = KVM_MSR_FILTER_READ |
                                 KVM_MSR_FILTER_WRITE,
                        .nmsrs = 1,
                        /* Test an MSR the kernel doesn't know about. */
                        .base = MSR_IA32_FLUSH_CMD,
-                       .bitmap = (uint8_t*)&deny_bits,
+                       .bitmap = (u*)&deny_bits,
                }, {
                        .flags = KVM_MSR_FILTER_READ |
                                 KVM_MSR_FILTER_WRITE,
                        .nmsrs = 1,
                        /* Test a fabricated MSR that no one knows about. */
                        .base = MSR_NON_EXISTENT,
-                       .bitmap = (uint8_t*)&deny_bits,
+                       .bitmap = (u*)&deny_bits,
                },
        },
 };
@@ -49,7 +49,7 @@ struct kvm_msr_filter filter_fs = {
                        .flags = KVM_MSR_FILTER_READ,
                        .nmsrs = 1,
                        .base = MSR_FS_BASE,
-                       .bitmap = (uint8_t*)&deny_bits,
+                       .bitmap = (u*)&deny_bits,
                },
        },
 };
@@ -61,7 +61,7 @@ struct kvm_msr_filter filter_gs = {
                        .flags = KVM_MSR_FILTER_READ,
                        .nmsrs = 1,
                        .base = MSR_GS_BASE,
-                       .bitmap = (uint8_t*)&deny_bits,
+                       .bitmap = (u*)&deny_bits,
                },
        },
 };
@@ -77,7 +77,7 @@ static u8 bitmap_c0000000[KVM_MSR_FILTER_MAX_BITMAP_SIZE];
 static u8 bitmap_c0000000_read[KVM_MSR_FILTER_MAX_BITMAP_SIZE];
 static u8 bitmap_deadbeef[1] = { 0x1 };
 
-static void deny_msr(uint8_t *bitmap, u32 msr)
+static void deny_msr(u8 *bitmap, u32 msr)
 {
        u32 idx = msr & (KVM_MSR_FILTER_MAX_BITMAP_SIZE - 1);
 
@@ -732,7 +732,7 @@ static void run_msr_filter_flag_test(struct kvm_vm *vm)
                                .flags = KVM_MSR_FILTER_READ,
                                .nmsrs = 1,
                                .base = 0,
-                               .bitmap = (uint8_t *)&deny_bits,
+                               .bitmap = (u8 *)&deny_bits,
                        },
                },
        };
index 1f3638c6ee14f0c39314b30b6a0c3abb7c5fb056..d004108dbdc63863fcc5fc37da331797ac27797c 100644 (file)
@@ -54,7 +54,7 @@ static const union perf_capabilities format_caps = {
 
 static void guest_test_perf_capabilities_gp(u64 val)
 {
-       uint8_t vector = wrmsr_safe(MSR_IA32_PERF_CAPABILITIES, val);
+       u8 vector = wrmsr_safe(MSR_IA32_PERF_CAPABILITIES, val);
 
        __GUEST_ASSERT(vector == GP_VECTOR,
                       "Expected #GP for value '0x%lx', got %s",
index af1fe833ad4fdfa0b21026be1a449318befcea3d..ab25db2235d5382490f9efe1a704f550dd6d0f53 100644 (file)
@@ -69,7 +69,7 @@ static void tpr_guest_irq_queue(void)
        }
 }
 
-static uint8_t tpr_guest_tpr_get(void)
+static u8 tpr_guest_tpr_get(void)
 {
        u32 taskpri;
 
@@ -81,7 +81,7 @@ static uint8_t tpr_guest_tpr_get(void)
        return GET_APIC_PRI(taskpri);
 }
 
-static uint8_t tpr_guest_ppr_get(void)
+static u8 tpr_guest_ppr_get(void)
 {
        u32 procpri;
 
@@ -93,7 +93,7 @@ static uint8_t tpr_guest_ppr_get(void)
        return GET_APIC_PRI(procpri);
 }
 
-static uint8_t tpr_guest_cr8_get(void)
+static u8 tpr_guest_cr8_get(void)
 {
        u64 cr8;
 
@@ -104,7 +104,7 @@ static uint8_t tpr_guest_cr8_get(void)
 
 static void tpr_guest_check_tpr_ppr_cr8_equal(void)
 {
-       uint8_t tpr;
+       u8 tpr;
 
        tpr = tpr_guest_tpr_get();
 
@@ -157,19 +157,19 @@ static void tpr_guest_code(void)
        GUEST_DONE();
 }
 
-static uint8_t lapic_tpr_get(struct kvm_lapic_state *xapic)
+static u8 lapic_tpr_get(struct kvm_lapic_state *xapic)
 {
        return GET_APIC_PRI(*((u32 *)&xapic->regs[APIC_TASKPRI]));
 }
 
-static void lapic_tpr_set(struct kvm_lapic_state *xapic, uint8_t val)
+static void lapic_tpr_set(struct kvm_lapic_state *xapic, u8 val)
 {
        u32 *taskpri = (u32 *)&xapic->regs[APIC_TASKPRI];
 
        *taskpri = SET_APIC_PRI(*taskpri, val);
 }
 
-static uint8_t sregs_tpr(struct kvm_sregs *sregs)
+static u8 sregs_tpr(struct kvm_sregs *sregs)
 {
        return sregs->cr8 & GENMASK(3, 0);
 }
@@ -197,7 +197,7 @@ static void test_tpr_check_tpr_cr8_equal(struct kvm_vcpu *vcpu)
 static void test_tpr_set_tpr_for_irq(struct kvm_vcpu *vcpu, bool mask)
 {
        struct kvm_lapic_state xapic;
-       uint8_t tpr;
+       u8 tpr;
 
        static_assert(IRQ_VECTOR >= 16, "invalid IRQ vector number");
        tpr = IRQ_VECTOR / 16;
index c6d00205b59d887bd82eb5ab12fa3643a08030c4..5076f6a754557509efec2f5339038e9c35d8f578 100644 (file)
@@ -133,8 +133,8 @@ struct arch_vcpu_info {
 };
 
 struct vcpu_info {
-       uint8_t evtchn_upcall_pending;
-       uint8_t evtchn_upcall_mask;
+       u8 evtchn_upcall_pending;
+       u8 evtchn_upcall_mask;
        unsigned long evtchn_pending_sel;
        struct arch_vcpu_info arch;
        struct pvclock_vcpu_time_info time;