> -----Original Message----- > From: Roger Pau Monne <roger....@citrix.com> > Sent: 09 September 2020 15:51 > To: xen-devel@lists.xenproject.org > Cc: Roger Pau Monne <roger....@citrix.com>; Jan Beulich <jbeul...@suse.com>; > Andrew Cooper > <andrew.coop...@citrix.com>; Wei Liu <w...@xen.org>; Paul Durrant > <p...@xen.org> > Subject: [PATCH] x86/hvm: don't treat MMIO pages as special ones regarding > cache attributes > > MMIO regions below the maximum address on the memory map can have a > backing page struct that's shared with dom_io (see x86 > arch_init_memory and it's usage of share_xen_page_with_guest), and > thus also fulfill the is_special_page check because the page has the > Xen heap bit set. > > This is incorrect for MMIO regions when is_special_page is used by > epte_get_entry_emt, as it will force direct MMIO regions mapped into > the guest p2m to have the cache attributes set to write-back. > > Add an extra check in epte_get_entry_emt in order to detect pages > shared with dom_io (ie: MMIO regions) and don't force them to > write-back cache type on that case. > > Fixes: 81fd0d3ca4b2cd ('x86/hvm: simplify 'mmio_direct' check in > epte_get_entry_emt()') > Signed-off-by: Roger Pau Monné <roger....@citrix.com> > --- > Cc: Paul Durrant <p...@xen.org>
This looks like the right thing to do... Reviewed-by: Paul Durrant <p...@xen.org>