x86: fix pinned cache attribute handling
authorJan Beulich <jbeulich@suse.com>
Thu, 10 Apr 2014 14:07:17 +0000 (16:07 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 10 Apr 2014 14:07:17 +0000 (16:07 +0200)
commit4d66f069d6abacd392f1301714fdfc64dc92917b
tree7e1d9ec96d5a35645ab48114afb566e86c4a82e5
parent6afff051a28bb873f9ad4d8ca678b8f0d1b4f089
x86: fix pinned cache attribute handling

- make sure UC- is only used for PAT purposes (MTRRs and hence EPT
  don't have this type)
- add order input to "get", and properly handle conflict case (forcing
  an EPT page split)
- properly detect (and refuse) overlaps during "set"
- properly use RCU constructs
- support deleting ranges through a special type input to "set"
- set ignore-PAT flag in epte_get_entry_emt() when "get" succeeds
- set "get" output to ~0 (invalid) rather than 0 (UC) on error (the
  caller shouldn't be looking at it anyway)
- move struct hvm_mem_pinned_cacheattr_range from header to C file
  (used only there)

Note that the code (before and after this change) implies the GFN
ranges passed to the hypercall to be inclusive, which is in contrast
to the sole current user in qemu (all variants). It is not clear to me
at which layer (qemu, libxc, hypervisor) this would best be fixed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/mtrr.c
xen/arch/x86/mm/shadow/multi.c
xen/include/asm-x86/hvm/cacheattr.h
xen/include/public/domctl.h