All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/14] Make PAT handling less brittle
@ 2022-12-13 22:26 Demi Marie Obenour
  2022-12-13 22:26 ` [PATCH v2 01/14] x86/mm: Avoid hard-coding PAT in get_page_from_l1e() Demi Marie Obenour
  0 siblings, 1 reply; 21+ messages in thread
From: Demi Marie Obenour @ 2022-12-13 22:26 UTC (permalink / raw)
  To: xen-devel
  Cc: Demi Marie Obenour, Marek Marczykowski-Górecki, Jan Beulich,
	Andrew Cooper, Roger Pau Monné,
	Wei Liu, Jun Nakajima, Kevin Tian, George Dunlap, Tim Deegan

While working on Qubes OS Marek found out that there were some PAT hacks
in the Linux i195 driver.  I decided to make Xen use Linux’s PAT to see
if it solved the graphics glitches that were observed; it did.  This
required a substantial amount of preliminary work that is useful even
without using Linux’s PAT.

Patches 1 through 13 are the preliminary work and I would like them to
be accepted into upstream Xen.  Patch 13 does break ABI by rejecting the
unused PAT entries, but this will only impact buggy PV guests and can be
disabled with a Xen command-line option.  Patch 14 actually switches to
Linux’s PAT and is NOT intended to be merged (at least for now) as it
would at a minimum break migration of PV guests from hosts that do not
have the patch.

Demi Marie Obenour (14):
  x86/mm: Avoid hard-coding PAT in get_page_from_l1e()
  p2m-pt: Avoid hard-coding Xen's PAT
  x86/mm/shadow: avoid assuming a specific Xen PAT
  efi: Avoid hard-coding the various PAT constants
  x86/mm/shadow: do not open-code PAGE_CACHE_ATTRS
  x86: Add memory type constants
  x86: Replace PAT_* with X86_MT_*
  x86: Replace MTRR_* constants with X86_MT_* constants
  x86: Replace EPT_EMT_* constants with X86_MT_*
  x86: Remove remaining uses of MTRR_* constants
  x86: Derive XEN_MSR_PAT from its individual entries
  x86/mm: make code robust to future PAT changes
  x86/mm: Reject invalid cacheability in PV guests by default
  x86: Use Linux's PAT

 xen/arch/x86/cpu/mtrr/generic.c         |  12 +--
 xen/arch/x86/cpu/mtrr/main.c            |  33 ++++----
 xen/arch/x86/e820.c                     |   4 +-
 xen/arch/x86/hvm/hvm.c                  |  12 +--
 xen/arch/x86/hvm/mtrr.c                 | 102 ++++++++++++------------
 xen/arch/x86/hvm/vmx/vmcs.c             |   2 +-
 xen/arch/x86/hvm/vmx/vmx.c              |  18 ++---
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h |   2 +-
 xen/arch/x86/include/asm/hvm/vmx/vmx.h  |   9 ---
 xen/arch/x86/include/asm/mtrr.h         |  22 +----
 xen/arch/x86/include/asm/page.h         |   4 +-
 xen/arch/x86/include/asm/processor.h    |  15 ++--
 xen/arch/x86/include/asm/x86-defns.h    |  13 +++
 xen/arch/x86/mm.c                       |  80 +++++++++++++++++--
 xen/arch/x86/mm/hap/nested_ept.c        |   4 +-
 xen/arch/x86/mm/p2m-ept.c               |  70 ++++++++--------
 xen/arch/x86/mm/p2m-pt.c                |   6 +-
 xen/arch/x86/mm/shadow/multi.c          |  16 ++--
 xen/common/efi/boot.c                   |  12 +--
 19 files changed, 248 insertions(+), 188 deletions(-)

-- 
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-12-14 11:54 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 22:26 [PATCH v2 00/14] Make PAT handling less brittle Demi Marie Obenour
2022-12-13 22:26 ` [PATCH v2 01/14] x86/mm: Avoid hard-coding PAT in get_page_from_l1e() Demi Marie Obenour
2022-12-13 22:26   ` [PATCH v2 02/14] p2m-pt: Avoid hard-coding Xen's PAT Demi Marie Obenour
2022-12-14 11:14     ` Jan Beulich
2022-12-13 22:26   ` [PATCH v2 03/14] x86/mm/shadow: avoid assuming a specific Xen PAT Demi Marie Obenour
2022-12-13 22:26   ` [PATCH v2 04/14] efi: Avoid hard-coding the various PAT constants Demi Marie Obenour
2022-12-14  9:40     ` Jan Beulich
2022-12-13 22:26   ` [PATCH v2 05/14] x86/mm/shadow: do not open-code PAGE_CACHE_ATTRS Demi Marie Obenour
2022-12-13 22:26   ` [PATCH v2 06/14] x86: Add memory type constants Demi Marie Obenour
2022-12-14 11:22     ` Jan Beulich
2022-12-13 22:26   ` [PATCH v2 07/14] x86: Replace PAT_* with X86_MT_* Demi Marie Obenour
2022-12-14 11:38     ` Jan Beulich
2022-12-13 22:26   ` [PATCH v2 08/14] x86: Replace MTRR_* constants with X86_MT_* constants Demi Marie Obenour
2022-12-14 11:54     ` Jan Beulich
2022-12-13 22:26   ` [PATCH v2 09/14] x86: Replace EPT_EMT_* constants with X86_MT_* Demi Marie Obenour
2022-12-13 22:26   ` [PATCH v2 10/14] x86: Remove remaining uses of MTRR_* constants Demi Marie Obenour
2022-12-13 22:26   ` [PATCH v2 11/14] x86: Derive XEN_MSR_PAT from its individual entries Demi Marie Obenour
2022-12-13 22:26   ` [PATCH v2 12/14] x86/mm: make code robust to future PAT changes Demi Marie Obenour
2022-12-13 22:26   ` [PATCH v2 13/14] x86/mm: Reject invalid cacheability in PV guests by default Demi Marie Obenour
2022-12-13 22:26   ` [PATCH v2 14/14] x86: Use Linux's PAT Demi Marie Obenour
2022-12-14  9:43   ` [PATCH v2 01/14] x86/mm: Avoid hard-coding PAT in get_page_from_l1e() Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.