public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
From: Arvind Sankar <nivedita@alum.mit.edu>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Arvind Sankar <nivedita@alum.mit.edu>,
	Ard Biesheuvel <ardb@kernel.org>,
	linux-efi <linux-efi@vger.kernel.org>
Subject: Re: [PATCH] efi/earlycon: Fix write-combine mapping on x86
Date: Wed, 11 Dec 2019 10:50:15 -0500	[thread overview]
Message-ID: <20191211155014.GA201667@rani.riverdale.lan> (raw)
In-Reply-To: <CAKv+Gu_=+nkcB3vEhYYBbD37UR4AJ-M2kTihAhXY+wc-Uwf=dQ@mail.gmail.com>

On Wed, Dec 11, 2019 at 03:00:46PM +0100, Ard Biesheuvel wrote:
> On Wed, 11 Dec 2019 at 12:04, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > On Wed, Dec 11, 2019 at 08:22:56AM +0000, Ard Biesheuvel wrote:
> > > (+ Andy)
> > >
> > > On Wed, 11 Dec 2019 at 00:24, Arvind Sankar <nivedita@alum.mit.edu> wrote:
> > > >
> > > > On x86, until PAT is initialized, WC translates into UC-. Since we
> > > > calculate and store pgprot_writecombine(PAGE_KERNEL) when earlycon is
> > > > initialized, this means we actually use UC- mappings instead of WC
> > > > mappings, which makes scrolling very slow.
> > > >
> > > > Instead store a boolean flag to indicate whether we want to use
> > > > writeback or write-combine mappings, and recalculate the actual pgprot_t
> > > > we need on every mapping. Once PAT is initialized, we will start using
> > > > write-combine mappings, which speeds up the scrolling considerably.
> > > >
> > > > Fixes: 69c1f396f25b ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation")
> > > > Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
> >
> > Make sense.
> > One comment below.
> >
> > > > -       if (pgprot_val(fb_prot) == pgprot_val(PAGE_KERNEL))
> > > > -               efi_fb = memremap(fb_base, screen_info.lfb_size, MEMREMAP_WB);
> > > > -       else
> > > > -               efi_fb = memremap(fb_base, screen_info.lfb_size, MEMREMAP_WC);
> > > > +       efi_fb = memremap(fb_base, screen_info.lfb_size,
> > > > +                         fb_wb ? MEMREMAP_WB : MEMREMAP_WC);
> >
> > I would really like to keep the style with if-else.
> >
I could change this part back to the if/else. Are you ok with the
ternary operator in efi_earlycon_map?
> 
> Can't we just set a global flag to MEMREMAP_WB or MEMREMAP_WC in the
> init code, and use that directly?
We can't use it directly in efi_earlycon_map though, so we still need to
translate there, and we'd need an if/else in the init code, so this
would just move the if/else from here to the init code.

  reply	other threads:[~2019-12-11 15:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 23:24 [PATCH] efi/earlycon: Fix write-combine mapping on x86 Arvind Sankar
2019-12-11  8:22 ` Ard Biesheuvel
2019-12-11 11:04   ` Andy Shevchenko
2019-12-11 14:00     ` Ard Biesheuvel
2019-12-11 15:50       ` Arvind Sankar [this message]
2019-12-11 17:37     ` Arvind Sankar
2019-12-11 18:03       ` Andy Shevchenko
2019-12-11 18:06         ` Ard Biesheuvel
2019-12-11 20:00           ` Andy Shevchenko
2019-12-12 16:56             ` Arvind Sankar
2019-12-12 16:57               ` Ard Biesheuvel

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=20191211155014.GA201667@rani.riverdale.lan \
    --to=nivedita@alum.mit.edu \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=ardb@kernel.org \
    --cc=linux-efi@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox