mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 17:46:15 +00:00
hv: fix integer violations
The operands to shift operations (<<, >>) shall be unsigned integers. v1 -> v2: * replace 12U with CPU_PAGE_SHIFT when it is address shift case. * replace 6UL with 0x6UL Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -76,7 +76,7 @@ static void ptdev_build_physical_msi(struct vm *vm, struct ptdev_msi_info *info,
|
||||
bool phys;
|
||||
|
||||
/* get physical destination cpu mask */
|
||||
dest = (uint32_t)(info->vmsi_addr >> 12) & 0xffU;
|
||||
dest = (uint32_t)(info->vmsi_addr >> CPU_PAGE_SHIFT) & 0xffU;
|
||||
phys = ((info->vmsi_addr & MSI_ADDR_LOG) != MSI_ADDR_LOG);
|
||||
|
||||
calcvdest(vm, &vdmask, dest, phys);
|
||||
@@ -796,7 +796,7 @@ static void get_entry_info(const struct ptdev_remapping_info *entry, char *type,
|
||||
if (is_entry_active(entry)) {
|
||||
if (entry->intr_type == PTDEV_INTR_MSI) {
|
||||
(void)strcpy_s(type, 16U, "MSI");
|
||||
*dest = (entry->msi.pmsi_addr & 0xFF000U) >> 12;
|
||||
*dest = (entry->msi.pmsi_addr & 0xFF000U) >> CPU_PAGE_SHIFT;
|
||||
if ((entry->msi.pmsi_data & APIC_TRIGMOD_LEVEL) != 0U) {
|
||||
*lvl_tm = true;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user