Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	Ira Weiny <ira.weiny@intel.com>,
	"Fabio M . De Francesco" <fmdefrancesco@gmail.com>
Subject: Re: [PATCH] parisc: Ensure page-aligned addresses in cache flush and copy functions
Date: Fri, 27 Jan 2023 23:39:14 +0000	[thread overview]
Message-ID: <Y9Rgor0T8dSzPgiX@casper.infradead.org> (raw)
In-Reply-To: <20230127213941.83967-1-deller@gmx.de>

On Fri, Jan 27, 2023 at 10:39:41PM +0100, Helge Deller wrote:
> Matthew Wilcox noticed, that if ARCH_HAS_FLUSH_ON_KUNMAP is defined
> (which is the case for PA-RISC), __kunmap_local() calls
> kunmap_flush_on_unmap(), which may call the parisc flush functions with
> a non-page-aligned address and thus the page might not be fully flushed.
> 
> To prevent similiar cases, page-align any given address in the
> following parisc low-level calls:
> - clear_page_asm(),
> - copy_page_asm(),
> - copy_user_page_asm(),
> - clear_user_page_asm(),
> - flush_kernel_dcache_page_asm(),
> - purge_kernel_dcache_page_asm() and
> - flush_kernel_icache_page()

I don't think this is the right way to go.  Imagine that we enable
large folios on architectures that don't support TRANSPARENT_HUGEPAGE
(ie PA-RISC).  Then folio_zero_range() is going to call kmap_local()
and kunmap_local() once per folio instead of once per page, and so we'll
need to flush the entire folio, not just the page.

  reply	other threads:[~2023-01-27 23:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 21:39 [PATCH] parisc: Ensure page-aligned addresses in cache flush and copy functions Helge Deller
2023-01-27 23:39 ` Matthew Wilcox [this message]
2023-01-28 10:59   ` Helge Deller
2023-02-28  0:20 ` Sam James
2023-02-28  2:05   ` Helge Deller

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=Y9Rgor0T8dSzPgiX@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=deller@gmx.de \
    --cc=fmdefrancesco@gmail.com \
    --cc=ira.weiny@intel.com \
    --cc=linux-parisc@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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