From: Michael Schmitz <schmitzmic@gmail.com>
To: Matthew Wilcox <willy@infradead.org>,
Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org
Subject: Re: [PATCH v3 13/34] m68k: Implement the new page table range API
Date: Mon, 6 Mar 2023 09:44:17 +1300 [thread overview]
Message-ID: <0b00a30e-cb7f-d42b-7d16-0ae8d50ed916@gmail.com> (raw)
In-Reply-To: <ZAS1Lq6//oO/0PXe@casper.infradead.org>
Hi Matthew, Geert,
sorry, I missed that one when it got posted ...
On 6/03/23 04:28, Matthew Wilcox wrote:
> On Sun, Mar 05, 2023 at 11:16:13AM +0100, Geert Uytterhoeven wrote:
>>> + while (nr--) {
>>> + __asm__ __volatile__("nop\n\t"
>>> + ".chip 68040\n\t"
>>> + "cpushp %%bc,(%0)\n\t"
>>> + ".chip 68k"
>>> + : : "a" (paddr + nr * PAGE_SIZE));
>> As gcc (9.5.0) keeps on calculating "paddr + nr * PAGE_SIZE"
>> inside the loop (albeit using a shift instead of a multiplication),
>> please use "paddr" here, followed by "paddr += PAGE_SIZE;".
Are we certain that contiguous vaddr always maps to contiguous paddr?
If not, I'd suggest we increment vaddr inside the loop, and use __pa()
each time:
> +++ b/arch/m68k/include/asm/cacheflush_mm.h
> @@ -235,13 +235,14 @@ static inline void __flush_pages_to_ram(void *vaddr, unsigned int nr)
> } else if (CPU_IS_040_OR_060) {
>
> - while (nr--) {
> + do {
> __asm__ __volatile__("nop\n\t"
> ".chip 68040\n\t"
> "cpushp %%bc,(%0)\n\t"
> ".chip 68k"
> - : : "a" (paddr + nr * PAGE_SIZE));
> - }
> + : : "a" __pa(vaddr));
> + vaddr += PAGE_SIZE;
> + } while (--nr);
> } else {
> unsigned long _tmp;
> __asm__ __volatile__("movec %%cacr,%0\n\t"
>
(just edited Matthew's patch in the mail editor, untested, may not apply
cleanly ...)
Cheers,
Michael
next prev parent reply other threads:[~2023-03-05 20:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230228213738.272178-1-willy@infradead.org>
2023-02-28 21:37 ` [PATCH v3 13/34] m68k: Implement the new page table range API Matthew Wilcox (Oracle)
2023-03-05 10:16 ` Geert Uytterhoeven
2023-03-05 15:28 ` Matthew Wilcox
2023-03-05 16:48 ` Geert Uytterhoeven
2023-03-05 20:44 ` Michael Schmitz [this message]
2023-03-06 7:21 ` Geert Uytterhoeven
2023-03-06 23:01 ` Michael Schmitz
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=0b00a30e-cb7f-d42b-7d16-0ae8d50ed916@gmail.com \
--to=schmitzmic@gmail.com \
--cc=geert@linux-m68k.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mm@kvack.org \
--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