Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Al Viro <viro@zeniv.linux.org.uk>, Matthew Wilcox <willy@infradead.org>
Cc: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>,
	Christoph Hellwig <hch@infradead.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Ira Weiny <ira.weiny@intel.com>,
	linux-parisc@vger.kernel.org
Subject: Re: [PATCH v3 4/4] fs/sysv: Replace kmap() with kmap_local_page()
Date: Fri, 20 Jan 2023 08:17:19 +0100	[thread overview]
Message-ID: <99978295-6643-0cf2-8760-43e097f20dad@gmx.de> (raw)
In-Reply-To: <Y8os8QR1pRXyu4N8@ZenIV>

On 1/20/23 06:56, Al Viro wrote:
> On Fri, Jan 20, 2023 at 05:07:48AM +0000, Al Viro wrote:
>> 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?
>
> 	Anyway, that's a question to parisc folks; I _think_ pdtlb
> quietly ignores the lower bits of address, so that part seems
> to be safe, but I wouldn't bet upon that.

No, on PA2.0 (64bit) CPUs the lower bits of the address of pdtlb
encodes the amount of memory (page size) to be flushed, see:
http://ftp.parisc-linux.org/docs/arch/parisc2.0.pdf (page 7-106)
So, the proposed page alignment with e.g. PTR_ALIGN_DON() is needed.

Helge

  reply	other threads:[~2023-01-20  7:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230119153232.29750-1-fmdefrancesco@gmail.com>
     [not found] ` <20230119153232.29750-5-fmdefrancesco@gmail.com>
     [not found]   ` <Y8oWsiNWSXlDNn5i@ZenIV>
     [not found]     ` <Y8oYXEjunDDAzSbe@casper.infradead.org>
     [not found]       ` <Y8ocXbztTPbxu3bq@ZenIV>
     [not found]         ` <Y8oem+z9SN487MIm@casper.infradead.org>
     [not found]           ` <Y8ohpDtqI8bPAgRn@ZenIV>
2023-01-20  5:56             ` [PATCH v3 4/4] fs/sysv: Replace kmap() with kmap_local_page() Al Viro
2023-01-20  7:17               ` Helge Deller [this message]
2023-01-21  8:05                 ` Ira Weiny
2023-01-21 10:57                   ` Helge Deller
2023-01-21 19:26                   ` Al Viro
2023-01-23 17:14               ` Fabio M. De Francesco
2023-01-24 20:16                 ` Ira Weiny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=99978295-6643-0cf2-8760-43e097f20dad@gmx.de \
    --to=deller@gmx.de \
    --cc=fmdefrancesco@gmail.com \
    --cc=hch@infradead.org \
    --cc=ira.weiny@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox