mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 09:17:58 +00:00
HV: fix violations touched type conversion
ACRN Coding guidelines requires type conversion shall be explicity. Tracked-On: #861 Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -105,10 +105,10 @@ int32_t mptable_build(struct acrn_vm *vm)
|
||||
(const void *)&mptable_template, sizeof(struct mptable_info));
|
||||
|
||||
mptable->mpch.entry_count = vcpu_num + MPE_NUM_BUSES + MPEII_NUM_LOCAL_IRQ;
|
||||
mptable->mpch.base_table_length = sizeof(struct mpcth)
|
||||
+ vcpu_num * sizeof(struct proc_entry)
|
||||
+ MPE_NUM_BUSES * sizeof(struct bus_entry)
|
||||
+ MPEII_NUM_LOCAL_IRQ * sizeof(struct int_entry);
|
||||
mptable->mpch.base_table_length = (uint16_t)sizeof(struct mpcth)
|
||||
+ vcpu_num * (uint16_t)sizeof(struct proc_entry)
|
||||
+ MPE_NUM_BUSES * (uint16_t)sizeof(struct bus_entry)
|
||||
+ MPEII_NUM_LOCAL_IRQ * (uint16_t)sizeof(struct int_entry);
|
||||
|
||||
mptable_length = sizeof(struct mpfps) + mptable->mpch.base_table_length;
|
||||
if (mptable_length <= MPTABLE_MAX_LENGTH) {
|
||||
|
@@ -349,9 +349,9 @@ static bool setup_trusty_info(struct acrn_vcpu *vcpu, uint32_t mem_size, uint64_
|
||||
|
||||
stac();
|
||||
mem = (struct trusty_mem *)(hpa2hva(mem_base_hpa));
|
||||
(void)memcpy_s(&mem->first_page.key_info, sizeof(struct trusty_key_info),
|
||||
(void)memcpy_s((void *)&mem->first_page.key_info, sizeof(struct trusty_key_info),
|
||||
&key_info, sizeof(key_info));
|
||||
(void)memcpy_s(&mem->first_page.startup_param, sizeof(struct trusty_startup_param),
|
||||
(void)memcpy_s((void *)&mem->first_page.startup_param, sizeof(struct trusty_startup_param),
|
||||
&startup_param, sizeof(startup_param));
|
||||
clac();
|
||||
success = true;
|
||||
|
@@ -210,8 +210,8 @@ static int32_t set_vcpuid_sgx(struct acrn_vm *vm)
|
||||
if (result == 0) {
|
||||
init_vcpuid_entry(CPUID_SGX_LEAF, 1U, CPUID_CHECK_SUBLEAF, &entry);
|
||||
/* MPX not present to guest */
|
||||
entry.ecx &= ~XCR0_BNDREGS;
|
||||
entry.ecx &= ~XCR0_BNDCSR;
|
||||
entry.ecx &= (uint32_t) ~XCR0_BNDREGS;
|
||||
entry.ecx &= (uint32_t) ~XCR0_BNDCSR;
|
||||
result = set_vcpuid_entry(vm, &entry);
|
||||
}
|
||||
if (result == 0) {
|
||||
|
@@ -225,7 +225,7 @@ create_rte_for_gsi_irq(uint32_t irq, uint32_t vr)
|
||||
rte.bits.intr_polarity = IOAPIC_RTE_INTPOL_AHI;
|
||||
|
||||
/* Dest field */
|
||||
rte.bits.dest_field = ALL_CPUS_MASK;
|
||||
rte.bits.dest_field = (uint8_t) ALL_CPUS_MASK;
|
||||
}
|
||||
|
||||
return rte;
|
||||
|
@@ -71,7 +71,7 @@ static uint32_t parse_seed_arg(void)
|
||||
arg -= len;
|
||||
len = (arg_end != NULL) ? (uint32_t)(arg_end - arg) :
|
||||
strnlen_s(arg, MAX_BOOTARGS_SIZE);
|
||||
(void)memset((void *)arg, (char)' ', len);
|
||||
(void)memset((void *)arg, (uint8_t)' ', len);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user