From: "Roger Pau Monné" <roger@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Teddy Astie <teddy.astie@vates.tech>,
Marek Marczykowski <marmarek@invisiblethingslab.com>
Subject: Re: [PATCH 11/15] x86/PVH: try to map initrd directly into Dom0
Date: Thu, 5 Nov 2026 10:33:04 +0100 [thread overview]
Message-ID: <auxNUJMOXVx1yJMt@Mac.lan> (raw)
In-Reply-To: <1d458862-d4d1-4b5a-8a38-983a725900c3@suse.com>
On Thu, Nov 05, 2026 at 09:45:56AM +0100, Jan Beulich wrote:
> On 05.11.2026 09:37, Roger Pau Monné wrote:
> > On Thu, Nov 05, 2026 at 09:06:15AM +0100, Jan Beulich wrote:
> >> On 15.10.2026 18:32, Roger Pau Monné wrote:
> >>> On Mon, Oct 12, 2026 at 10:25:11AM +0200, Jan Beulich wrote:
> >>>> Why does find_memory() go upwards, while find_kernel_memory() goes
> >>>> downwards? And why do we use the lowest part of the region found by
> >>>> find_memory() rather than the highest part?
> >>>
> >>> find_memory() should probably start downwards from 4G.
> >>
> >> In the course of replacing that find_memory() by pvh_steal_ram() (while
> >> converting to rangeset-based tracking) I learned the hard way that this
> >> isn't possible, even if it ought to be. Linux won't cope with parts of
> >> start-info (at least the module array) living outside of the first Gb
> >> (in 32-bit Linux it may go farther, depending on CONFIG_PAGE_OFFSET).
> >
> > I assume start_info itself also needs to be < 1G then?
>
> Looks like it isn't, as that's getting copied before enabling paging.
>
> >> See pvh_level3_ident_pgt[] having only its first direct-map entry
> >> populated, and pvh_start_xen() also only updating that one entry. Which
> >> causes xen_prepare_pvh() -> init_pvh_bootparams() to fall over anything
> >> living beyond the 1Gb boundary. (.memmap_paddr would apparently have
> >> the same issue, just that for Dom0 we don't set that.)
> >
> > Hm, that's unfortunate. We should fix Linux to the bootstrap
> > page-tables identity map the whole low 4G.
>
> Blindly mapping the first Gb as Linux does is already a problem imo:
> In the first Mb there very likely is MMIO, which shouldn't be mapped WB.
> Further up there may be MMIO as well, yet maybe that's unlikely. Up from
> 1Gb and below 4Gb there definitely is MMIO again.
Possibly more problematic on AMD than Intel: on Intel we use iPAT to
force UC for MMIO regardless of what the guest has in the gmtrr or the
guest PAT (as nasty as iPAT is).
Hm, since we create those bootstrap page-tables using superpages,
there's also the possibility of a page-table entry overlapping two
MTRR regions, at which will result in undefined caching attributes.
> > In the meantime, we keep
> > allocating upwards, and hope we don't cross the 1G boundary.
>
> A hope which breaks with an initrd big enough to fit below 4Gb, but too
> bit to fit in the first Gb.
Building a more complete boostrap page-tables will be complex.
Thanks, Roger.
next prev parent reply other threads:[~2026-11-05 9:33 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 8:17 [PATCH 00/15] x86: PVH Dom0 loading rework Jan Beulich
2026-10-12 8:19 ` [PATCH 01/15] x86/EFI: guard against oversized modules Jan Beulich
2026-10-12 10:12 ` George Dunlap
2026-11-05 11:32 ` Marek Marczykowski
2026-10-12 8:19 ` [PATCH 02/15] x86/PV: make better use of assign_pages() Jan Beulich
2026-10-12 10:16 ` George Dunlap
2026-10-12 8:20 ` [PATCH 03/15] x86/setup: break out E820_RAM accumulation Jan Beulich
2026-10-12 10:20 ` George Dunlap
2026-10-12 10:23 ` Jan Beulich
2026-10-12 11:24 ` George Dunlap
2026-10-13 11:05 ` Roger Pau Monné
2026-10-13 11:39 ` Jan Beulich
2026-10-12 8:20 ` [PATCH 04/15] x86/setup: special treatment of initrd for PVH Dom0 Jan Beulich
2026-10-12 11:23 ` George Dunlap
2026-10-12 11:51 ` Jan Beulich
2026-10-12 18:58 ` George Dunlap
2026-10-12 8:21 ` [PATCH 05/15] x86/PVH: split pvh_load_kernel() Jan Beulich
2026-10-13 6:45 ` Teddy Astie
2026-10-12 8:21 ` [PATCH 06/15] x86/PVH: keep a copy of Dom0's initial E820 map Jan Beulich
2026-10-13 6:57 ` Teddy Astie
2026-10-13 7:56 ` Jan Beulich
2026-10-13 13:48 ` Roger Pau Monné
2026-10-13 14:53 ` Jan Beulich
2026-10-13 15:08 ` Roger Pau Monné
2026-10-12 8:22 ` [PATCH 07/15] x86/PVH: lift E820 alignment requirement Jan Beulich
2026-10-13 14:59 ` Roger Pau Monné
2026-10-13 15:13 ` Jan Beulich
2026-10-12 8:23 ` [PATCH 08/15] x86/PVH: split pvh_setup_acpi() Jan Beulich
2026-10-13 15:52 ` Roger Pau Monné
2026-10-13 16:04 ` Jan Beulich
2026-10-14 9:31 ` Roger Pau Monné
2026-10-14 9:42 ` Jan Beulich
2026-10-15 15:05 ` Roger Pau Monné
2026-10-12 8:24 ` [PATCH 09/15] x86/PVH: split pvh_setup_vmx_realmode_helpers() Jan Beulich
2026-10-14 9:38 ` Roger Pau Monné
2026-10-14 9:49 ` Jan Beulich
2026-10-12 8:24 ` [PATCH 10/15] x86/PVH: convert find_memory() to using a rangeset Jan Beulich
2026-10-15 15:20 ` Roger Pau Monné
2026-10-16 8:43 ` Jan Beulich
2026-10-12 8:25 ` [PATCH 11/15] x86/PVH: try to map initrd directly into Dom0 Jan Beulich
2026-10-15 16:32 ` Roger Pau Monné
2026-10-16 8:52 ` Jan Beulich
2026-11-05 8:06 ` Jan Beulich
2026-11-05 8:37 ` Roger Pau Monné
2026-11-05 8:45 ` Jan Beulich
2026-11-05 9:33 ` Roger Pau Monné [this message]
2026-11-05 10:40 ` Jan Beulich
2026-10-15 17:41 ` Roger Pau Monné
2026-10-16 8:58 ` Jan Beulich
2026-10-16 9:01 ` Roger Pau Monné
2026-10-16 9:12 ` Jan Beulich
2026-10-19 9:20 ` Roger Pau Monné
2026-10-12 8:25 ` [PATCH 12/15] x86/PVH: heed the kernel in pvh_steal_ram() Jan Beulich
2026-10-16 7:16 ` Roger Pau Monné
2026-11-04 10:11 ` Jan Beulich
2026-10-12 8:26 ` [PATCH 13/15] x86/PVH: prefer smaller E820 regions for stealing from Jan Beulich
2026-10-12 8:26 ` [PATCH 14/15] x86/PVH: log Dom0's E820 map earlier Jan Beulich
2026-10-16 7:24 ` Roger Pau Monné
2026-10-16 9:01 ` Jan Beulich
2026-10-12 8:26 ` [PATCH 15/15] x86/PVH: simplify writing of Dom0's RSDP Jan Beulich
2026-10-16 7:34 ` Roger Pau Monné
2026-10-16 9:04 ` Jan Beulich
2026-10-12 8:29 ` [PATCH 00/15] x86: PVH Dom0 loading rework Jan Beulich
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=auxNUJMOXVx1yJMt@Mac.lan \
--to=roger@xenproject.org \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=marmarek@invisiblethingslab.com \
--cc=teddy.astie@vates.tech \
--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.