mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 10:17:28 +00:00
HV:fix rest integer violations
Fix integer related violations. V1->V2: clean all memset/calloc integer violations excpet bsp/boot directory Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -760,7 +760,7 @@ uint64_t create_guest_initial_paging(struct vm *vm)
|
||||
* number for it(without trusty) is GUEST_INIT_PT_PAGE_NUM-1.
|
||||
* here make sure they are init as 0 (page entry no present)
|
||||
*/
|
||||
(void)memset(pml4_addr, 0, PAGE_SIZE_4K * GUEST_INIT_PT_PAGE_NUM-1);
|
||||
(void)memset(pml4_addr, 0U, PAGE_SIZE_4K * GUEST_INIT_PT_PAGE_NUM-1);
|
||||
|
||||
/* Write PML4E */
|
||||
table_present = (IA32E_COMM_P_BIT | IA32E_COMM_RW_BIT);
|
||||
@@ -800,7 +800,7 @@ uint64_t create_guest_initial_paging(struct vm *vm)
|
||||
*/
|
||||
if (vm->sworld_control.sworld_enabled && !is_vm0(vm)) {
|
||||
/* clear page entry for trusty */
|
||||
(void)memset(pml4_addr + 6 * PAGE_SIZE_4K, 0, PAGE_SIZE_4K);
|
||||
(void)memset(pml4_addr + 6U * PAGE_SIZE_4K, 0U, PAGE_SIZE_4K);
|
||||
|
||||
/* Write PDPTE for trusy memory, PD will use 7th page */
|
||||
pd_base_paddr = GUEST_INIT_PAGE_TABLE_START +
|
||||
|
@@ -41,7 +41,7 @@ int create_vcpu(uint16_t pcpu_id, struct vm *vm, struct vcpu **rtn_vcpu_handle)
|
||||
pr_info("Creating VCPU %hu", pcpu_id);
|
||||
|
||||
/* Allocate memory for VCPU */
|
||||
vcpu = calloc(1, sizeof(struct vcpu));
|
||||
vcpu = calloc(1U, sizeof(struct vcpu));
|
||||
ASSERT(vcpu != NULL, "");
|
||||
|
||||
/* Initialize the physical CPU ID for this VCPU */
|
||||
@@ -96,7 +96,7 @@ int create_vcpu(uint16_t pcpu_id, struct vm *vm, struct vcpu **rtn_vcpu_handle)
|
||||
ASSERT(vcpu->arch_vcpu.vmcs != NULL, "");
|
||||
|
||||
/* Memset VMCS region for this VCPU */
|
||||
(void)memset(vcpu->arch_vcpu.vmcs, 0, CPU_PAGE_SIZE);
|
||||
(void)memset(vcpu->arch_vcpu.vmcs, 0U, CPU_PAGE_SIZE);
|
||||
|
||||
/* Initialize exception field in VCPU context */
|
||||
vcpu->arch_vcpu.exception_info.exception = VECTOR_INVALID;
|
||||
@@ -283,7 +283,7 @@ void reset_vcpu(struct vcpu *vcpu)
|
||||
vcpu->arch_vcpu.cur_context = NORMAL_WORLD;
|
||||
vcpu->arch_vcpu.irq_window_enabled = 0;
|
||||
vcpu->arch_vcpu.inject_event_pending = false;
|
||||
(void)memset(vcpu->arch_vcpu.vmcs, 0, CPU_PAGE_SIZE);
|
||||
(void)memset(vcpu->arch_vcpu.vmcs, 0U, CPU_PAGE_SIZE);
|
||||
|
||||
vlapic = vcpu->arch_vcpu.vlapic;
|
||||
vlapic_reset(vlapic);
|
||||
|
Reference in New Issue
Block a user