All of lore.kernel.org
 help / color / mirror / Atom feed
From: Demi Marie Obenour <demi@invisiblethingslab.com>
To: xen-devel@lists.xenproject.org
Cc: "Demi Marie Obenour" <demi@invisiblethingslab.com>,
	"Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	"Tim Deegan" <tim@xen.org>,
	"George Dunlap" <george.dunlap@citrix.com>
Subject: [PATCH v6 0/5] Make PAT handling less brittle
Date: Thu, 22 Dec 2022 17:31:45 -0500	[thread overview]
Message-ID: <cover.1671744225.git.demi@invisiblethingslab.com> (raw)

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 4 are the preliminary work and I would like them to be
accepted into upstream Xen.  Patch 4 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 5 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.

Only patches 4 and 5 actually change Xen’s observable behavior.
Patch 1 is a prerequisite that removes the last place where Xen
hard-codes its current PAT value.  Patch 2 is strictly cleanup.  Patch 3
makes changing the PAT much less error-prone, as problems with the PAT
or with the associated _PAGE_* constants will be detected at compile
time.

Demi Marie Obenour (5):
  x86/mm: Avoid hard-coding PAT in get_page_from_l1e()
  x86: Remove MEMORY_NUM_TYPES and NO_HARDCODE_MEM_TYPE
  x86/mm: make code robust to future PAT changes
  x86/mm: Reject invalid cacheability in PV guests by default
  x86: Use Linux's PAT

 docs/misc/xen-command-line.pandoc    |  11 ++
 xen/arch/x86/hvm/mtrr.c              |  18 ++--
 xen/arch/x86/include/asm/mtrr.h      |   2 -
 xen/arch/x86/include/asm/page.h      |   4 +-
 xen/arch/x86/include/asm/processor.h |  10 +-
 xen/arch/x86/mm.c                    | 146 ++++++++++++++++++++++++---
 xen/arch/x86/mm/shadow/multi.c       |   2 +-
 7 files changed, 162 insertions(+), 31 deletions(-)

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


             reply	other threads:[~2022-12-22 22:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 22:31 Demi Marie Obenour [this message]
2022-12-22 22:31 ` [PATCH v6 1/5] x86/mm: Avoid hard-coding PAT in get_page_from_l1e() Demi Marie Obenour
2022-12-22 22:31 ` [PATCH v6 2/5] x86: Remove MEMORY_NUM_TYPES and NO_HARDCODE_MEM_TYPE Demi Marie Obenour
2022-12-22 22:31 ` [PATCH v6 3/5] x86/mm: make code robust to future PAT changes Demi Marie Obenour
2023-01-05 14:01   ` Jan Beulich
2023-01-05 19:58     ` Andrew Cooper
2022-12-22 22:31 ` [PATCH v6 4/5] x86/mm: Reject invalid cacheability in PV guests by default Demi Marie Obenour
2023-01-05 14:30   ` Jan Beulich
2023-01-05 20:28   ` Andrew Cooper
2023-01-06  2:00     ` Demi Marie Obenour
2023-01-06  2:30       ` Marek Marczykowski-Górecki
2023-01-06  5:23         ` Demi Marie Obenour
2023-01-06  7:11     ` Jan Beulich
2022-12-22 22:31 ` [PATCH v6 5/5] x86: Use Linux's PAT Demi Marie Obenour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1671744225.git.demi@invisiblethingslab.com \
    --to=demi@invisiblethingslab.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=roger.pau@citrix.com \
    --cc=tim@xen.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.