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

Re: [Xen-devel] [PATCH v2] tools: libxc: flush data cache after loading images into guest memory



On Mon, 2013-12-16 at 00:49 +0000, Julien Grall wrote:
> 
> On 12/13/2013 12:53 PM, Ian Campbell wrote:
> >>>
> >>>> Unfortunately Linux doesn't provide any syscall to call this function
> >>>> for ARMv7 and it's not possible to call cache instruction from
> >>>> userspace. What we could do is:
> >>>>       - Use the "flags" parameters of cacheflush syscall and call a
> >>>> function which DCCMVAC (for instance __cpuc_flush_dcache_area)
> >>>>       - Extend privcmd to have a flush cache ioctl
> >>>
> >>> Personally I think the first is nicer, but ultimately we need input from
> >>> l-a-k on this one and would be happy with either.
> >>
> >> I agree. Can you try to come up with such a patch?
> 
> There is 2 functions in kernel space to flush cache PoC:
>    - flush_kern_dcache_area
>    - dma_flush_range

> I'm not sure if one of these are suitable to expose to user space.

v7_dma_clean_range is the one which matches the arm64 instruction we are
using (dc cvac), I think. Perhaps we need to invalidate the cache too?
Probably not since we are going to tear the mapping down rather than use
it further.

At the least whichever variant is selected needs to be updated to use
the USER() mechanism to protect against userspace faults, since they
assume kernel addresses right now.

Rather than using any of these directly I'd be tempted to create a new
wrapper (not new code necessarily) and call it foo_user_range (it's a
bit odd that the current function is called coherent when it only does
unification -- oh well!)

> 
> > I think Julien was going to investigate, but if says not I'll take a
> > stab at it.
> 
> I will try to do and send a patch tomorrow.

Thanks.



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