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@lists.xenproject.org>

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

Reply via email to