[PATCH 2/2] arm: cacheflush: Fix user split-caching logic
Steve Capper
steve.capper at linaro.org
Fri Dec 13 07:51:31 EST 2013
On Fri, Dec 13, 2013 at 12:41:31PM +0000, Steve Capper wrote:
> On Fri, Dec 13, 2013 at 12:06:31PM +0000, Steve Capper wrote:
> > The user split-caching logic in __do_cache_op divides the area to be
> > flushed into interruptable chunks of size PAGE_SIZE. Unfortunately,
> > there is no check to see whether or not the range to be flushed is
> > smaller than the chunk size.
> >
> > This can result cache flushes for larger ranges than intended,
> > which can result in the flush failing with a -EFAULT. I've observed
> > slowdown and failure with the icache-hygiene test from libhugetlbfs.
> >
> > This patch fixes the problem by replacing chunk with the minimum of
> > PAGE_SIZE or (end - start), thus we do not overflush.
> >
> > Signed-off-by: Steve Capper <steve.capper at linaro.org>
>
> Gah, apologies. The min should be placed within the loop not before
> as one may not have an exact multiple of chunk size to flush.
>
> Please ignore this patch, I'll resend an improved version.
>
> Cheers,
> --
> Steve
... or refer to this one:
http://lists.infradead.org/pipermail/linux-arm-kernel/2013-December/216597.html
Apologies for the noise.
The first patch in the series (fix for compound page flushing),
however, is still pertinent.
Cheers,
--
Steve
>
> > ---
> > arch/arm/kernel/traps.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
> > index 8fcda14..5d3c455 100644
> > --- a/arch/arm/kernel/traps.c
> > +++ b/arch/arm/kernel/traps.c
> > @@ -503,7 +503,7 @@ static inline int
> > __do_cache_op(unsigned long start, unsigned long end)
> > {
> > int ret;
> > - unsigned long chunk = PAGE_SIZE;
> > + unsigned long chunk = min(end - start, PAGE_SIZE);
> >
> > do {
> > if (signal_pending(current)) {
> > --
> > 1.8.1.4
> >
More information about the linux-arm-kernel
mailing list