[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8ohpDtqI8bPAgRn@ZenIV>
Date: Fri, 20 Jan 2023 05:07:48 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Matthew Wilcox <willy@...radead.org>
Cc: "Fabio M. De Francesco" <fmdefrancesco@...il.com>,
Christoph Hellwig <hch@...radead.org>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Ira Weiny <ira.weiny@...el.com>
Subject: Re: [PATCH v3 4/4] fs/sysv: Replace kmap() with kmap_local_page()
On Fri, Jan 20, 2023 at 04:54:51AM +0000, Matthew Wilcox wrote:
> > Sure, but... there's also this:
> >
> > static inline void __kunmap_local(const void *addr)
> > {
> > #ifdef ARCH_HAS_FLUSH_ON_KUNMAP
> > kunmap_flush_on_unmap(addr);
> > #endif
> > }
> >
> > Are you sure that the guts of that thing will be happy with address that is not
> > page-aligned? I've looked there at some point, got scared of parisc (IIRC)
> > MMU details and decided not to rely upon that...
>
> Ugh, PA-RISC (the only implementor) definitely will flush the wrong
> addresses. I think we should do this, as having bugs that only manifest
> on one not-well-tested architecture seems Bad.
>
> static inline void __kunmap_local(const void *addr)
> {
> #ifdef ARCH_HAS_FLUSH_ON_KUNMAP
> - kunmap_flush_on_unmap(addr);
> + kunmap_flush_on_unmap(PAGE_ALIGN_DOWN(addr));
> #endif
> }
PTR_ALIGN_DOWN(addr, PAGE_SIZE), perhaps?
Powered by blists - more mailing lists