mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/vpci: allow unaligned accesses by the hardware domain
It's possible for domains to generate unaligned PCI config space accesses
when using ECAM, and hence vPCI should support those at least for the
hardware domain. Such unaligned accesses to the PCI config space have been
reported to come from ACPI logic.
Relax the checking in vpci_access_allowed() to allow such accesses for the
hardware domain, and fix the handling in pci_conf_{read,write}{16,32}() to
fulfill them using MMCFG.
MMCFG regions are identity exposed to the hardware domain, and hence such
unaligned accesses can only come as a result of the host having MMCFG in the
first place, as otherwise MMCFG won't be exposed to the hardware domain
either.
Note that vpci_ecam_{read,write}() already refuse accesses that cross a
device boundary unconditionally.
Reported-by: Jason Andryuk <jason.andryuk@amd.com>
Signed-off-by: Roger Pau Monné <roger@xenproject.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
This commit is contained in:
1 parent
6acdfad3da
commit
79175b1390
3 files changed
+10
-6
No files matched your search
@@ -68,6 +68,8 @@
|
||||
})
|
||||
#endif
|
||||
|
||||
#define IS_ALIGNED(val, align) (!((val) & ((align) - 1)))
|
||||
|
||||
#define ROUNDUP(x, a) (((x) + (a) - 1) & ~((a) - 1))
|
||||
#define ROUNDDOWN(x, a) ((x) & ~((a) - 1))
|
||||
|
||||
|
||||