All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Michal Orzel <michal.orzel@amd.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 2/5] x86/vga: fix mapping of the VGA text buffer
Date: Tue, 18 Mar 2025 16:31:07 +0100	[thread overview]
Message-ID: <Z9mRu3JCwgffgEKd@macbook.local> (raw)
In-Reply-To: <f2fa59b3-83cd-41e4-a921-5c6eaa89e759@suse.com>

On Tue, Mar 18, 2025 at 03:28:32PM +0100, Jan Beulich wrote:
> On 18.03.2025 14:11, Andrew Cooper wrote:
> > On 18/03/2025 9:19 am, Roger Pau Monne wrote:
> >> The call to ioremap_wc() in video_init() will always fail, because
> >> video_init() is called ahead of vm_init_type(), and so the underlying
> >> __vmap() call will fail to allocate the linear address space.
> >>
> >> Fix by reverting to the previous behavior and using ioremap() for the VGA
> >> text buffer.
> >>
> >> Fixes: 81d195c6c0e2 ('x86: introduce ioremap_wc()')
> >> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > 
> > This is somewhat ugly.
> > 
> > ioremap() isn't really any better than ioremap_wc(); this only works
> > because plain ioremap() has a special case for the bottom 1M where it
> > does nothing and exits.
> 
> And this is exactly why I screwed up back then. Imo we would be better
> off moving to using __va() directly here. Otherwise the same mistake
> could be made again by someone (perhaps even me) noticing the less
> efficient ioremap(), when ioremap_wc() really would be wanted.

I can switch to using __va(), that's fine.  I guess we should then
remove the special casing for the low 1MB in ioremap()?

Thanks, Roger.


  reply	other threads:[~2025-03-18 15:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18  9:18 [PATCH v2 0/5] x86/ubsan: fix ubsan on clang + code fixes Roger Pau Monne
2025-03-18  9:19 ` [PATCH v2 1/5] x86/wait: prevent duplicated assembly labels Roger Pau Monne
2025-03-18 12:49   ` Andrew Cooper
2025-03-18  9:19 ` [PATCH v2 2/5] x86/vga: fix mapping of the VGA text buffer Roger Pau Monne
2025-03-18 13:11   ` Andrew Cooper
2025-03-18 14:28     ` Jan Beulich
2025-03-18 15:31       ` Roger Pau Monné [this message]
2025-03-18 15:49         ` Jan Beulich
2025-03-18  9:19 ` [PATCH v2 3/5] x86/xlat: fix UB pointer arithmetic in COMPAT_ARG_XLAT_VIRT_BASE Roger Pau Monne
2025-03-18 12:51   ` Andrew Cooper
2025-03-18 14:33   ` Jan Beulich
2025-03-18 15:35     ` Roger Pau Monné
2025-03-18 15:50       ` Jan Beulich
2025-03-18 16:47         ` Roger Pau Monné
2025-03-18 17:01           ` Jan Beulich
2025-03-18 17:50             ` Roger Pau Monné
2025-03-18  9:19 ` [PATCH v2 4/5] x86/shadow: fix UB pointer arithmetic in sh_mfn_is_a_page_table() Roger Pau Monne
2025-03-18 12:53   ` Andrew Cooper
2025-03-18 14:36     ` Jan Beulich
2025-03-18 15:29       ` Roger Pau Monné
2025-03-18 15:27     ` Roger Pau Monné
2025-03-18  9:19 ` [PATCH v2 5/5] kconfig/randconfig: enable UBSAN for randconfig Roger Pau Monne
2025-03-18 12:57   ` Andrew Cooper

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=Z9mRu3JCwgffgEKd@macbook.local \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.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.