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

Re: [Xen-devel] [PATCH 2/3] xen: arm: correctly handle continuations for 64-bit guests



On Wed, 2015-03-25 at 22:39 +0000, Julien Grall wrote:
> Hi Ian,
> 
> On 25/03/2015 15:34, Ian Campbell wrote:
> > The 64-bit ABI is different to 32-bit:
> >
> >   - uses x16 as the op register rather than r12.
> >   - arguments in x0..x5 and not r0..r5. Using rN here potentially
> >     truncates.
> >   - return value goes in x0, not r0.
> >
> > Hypercalls can only be made directly from kernel space, so checking
> > the domain's size is sufficient.
> >
> > The update of regs->pc is duplicated in both halves because the 32-bit
> > case is going to need fixing to handle Thumb mode (next patch).
> >
> > Spotted due to spurious -EFAULT when destroying a domain, due to the
> > hypercall's pointer argument being truncated. I'm unclear why I am
> > only seeing this now.
> 
> Good catch!
> 
> x16 would still contain the valid operation, because we are (most of the 
> time?) continuing on the same hypercall.

All the other contination code sets the op back, I guess to handle cases
where it may have been clobbered somewhere along the line. I can't think
of a reason to not do it.

> So the only issue would be argument truncation. I guess that we don't 
> have big value (i.e > 32 bits) to store.

I would hope not, and we'd have been hitting them already since that was
the nature of the bug.

> > Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> > ---
> > I imagine this needs backporting everywhere...
> 
> Agree for Xen 4.4 and Xen 4.5.
> 
> Reviewed-by: Julien Grall <julien.grall@xxxxxxxxxx>
> 
> Regards,
> 



_______________________________________________
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®.