From: Demi Marie Obenour <demi@invisiblethingslab.com>
To: Andrew Cooper <Andrew.Cooper3@citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
"Jan Beulich" <jbeulich@suse.com>,
"Roger Pau Monne" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
"George Dunlap" <George.Dunlap@citrix.com>,
"Tim (Xen.org)" <tim@xen.org>
Subject: Re: [PATCH 4/8] efi: Avoid hard-coding the various PAT constants
Date: Tue, 6 Dec 2022 12:38:19 -0500 [thread overview]
Message-ID: <Y49+DyuzcLU2PxLt@itl-email> (raw)
In-Reply-To: <4f34f039-b0b9-1761-b5d0-936f25e8a50a@citrix.com>
[-- Attachment #1: Type: text/plain, Size: 2163 bytes --]
On Tue, Dec 06, 2022 at 11:17:20AM +0000, Andrew Cooper wrote:
> On 06/12/2022 04:33, Demi Marie Obenour wrote:
> > This makes the code much easier to understand, and avoids problems if
> > Xen's PAT ever changes in the future.
> >
> > Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
> > ---
> > xen/common/efi/boot.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> > index 8e880fe30c7541a202dec3e665300d6549953aa3..260997b251b09dae4b48c1b1db665778e02d760a 100644
> > --- a/xen/common/efi/boot.c
> > +++ b/xen/common/efi/boot.c
> > @@ -1746,21 +1746,21 @@ void __init efi_init_memory(void)
> > if ( desc->Attribute & EFI_MEMORY_WB )
> > /* nothing */;
>
> This is an implicit 0 case which wants changing to _PAGE_WB.
Good catch! I will make this change in v2, but I also will add
BUILD_BUG_ON(_PAGE_WB), as at least Linux assumes that _PAGE_WB is 0.
> > else if ( desc->Attribute & EFI_MEMORY_WT )
> > - prot |= _PAGE_PWT | MAP_SMALL_PAGES;
> > + prot |= _PAGE_WT | MAP_SMALL_PAGES;
> > else if ( desc->Attribute & EFI_MEMORY_WC )
> > - prot |= _PAGE_PAT | MAP_SMALL_PAGES;
> > + prot |= _PAGE_WC | MAP_SMALL_PAGES;
> > else if ( desc->Attribute & (EFI_MEMORY_UC | EFI_MEMORY_UCE) )
> > - prot |= _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES;
> > + prot |= _PAGE_UC | MAP_SMALL_PAGES;
> > else if ( efi_bs_revision >= EFI_REVISION(2, 5) &&
> > (desc->Attribute & EFI_MEMORY_WP) )
> > - prot |= _PAGE_PAT | _PAGE_PWT | MAP_SMALL_PAGES;
> > + prot |= _PAGE_WP | MAP_SMALL_PAGES;
>
> Unrelated to the transformation. I'm unconvinced about the correctness
> of using MAP_SMALL_PAGES here. There's nothing wrong with large pages
> of reduced cache-ability, and the framebuffer is going to live in one of
> these regions, probably a WC one...
I can make that a separate patch.
--
Sincerely,
Demi Marie Obenour (she/her/hers)
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-12-06 17:38 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-06 4:33 [PATCH 0/8] Make PAT handling less brittle Demi Marie Obenour
2022-12-06 4:33 ` [PATCH 1/8] x86/mm: Avoid hard-coding PAT in get_page_from_l1e() Demi Marie Obenour
2022-12-06 10:42 ` Andrew Cooper
2022-12-06 11:07 ` Jan Beulich
2022-12-06 11:05 ` Jan Beulich
2022-12-06 4:33 ` [PATCH 2/8] p2m-pt: Avoid hard-coding Xen's PAT Demi Marie Obenour
2022-12-06 10:59 ` Andrew Cooper
2022-12-06 11:10 ` Jan Beulich
2022-12-06 4:33 ` [PATCH 3/8] x86/mm/shadow: avoid assuming a specific Xen PAT Demi Marie Obenour
2022-12-06 11:00 ` Andrew Cooper
2022-12-06 4:33 ` [PATCH 4/8] efi: Avoid hard-coding the various PAT constants Demi Marie Obenour
2022-12-06 11:15 ` Jan Beulich
2022-12-06 11:17 ` Andrew Cooper
2022-12-06 11:40 ` Jan Beulich
2022-12-06 17:38 ` Demi Marie Obenour [this message]
2022-12-06 4:33 ` [PATCH 5/8] x86/mm/shadow: do not open-code PAGE_CACHE_ATTRS Demi Marie Obenour
2022-12-06 11:17 ` Jan Beulich
2022-12-06 4:33 ` [PATCH 6/8] x86: Derive XEN_MSR_PAT from its individual entries Demi Marie Obenour
2022-12-06 11:32 ` Andrew Cooper
2022-12-06 11:43 ` Jan Beulich
2022-12-06 17:44 ` Demi Marie Obenour
2022-12-06 22:51 ` Demi Marie Obenour
2022-12-06 11:35 ` Jan Beulich
2022-12-06 4:33 ` [PATCH 7/8] x86/mm: make code robust to future PAT changes Demi Marie Obenour
2022-12-06 12:01 ` Jan Beulich
2022-12-06 12:06 ` Andrew Cooper
2022-12-06 17:55 ` Demi Marie Obenour
2022-12-07 9:41 ` Jan Beulich
2022-12-07 12:14 ` Andrew Cooper
2022-12-06 4:33 ` [RFC PATCH 8/8] Use Linux's PAT Demi Marie Obenour
2022-12-06 11:38 ` Andrew Cooper
2022-12-06 18:01 ` Demi Marie Obenour
2022-12-06 18:12 ` Marek Marczykowski-Górecki
2022-12-06 19:47 ` Demi Marie Obenour
2022-12-06 20:53 ` Marek Marczykowski-Górecki
2022-12-13 1:31 ` 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=Y49+DyuzcLU2PxLt@itl-email \
--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.