]> xenbits.xensource.com Git - xen.git/commit
x86/ept: force WB cache attributes for grant and foreign maps
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 17 Jun 2021 16:00:57 +0000 (18:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 17 Jun 2021 16:00:57 +0000 (18:00 +0200)
commit8af4b47f061edf6450f2b0a0a8134fdf1c13b3e5
tree2490a5e90c6f53a01dcb67c96f4aecfd32588416
parented464d4e8a9a49559307c96ee6aa59e97820f692
x86/ept: force WB cache attributes for grant and foreign maps

Force WB type for grants and foreign pages. Those are usually mapped
over unpopulated physical ranges in the p2m, and those ranges would
usually be UC in the MTRR state, which is unlikely to be the correct
cache attribute. It's also cumbersome (or even impossible) for the
guest to be setting the MTRR type for all those mappings as WB, as
MTRR ranges are finite.

Note that this is not an issue on AMD because WB cache attribute is
already set on grants and foreign mappings in the p2m and MTRR types
are ignored. Also on AMD Xen cannot force a cache attribute because of
the lack of ignore PAT equivalent, so the behavior here slightly
diverges between AMD and Intel (or EPT vs NPT/shadow).

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/mm/p2m-ept.c
xen/include/asm-x86/hvm/vmx/vmx.h