All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Demi Marie Obenour <demi@invisiblethingslab.com>
Cc: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	"Jun Nakajima" <jun.nakajima@intel.com>,
	"Kevin Tian" <kevin.tian@intel.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Tim Deegan" <tim@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 08/14] x86: Replace MTRR_* constants with X86_MT_* constants
Date: Wed, 14 Dec 2022 12:54:17 +0100	[thread overview]
Message-ID: <933cd359-7b79-0261-825c-2b5ca1c7a917@suse.com> (raw)
In-Reply-To: <fec68f62fcea8fe7f6cf6e7963ea4c6b30ea5166.1670948141.git.demi@invisiblethingslab.com>

On 13.12.2022 23:26, Demi Marie Obenour wrote:
> This allows eliminating most of the former.  No functional change
> intended.

"most" would be nice to accompany by what has to stay, and for what reason.
Is this solely about MTRR_NUM_TYPES or more?

> --- a/xen/arch/x86/include/asm/mtrr.h
> +++ b/xen/arch/x86/include/asm/mtrr.h
> @@ -3,12 +3,6 @@
>  
>  #include <xen/mm.h>
>  
> -/* These are the region types. They match the architectural specification. */
> -#define MTRR_TYPE_UNCACHABLE 0
> -#define MTRR_TYPE_WRCOMB     1
> -#define MTRR_TYPE_WRTHROUGH  4
> -#define MTRR_TYPE_WRPROT     5
> -#define MTRR_TYPE_WRBACK     6
>  #define MTRR_NUM_TYPES       7

May I suggest to use X86_MT_UCM here, matching the transformation you
do ...

> @@ -1426,12 +1426,12 @@ void ept_p2m_uninit(struct p2m_domain *p2m)
>  static const char *memory_type_to_str(unsigned int x)
>  {
>      static const char memory_types[8][3] = {
> -        [MTRR_TYPE_UNCACHABLE]     = "UC",
> -        [MTRR_TYPE_WRCOMB]         = "WC",
> -        [MTRR_TYPE_WRTHROUGH]      = "WT",
> -        [MTRR_TYPE_WRPROT]         = "WP",
> -        [MTRR_TYPE_WRBACK]         = "WB",
> -        [MTRR_NUM_TYPES]           = "??"
> +        [X86_MT_UC]  = "UC",
> +        [X86_MT_WC]  = "WC",
> +        [X86_MT_WT]  = "WT",
> +        [X86_MT_WP]  = "WP",
> +        [X86_MT_WB]  = "WB",
> +        [X86_MT_UCM] = "??",

... here (and where I wonder whether MTRR_NUM_TYPES wouldn't better be
kept).

Jan


  reply	other threads:[~2022-12-14 11:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=933cd359-7b79-0261-825c-2b5ca1c7a917@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=demi@invisiblethingslab.com \
    --cc=george.dunlap@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.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.