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

Re: [PATCH 14/15] x86/PVH: log Dom0's E820 map earlier



On Mon, Oct 12, 2026 at 10:26:24AM +0200, Jan Beulich wrote:
> Do this as soon as it's final. For debug builds also mark it final, with
> assertions put in place to make sure it won't further be altered. (For a
> release build such further altering isn't the end of the world normally,
> so the situation is left alone there.)
> 
> Switch to using %pd while moving the code up.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> --- a/xen/arch/x86/hvm/dom0_build.c
> +++ b/xen/arch/x86/hvm/dom0_build.c
> @@ -46,6 +46,9 @@
>   */
>  #define HVM_VM86_TSS_SIZE 265
>  
> +/* Marker set once Dom0's E820 isn't supposed to change anymore */
> +static bool __initdata e820_finalized;
> +
>  static unsigned int __initdata acpi_intr_overrides;
>  static struct acpi_madt_interrupt_override __initdata *intsrcovr;
>  
> @@ -195,6 +198,8 @@ static int __init pvh_steal_ram(struct d
>      struct e820entry *good = NULL;
>      unsigned int i = d->arch.nr_e820;
>  
> +    ASSERT(!e820_finalized);
> +
>      /*
>       * Alignment 0 should be set to 1, so it doesn't wrap around in the
>       * calculations below.
> @@ -241,6 +246,8 @@ static int __init pvh_add_mem_range(stru
>      struct e820entry *map;
>      unsigned int i;
>  
> +    ASSERT(!e820_finalized);
> +
>      for ( i = 0; i < d->arch.nr_e820; i++ )
>      {
>          uint64_t rs = d->arch.e820[i].addr;
> @@ -1759,6 +1766,13 @@ int __init dom0_construct_pvh(const stru
>  
>      pvh_place_initrd(bd, &elf, &initrd, &blob_start, &blob_end);
>  
> +    if ( opt_dom0_verbose )
> +    {
> +        printk("%pd memory map:\n", d);
> +        print_e820_memory_map(d->arch.e820, d->arch.nr_e820);
> +        e820_finalized = true;

You want to pull setting e820_finalized out of the if body, so it's
not tied to opt_dom0_verbose being set I think?

The rest LGTM, so:

Acked-by: Roger Pau Monné <roger@xxxxxxxxxxxxxx>

With the above change.

Thanks, Roger.



 


Rackspace

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