[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot boot PVH dom0 with big initrd


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 16 Feb 2026 09:48:41 +0100
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 16 Feb 2026 08:48:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.02.2026 09:40, Roger Pau Monné wrote:
> On Mon, Feb 16, 2026 at 09:11:29AM +0100, Jan Beulich wrote:
>> On 13.02.2026 16:56, Roger Pau Monné wrote:
>>> On Fri, Feb 13, 2026 at 09:56:42AM +0100, Jan Beulich wrote:
>>>> On 13.02.2026 05:02, Marek Marczykowski-Górecki wrote:
>>>>> Hi,
>>>>>
>>>>> After fixing the xhci crash, I hit another issue - booting with 236MB
>>>>> initrd doesn't work, I get:
>>>>>
>>>>>     (XEN) [    3.151856] *** Building a PVH Dom0 ***
>>>>>     ...
>>>>>     (XEN) [    3.593940] Unable to allocate memory with order 0!
>>>>>     (XEN) [    3.597110] Failed to setup Dom0 physical memory map
>>>>>     (XEN) [    3.599884] 
>>>>>     (XEN) [    3.602482] ****************************************
>>>>>     (XEN) [    3.605272] Panic on CPU 0:
>>>>>     (XEN) [    3.607928] Could not construct d0
>>>>>     (XEN) [    3.610692] ****************************************
>>>>>     (XEN) [    3.613463] 
>>>>>     (XEN) [    3.616035] Reboot in five seconds...
>>>>>     (XEN) [    8.626565] Resetting with ACPI MEMORY or I/O RESET_REG.
>>>>>
>>>>> Full console log: 
>>>>> https://gist.github.com/marmarek/c9dbc87bf07b76f2899781755762f565
>>>>>
>>>>> If I skip initrd, then it boots just fine (but dom0 is not happy about
>>>>> that). 164MB initrd failed too, but 13MB started ok.
>>>>> Just in case, I tried skipping XHCI console, but it didn't change
>>>>> anything.
>>>>>
>>>>> Host has 16GB of memory, and there is no dom0_mem= parameter. Xen is
>>>>> started from GRUB, using MB2+EFI.
>>>>
>>>> Hmm, yes, there's an ordering issue: Of course we free initrd space (as 
>>>> used
>>>> for passing from the boot loader to Xen) only after copying to the 
>>>> designated
>>>> guest area. Yet dom0_compute_nr_pages(), intentionally, includes the space 
>>>> in
>>>> its calculation (adding initial_images_nrpages()'s return value). PV Dom0
>>>> isn't affected because to load huge initrd there, the kernel has to request
>>>> the initrd to not be mapped into the initial allocation.
>>>
>>> Right, on PV dom0 we do not copy the image to a new set of pages, we
>>> simply assign the pages where the initrd resides to the domain.  We
>>> can't populate those pages in the p2m as-is, otherwise we would
>>> shatter super pages.
>>>
>>> I think the fix below should do it, it's likely the best we can do.
>>
>> That's at best a workaround imo. We definitely can do better, and the bigger
>> the initrd, the more important it may be that we actually do.
> 
> See the second patch I gave to Marek.  That one is slightly better by
> accounting for the initial images space as part of the reserved space.

Will check; didn't make it there, yet.

>> One option may
>> be to similarly use the pages directly (i.e. by assigning rather than
>> copying), accepting that we may not be able to use large page mappings then
>> for the respective GFN range.
> 
> Hm, there's always going to be a trade-off.  I think I would prefer
> having 1G pages in the p2m, rather than a bit more memory due to
> direct adding the initrd into the p2m.

"A bit more" may not get it, when considering e.g. a 2Gb initrd on a 4Gb
system. And of course "use pages directly" is only the simplest of the
possible approaches. We could "shift" the initrd some, or we could make
sure to allocate a 2Mb or 1Gb aligned region to hold it right from the
beginning.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.