Skip to content

Commit 09fd590

Browse files
committed
CP-308875: set Xen PCI MMIO BAR to WB
The default for the Xen PCI MMIO BAR is UnCachable. Setting this to WriteBack in the MTRR shows a massive performance improvement on AMD, at least for Linux guests. On Intel this is already set to WriteBack by Xen via another mechanism. To be effective this also requires the corresponding [Xen commit](https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=22650d6054625be10172fe0c78b9cadd1a39bd63), old versions will just ignore this xenstore key. The optimization is not enabled by default in Xen due to the wide range of guests it supports, but XAPI supports a much narrower set of guest OSes. Setting the cache attribute to WB is done by setting UC=0. Signed-off-by: Edwin Török <[email protected]>
1 parent 44ae9d5 commit 09fd590

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ocaml/xenopsd/scripts/qemu-wrapper

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def main(argv):
148148

149149
# don't allow hvmloader to change the lower MMIO hole size
150150
xenstore_write("/local/domain/%d/hvmloader/allow-memory-relocate" % domid, "0")
151+
xenstore_write("/local/domain/%d/hvmloader/pci/xen-platform-pci-bar-uc" % domid, "0")
151152
# prepare the correct set of ACPI tables in hvmloader
152153
xenstore_write("/local/domain/%d/platform/device-model" % domid, "qemu_xen")
153154

0 commit comments

Comments
 (0)