From 19e1b9675f905f040d65d90d53749c46d4df67cf Mon Sep 17 00:00:00 2001 From: Zide Chen Date: Mon, 15 Oct 2018 22:26:14 -0700 Subject: [PATCH] hv: MSI Message Address should be 64 bits Tracked-On: #1568 Signed-off-by: dongshen Signed-off-by: Zide Chen Reviewed-by: Li, Fei1 --- hypervisor/arch/x86/assign.c | 9 ++++----- hypervisor/include/common/ptdev.h | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/hypervisor/arch/x86/assign.c b/hypervisor/arch/x86/assign.c index b4a9c08bb..e421f5a55 100644 --- a/hypervisor/arch/x86/assign.c +++ b/hypervisor/arch/x86/assign.c @@ -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); } diff --git a/hypervisor/include/common/ptdev.h b/hypervisor/include/common/ptdev.h index fc1878585..9056e345e 100644 --- a/hypervisor/include/common/ptdev.h +++ b/hypervisor/include/common/ptdev.h @@ -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 */ };