Re: [PATCH v3 3/3] x86/PVH: Support relocatable dom0 kernels

2024-03-25 Thread Jan Beulich
On 22.03.2024 15:24, Jason Andryuk wrote: > On 2024-03-21 09:45, Jason Andryuk wrote: >> On 2024-03-20 10:39, Jan Beulich wrote: >>> On 19.03.2024 21:58, Jason Andryuk wrote: > @@ -536,6 +565,10 @@ elf_errorstatus elf_xen_parse(struct elf_binary *elf,   parms->p2m_base = UNSET_

Re: [PATCH v3 3/3] x86/PVH: Support relocatable dom0 kernels

2024-03-22 Thread Jason Andryuk
On 2024-03-21 09:45, Jason Andryuk wrote: On 2024-03-20 10:39, Jan Beulich wrote: On 19.03.2024 21:58, Jason Andryuk wrote: @@ -536,6 +565,10 @@ elf_errorstatus elf_xen_parse(struct elf_binary *elf,   parms->p2m_base = UNSET_ADDR;   parms->elf_paddr_offset = UNSET_ADDR;   parms->

Re: [PATCH v3 3/3] x86/PVH: Support relocatable dom0 kernels

2024-03-21 Thread Jan Beulich
On 21.03.2024 14:45, Jason Andryuk wrote: > On 2024-03-20 10:39, Jan Beulich wrote: >> On 19.03.2024 21:58, Jason Andryuk wrote: >>> +/* Find an e820 RAM region that fits the kernel at a suitable alignment. */ >>> +static paddr_t __init find_kernel_memory( >>> +const struct domain *d, struct el

Re: [PATCH v3 3/3] x86/PVH: Support relocatable dom0 kernels

2024-03-21 Thread Jason Andryuk
On 2024-03-20 10:39, Jan Beulich wrote: On 19.03.2024 21:58, Jason Andryuk wrote: --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -537,6 +537,97 @@ static paddr_t __init find_memory( return INVALID_PADDR; } +static bool __init check_load_address( +const

Re: [PATCH v3 3/3] x86/PVH: Support relocatable dom0 kernels

2024-03-20 Thread Stefano Stabellini
On Wed, 20 Mar 2024, Jan Beulich wrote: > On 19.03.2024 21:58, Jason Andryuk wrote: > > --- a/xen/arch/x86/hvm/dom0_build.c > > +++ b/xen/arch/x86/hvm/dom0_build.c > > @@ -537,6 +537,97 @@ static paddr_t __init find_memory( > > return INVALID_PADDR; > > } > > > > +static bool __init check_l

Re: [PATCH v3 3/3] x86/PVH: Support relocatable dom0 kernels

2024-03-20 Thread Jan Beulich
On 19.03.2024 21:58, Jason Andryuk wrote: > --- a/xen/arch/x86/hvm/dom0_build.c > +++ b/xen/arch/x86/hvm/dom0_build.c > @@ -537,6 +537,97 @@ static paddr_t __init find_memory( > return INVALID_PADDR; > } > > +static bool __init check_load_address( > +const struct domain *d, const struct

[PATCH v3 3/3] x86/PVH: Support relocatable dom0 kernels

2024-03-19 Thread Jason Andryuk
Xen tries to load a PVH dom0 kernel at the fixed guest physical address from the elf headers. For Linux, this defaults to 0x100 (16MB), but it can be configured. Unfortunately there exist firmwares that have reserved regions at this address, so Xen fails to load the dom0 kernel since it's not