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

Re: [PATCH v2] x86/hvm/dom0: fix PVH initrd and metadata placement



On Mon, Oct 30, 2023 at 03:32:40PM +0200, Xenia Ragiadakou wrote:
> Given that start < kernel_end and end > kernel_start, the logic that
> determines the best placement for dom0 initrd and metadata, does not
> take into account the three cases below:
> (1) start > kernel_start && end > kernel_end
> (2) start < kernel_start && end < kernel_end
> (3) start > kernel_start && end < kernel_end
> 
> In case (1), the evaluation will result in end = kernel_start,
> i.e. end < start, and will load initrd in the middle of the kernel.
> In case (2), the evaluation will result in start = kernel_end,
> i.e. end < start, and will load initrd at kernel_end, that is out
> of the memory region under evaluation.
> In case (3), the evaluation will result in either end = kernel_start
> or start = kernel_end but in both cases will be end < start, and
> will either load initrd in the middle of the image, or arbitrarily
> at kernel_end.
> 
> This patch reorganizes the conditionals to include so far unconsidered
> cases as well, uniformly returning the lowest available address.

It would be good to mention that this was discovered because Zephyr
has multiple loaded segments in non-contiguous ranges, so that we know
what triggered the change and how we could test further improvements
(like the usage of a rangeset).

> 
> Fixes: 73b47eea2104 ('x86/dom0: improve PVH initrd and metadata placement')
> Signed-off-by: Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

With the commit message adjusted preferably.

Thanks, Roger.



 


Rackspace

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