vfio: support 64KB kernel page size
authorTone Zhang <tone.zhang@arm.com>
Wed, 12 Dec 2018 11:25:59 +0000 (19:25 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 19 Dec 2018 23:12:20 +0000 (00:12 +0100)
commit9cea8774cf1c466cdd6dc8bade4350cc28161905
tree0c00f8f362ef8b1418e78b2e40d4a3cae4731f2b
parent32fa7f8913930be9bb44995e391b5c6b2a88efb6
vfio: support 64KB kernel page size

With a larger PAGE_SIZE it is possible for the MSI table to very
close to the end of the BAR s.t. when we align the start and end
of the MSI table to the PAGE_SIZE, the end offset of the MSI
table is out of the PCI BAR boundary.

This patch addresses the issue by comparing both the start and the
end offset of the MSI table with the BAR size, and skip the mapping
if it is out of Bar scope.

The patch fixes the debug log as below:
EAL: Skipping BAR0

Signed-off-by: Tone Zhang <tone.zhang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Steve Capper <steve.capper@arm.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
drivers/bus/pci/linux/pci_vfio.c