mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-13 11:33:58 +00:00
HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28
The coding guideline rules C-TY-27 and C-TY-28, combined, requires that assignment and arithmetic operations shall be applied only on operands of the same kind. This patch either adds explicit type casts or adjust types of variables to align the types of operands. The only semantic change introduced by this patch is the promotion of the second argument of set_vmcs_bit() and clear_vmcs_bit() to uint64_t (formerly uint32_t). This avoids clear_vmcs_bit() to accidentally clears the upper 32 bits of the requested VMCS field. Other than that, this patch has no semantic change. Specifically this patch is not meant to fix buggy narrowing operations, only to make these operations explicit. Tracked-On: #6776 Signed-off-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
#include <logmsg.h>
|
||||
#include <misc_cfg.h>
|
||||
|
||||
static uint32_t hv_ram_size;
|
||||
static uint64_t hv_ram_size;
|
||||
static void *ppt_mmu_pml4_addr;
|
||||
static uint8_t sanitized_page[PAGE_SIZE] __aligned(PAGE_SIZE);
|
||||
|
||||
@@ -152,7 +152,7 @@ void invept(const void *eptp)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t get_hv_ram_size(void)
|
||||
uint64_t get_hv_ram_size(void)
|
||||
{
|
||||
return hv_ram_size;
|
||||
}
|
||||
@@ -255,7 +255,7 @@ void init_paging(void)
|
||||
const struct abi_mmap *p_mmap = abi->mmap_entry;
|
||||
|
||||
pr_dbg("HV MMU Initialization");
|
||||
hv_ram_size = (uint32_t)(uint64_t)&ld_ram_size;
|
||||
hv_ram_size = (uint64_t)&ld_ram_size;
|
||||
|
||||
init_sanitized_page((uint64_t *)sanitized_page, hva2hpa_early(sanitized_page));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user