mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-21 20:15:21 +00:00
pci: Fix MSI-X table and PBA offsets
The offsets returned by the table_offset() and pba_offset() function were wrong as they were shifting the value by 3 bits. The MSI-X spec defines the MSI-X table and PBA offsets as being defined on 3-31 bits, but this does not mean it has to be shifted. Instead, the address is still on 32 bits and assumes the LSB bits 0-2 are set to 0. VFIO was working fine with devices were the MSI-X offset were 0x0, but the bug was found on a device where the offset was non-null. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
baec27698e
commit
a548a01423
@ -359,11 +359,11 @@ impl MsixCap {
|
||||
}
|
||||
|
||||
pub fn table_offset(&self) -> u32 {
|
||||
self.table >> 3
|
||||
self.table & 0xffff_fff8
|
||||
}
|
||||
|
||||
pub fn pba_offset(&self) -> u32 {
|
||||
self.pba >> 3
|
||||
self.pba & 0xffff_fff8
|
||||
}
|
||||
|
||||
pub fn table_bir(&self) -> u32 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user