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

Re: [PATCH 1/2] Reduce hard-coding of PAT value


  • To: Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 5 Dec 2022 11:57:20 +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=uv9FYJlS2bgx1NUhzCCEjG4x/8BVZY4I/aG6TUPqcg0=; b=d1o706JQ0Pc8thXJysr3urDBNIJ1GiRRdO+XOLho+YLGcwgc3sdK/Wz5ynKv+wr4F68yJLPK+ynrcKO5V53u72O3dFLNMF5D5Bb9qNLH0V962/b9OMEnaD46Z69hKvFF9I0A24FqHcaXH10IF0N/YtlhFib734xlRBz/iw6625SWT9u+U/wy9I+UlkxqDh9g6O6gU7qGeixVFvg+dtcm9EX+m7IAwDGrPHetVtBqBgZRNe//Y0MxS94UnZvDLnjMTsokD0+iOl8HfEstXtq9w2zQuFIyFgwvYLxKov4MZxfJVx9bX86PuDNKD1+z5I4KTQhgMyp0836CMsbzQY5h6g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RjhA/BSUP/kQ/J43019U+mXMnXoNavJeZm00b9f+yLyX1RQsUsOTjh0wg+YLxpprDcVUW2qXJE48L7Riv2Ira/e2JV0KURqAxqI3a53HbWKd44Mg5yIZ+a4vCIxYPh3rwDQVfNEgqs37BcNW8TKx1UMAROiTHGaBsCXOln3mjrRaAvk6vz0j29374Oig4ENB9lC2rwwynA6CsoShKzBURT/27mBC0Fnl2FXqA1Zth/F/PxiXYcdWNgynCXHmXcav3gKNqoZ6MIbS9fZJAsMNHLwGTOtWc2YiQvE00EMgrF65X92XSC2pY7o/sUFA/q2KZQHLKPGU5U+taFC0EtdD1w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 05 Dec 2022 10:57:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04.12.2022 18:13, Demi Marie Obenour wrote:
> This makes the code easier to read and more robust against any future
> changes to this value.  No change in behavior (modulo bugs).
> 
> To: Xen developer discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>

Looks like you mean to send this to the list, but you actually sent it
to yourself according to my mail UI. Cc-ing the list now.

> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -961,13 +961,10 @@ get_page_from_l1e(
>  
>          switch ( l1f & PAGE_CACHE_ATTRS )
>          {
> -        case 0: /* WB */
> -            flip |= _PAGE_PWT | _PAGE_PCD;
> -            break;
> -        case _PAGE_PWT: /* WT */
> -        case _PAGE_PWT | _PAGE_PAT: /* WP */
> -            flip |= _PAGE_PCD | (l1f & _PAGE_PAT);
> -            break;
> +        case _PAGE_WB: /* WB */
> +        case _PAGE_WT: /* WT */
> +        case _PAGE_WP: /* WP */

The comments are now redundant and should hence be dropped, to improve
readability.

> --- a/xen/arch/x86/mm/shadow/multi.c
> +++ b/xen/arch/x86/mm/shadow/multi.c
> @@ -535,7 +535,7 @@ _sh_propagate(struct vcpu *v,
>      if ( guest_nx_enabled(v) )
>          pass_thru_flags |= _PAGE_NX_BIT;
>      if ( level == 1 && !shadow_mode_refcounts(d) && mmio_mfn )
> -        pass_thru_flags |= _PAGE_PAT | _PAGE_PCD | _PAGE_PWT;
> +        pass_thru_flags |= PAGE_CACHE_ATTRS;

Personally I think the switch to using PAGE_CACHE_ATTRS (here and
elsewhere) would benefit from being a separate change.

Jan



 


Rackspace

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