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

Re: [PATCH v2 08/14] x86: Replace MTRR_* constants with X86_MT_* constants


  • To: Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 14 Dec 2022 12:54:17 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Qdv8Na738mTutxaTQ2Oa+Hb/dUEQRhluANPt31YL9m8=; b=T8gEZWlCXGKV9wexlFaNIbbjp9p9721oZJDUTdZvqWA+qqOEc9+m5236jWHZuyiwLhVtZqfpaoJyOUtoBUPZuogXD11ol/Dy5yFz7fQ5bMyFk9wFBHDJ24PA5n0ZXRq2WsBurS1GKgLeiyyp6MJddJ76ctC1Cd5KVBkD6nJFC1YpbDqksxqEKuilhqUSLaM84Ml353mPRU0Xe3iET1PxQdwJVvWKzsXHocXi98rVsdNierzKyVPcxTYTtqXaZn2xghKdMOaXPlmimb09bpQyfwnAo3O7YJKBXAndP9U3sSbQZtmYAQ7UUpTPn8Xg4FGZC4Yn1+hYJ9tM2lfomDs2UA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F3GdCkrtDMcs9LUchMF3+0VnPydSYfi2vPpC+7/Pc0+foGlJqe6/HnoXecfE9oRdAoi+z3ErXIankJXscPc/3zteRzzJ6aTI2lpgNsS7Cd70XCLXCHdKoSUUdilyS+1UL/tqPcNiunSHG+JpmK+BlHzN8uv8ip1wNSYetpaSFHzEeGrnDjMGqxOcWb+/3duB8t/9OMFGHdP6cWiuHQvhp1W1+nh4Vx2v+JDNdWm7jMh2XrG3hNtcvpEAyXSHmxDeyEDl967uAML55I2DXqsZXV0uN8KtT3mMJWUIhrEHjktQObYRILMVWxdgevhBIoFa7QuUpc8DDY25HBfvGz49eA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 14 Dec 2022 11:54:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

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