mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vfio: fix vfio device fail to initialize issue for 64k page size
Currently, vfio device fails to initialize as the msix-cap region in BAR is mapped as RW region. To resolve the initialization issue, this commit avoids mapping the msix-cap region in the BAR. However, this solution introduces another problem where aligning the msix table offset in the BAR to the page size may cause overlap with the MMIO RW region, leading to reduced performance. By enlarging the entire region in the BAR and relocating the msix table to achieve page size alignment, this problem can be overcomed effectively. Fixes: #5292 Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
This commit is contained in:
committed by
Michael Zhao
parent
5a9dd7489c
commit
a718716831
@@ -511,6 +511,16 @@ impl MsixCap {
|
||||
self.pba & 0xffff_fff8
|
||||
}
|
||||
|
||||
pub fn table_set_offset(&mut self, addr: u32) {
|
||||
self.table &= 0x7;
|
||||
self.table += addr;
|
||||
}
|
||||
|
||||
pub fn pba_set_offset(&mut self, addr: u32) {
|
||||
self.pba &= 0x7;
|
||||
self.pba += addr;
|
||||
}
|
||||
|
||||
pub fn table_bir(&self) -> u32 {
|
||||
self.table & 0x7
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user