xen/arm: don't add duplicate boot modules, introduce domU flag
authorStefano Stabellini <sstabellini@kernel.org>
Tue, 13 Nov 2018 16:57:19 +0000 (08:57 -0800)
committerJulien Grall <julien.grall@arm.com>
Wed, 14 Nov 2018 19:34:47 +0000 (19:34 +0000)
commit9270e838465ed15639ee9f185f3252f6cdc2db26
tree1309abab333b41f327dbe028b6e0792e0cfa9bf3
parent7c399fb0e7dd82fb6a0dda40c60f3908cf052fb0
xen/arm: don't add duplicate boot modules, introduce domU flag

Don't add duplicate boot modules (same kind and same start address),
they are freed later, we don't want to introduce double-free errors.

Introduce a domU flag in struct bootmodule and struct bootcmdline. Set
it for kernels and ramdisks of "xen,domain" nodes to avoid getting
confused in kernel_probe, where we try to guess which is the dom0 kernel
and initrd to be compatible with all versions of the multiboot spec.

boot_module_find_by_kind and boot_cmdline_find_by_kind automatically
check for !domU entries (they are only used for non-domU modules).

Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
Reviewed-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/bootfdt.c
xen/arch/arm/setup.c
xen/include/asm-arm/setup.h