[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 0/7] Fixes to pagetable handling



This series has been a long time in preparation (i.e. most of the 4.8 and 4.9
dev cycles).  It started when I tried to make an XTF PoC for XSA-176, and
stumbled upon the the _PAGE_PAGED aliasing issue (see patch 7) which caused by
PoC to be descheduled waiting for (a non-existent) paging agent to respond.

This series is built upon:
  1) The switch to using _Bool. I spent rather too long trying to debug why
     CR0.WP wasn't behaving properly, and it was down to static inline bool_t
     guest_wp_enabled().
  2) The series to switch emulation to using system-segment relative memory
     accesses (directly relevant to patches 1 and 2), which in turn resulted
     in the discovery of XSA-191.
  3) The CPUID improvement work to get maxphysaddr into a sensibly audited
     state, and sensibly accessible location.

Outstanding hardware issues discovered include:
  1) There is an observable delay in AMD Fam 10h processors between loading a
     segment selector, and the results of the LDT/GDT memory access being
     visible in the pagetables (via the Access bits being set).
  2) SMAP provides insufficient information to the pagefault handler (via the
     error code) to fully determine the nature of the access causing the
     pagefault in the first place.  See patch 2 for details.

Andrew Cooper (7):
  x86/hvm: Correctly identify implicit supervisor accesses
  x86/shadow: Try to correctly identify implicit supervisor accesses
  x86/pagewalk: Helpers for reserved bit handling
  x86/hvm: Adjust hvm_nx_enabled() to match how Xen behaves
  x86/shadow: Use the pagewalk reserved bits helpers
  x86/pagewalk: Consistently use guest_walk_*() helpers for translation
  x86/pagewalk: Re-implement the pagetable walker

 xen/arch/x86/hvm/emulate.c        |  18 +-
 xen/arch/x86/mm/guest_walk.c      | 444 ++++++++++++++++++++------------------
 xen/arch/x86/mm/hap/guest_walk.c  |  23 +-
 xen/arch/x86/mm/hap/nested_ept.c  |   2 +-
 xen/arch/x86/mm/p2m.c             |  17 +-
 xen/arch/x86/mm/shadow/multi.c    | 108 +++++++---
 xen/include/asm-x86/guest_pt.h    | 180 +++++++++++++---
 xen/include/asm-x86/hvm/hvm.h     |   4 +-
 xen/include/asm-x86/p2m.h         |   2 +-
 xen/include/asm-x86/page.h        |   3 -
 xen/include/asm-x86/processor.h   |   3 +
 xen/include/asm-x86/x86_64/page.h |   6 -
 12 files changed, 489 insertions(+), 321 deletions(-)

-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.