hv: MSI Message Address should be 64 bits

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Zide Chen 2018-10-15 22:26:14 -07:00 committed by lijinxia
parent 7b4b78c323
commit 19e1b9675f
2 changed files with 6 additions and 7 deletions

View File

@ -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 = (info->vmsi_addr >> 12) & 0xffU;
dest = (uint32_t)(info->vmsi_addr >> 12) & 0xffU;
phys = ((info->vmsi_addr & MSI_ADDR_LOG) != MSI_ADDR_LOG);
calcvdest(vm, &vdmask, dest, phys);
@ -97,10 +97,9 @@ static void ptdev_build_physical_msi(struct vm *vm, struct ptdev_msi_info *info,
/* update physical dest mode & dest field */
info->pmsi_addr = info->vmsi_addr;
info->pmsi_addr &= ~0xFF00CU;
info->pmsi_addr |= (uint32_t)(dest_mask << 12U) |
MSI_ADDR_RH | MSI_ADDR_LOG;
info->pmsi_addr |= (dest_mask << 12U) | MSI_ADDR_RH | MSI_ADDR_LOG;
dev_dbg(ACRN_DBG_IRQ, "MSI addr:data = 0x%x:%x(V) -> 0x%x:%x(P)",
dev_dbg(ACRN_DBG_IRQ, "MSI addr:data = 0x%llx:%x(V) -> 0x%llx:%x(P)",
info->vmsi_addr, info->vmsi_data,
info->pmsi_addr, info->pmsi_data);
}
@ -476,7 +475,7 @@ void ptdev_softirq(uint16_t pcpu_id)
msi->vmsi_data & 0xFFU,
irq_to_vector(entry->allocated_pirq));
dev_dbg(ACRN_DBG_PTIRQ,
" vmsi_addr: 0x%x vmsi_data: 0x%x",
" vmsi_addr: 0x%llx vmsi_data: 0x%x",
msi->vmsi_addr,
msi->vmsi_data);
}

View File

@ -38,10 +38,10 @@ union source_id {
/* entry per guest virt vector */
struct ptdev_msi_info {
uint32_t vmsi_addr; /* virt msi_addr */
uint64_t vmsi_addr; /* virt msi_addr */
uint32_t vmsi_data; /* virt msi_data */
uint16_t vmsi_ctl; /* virt msi_ctl */
uint32_t pmsi_addr; /* phys msi_addr */
uint64_t pmsi_addr; /* phys msi_addr */
uint32_t pmsi_data; /* phys msi_data */
int is_msix; /* 0-MSI, 1-MSIX */
};