x86/mm: do not mark IO regions as Xen heap
authorRoger Pau Monné <roger.pau@citrix.com>
Fri, 11 Sep 2020 12:15:26 +0000 (14:15 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 11 Sep 2020 12:15:26 +0000 (14:15 +0200)
commite5a1b6f0d2070c7a03f0f2cff5126a5fea94cc4d
treee821e81e670061c0f8eac5e58a10a455f28a1b15
parentc9476c4ad72e8a1842d713c74843034c7ec6eb51
x86/mm: do not mark IO regions as Xen heap

arch_init_memory will treat all the gaps on the physical memory map
between RAM regions as MMIO and use share_xen_page_with_guest in order
to assign them to dom_io. This has the side effect of setting the Xen
heap flag on such pages, and thus is_special_page would then return
true which is an issue in epte_get_entry_emt because such pages will
be forced to use write-back cache attributes.

Fix this by introducing a new helper to assign the MMIO regions to
dom_io without setting the Xen heap flag on the pages, so that
is_special_page will return false and the pages won't be forced to use
write-back cache attributes.

Fixes: 81fd0d3ca4b2cd ('x86/hvm: simplify 'mmio_direct' check in epte_get_entry_emt()')
Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c