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

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



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_load_address(
> > +    const struct domain *d, const struct elf_binary *elf)
> > +{
> > +    paddr_t kernel_start = (paddr_t)elf->dest_base;
> 
> As before I think it is illegitimate to cast a pointer to paddr_t. The
> variable type wants to remain such, but the cast wants to be to
> unsigned long or uintptr_t (or else at least a comment wants adding).

uintptr_t is a good suggestion. uintptr_t is the recommended way by the
C standard and MISRA by extension to cast integers to points and vice
versa. In Xen we have used unsigned long for the same purpose although it
is not the best way any longer (something else to document).



 


Rackspace

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