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

Re: [Xen-devel] [PATCH 12/14] libxc: support for arm64 Image format



On Sat, 2013-11-02 at 12:47 +1300, Matthew Daley wrote:
> On Sat, Nov 2, 2013 at 12:20 AM, Ian Campbell <ian.campbell@xxxxxxxxxx> wrote:

> > +    zimage =  dom->kernel_blob;
> > +    if ( zimage->magic0 != ZIMAGE64_MAGIC_V0 &&
> > +         zimage->magic1 != ZIMAGE64_MAGIC_V1 )
> 
> Is this && meant to be ||?

There are two distinct versions of the zImage header on ARM64, each with
a different magic at a different location.

> > +    {
> > +        xc_dom_printf(dom->xch, "%s: kernel is not an arm64 Image", 
> > __FUNCTION__);
> > +        return -EINVAL;
> > +    }
> > +
> > +    return 0;
> > +}
> > +
> > +static int xc_dom_parse_zimage64_kernel(struct xc_dom_image *dom)
> > +{
> > +    struct zimage64_hdr *zimage;
> > +    uint32_t entry_addr;
> > +    uint64_t v_start, v_end;
> > +    uint64_t rambase = dom->rambase_pfn << XC_PAGE_SHIFT;
> > +
> > +    DOMPRINTF_CALLED(dom->xch);
> > +
> > +    zimage = dom->kernel_blob;
> > +
> > +    v_start = rambase + zimage->text_offset;
> > +    v_end = v_start + dom->kernel_size;
> > +
> > +    entry_addr = v_start;
> > +
> > +    /* find kernel segment */
> > +    dom->kernel_seg.vstart = v_start;
> > +    dom->kernel_seg.vend   = v_start + dom->kernel_size;
> 
> Just some nitpicking: why not just use v_end here? It's not used otherwise.
> 
> > +
> > +    dom->parms.virt_entry = entry_addr;
> 
> Similarly, why not just use v_start directly, and remove otherwise
> unused entry_addr?

Probably just hang overs from copying the 32-bit version, which has
slightly different requirements. I should simplify.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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