From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Greg Ungerer <gerg@linux-m68k.org>
Cc: Hugh Dickins <hughd@google.com>,
Patrice CHOTARD <patrice.chotard@foss.st.com>,
Arnd Bergmann <arnd@arndb.de>,
Mikulas Patocka <mpatocka@redhat.com>,
Lukas Czerner <lczerner@redhat.com>,
"Darrick J . Wong" <djwong@kernel.org>,
Christoph Hellwig <hch@lst.de>,
zkabelac@redhat.com, Miklos Szeredi <miklos@szeredi.hu>,
Borislav Petkov <bp@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
Alexandre TORGUE - foss <alexandre.torgue@foss.st.com>,
Valentin CARON - foss <valentin.caron@foss.st.com>,
linux-stm32@st-md-mailman.stormreply.com,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux FS Devel <linux-fsdevel@vger.kernel.org>,
Linux MM <linux-mm@kvack.org>,
Linux-Arch <linux-arch@vger.kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
"moderated list:H8/300 ARCHITECTURE"
<uclinux-h8-devel@lists.sourceforge.jp>,
linux-m68k <linux-m68k@lists.linux-m68k.org>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Russell King <linux@armlinux.org.uk>
Subject: Re: Regression with v5.18-rc1 tag on STM32F7 and STM32H7 based boards
Date: Wed, 20 Apr 2022 16:44:08 +0200 [thread overview]
Message-ID: <CAMuHMdWA7n588XUKy2yondnZpAw_afFBz8DHxH0Q3Tt53HHsHg@mail.gmail.com> (raw)
In-Reply-To: <6f56d0d6-6d0d-f0c9-87df-f3ff25b26fc5@linux-m68k.org>
Hi Greg,
On Wed, Apr 20, 2022 at 3:53 PM Greg Ungerer <gerg@linux-m68k.org> wrote:
> On 16/4/22 10:58, Hugh Dickins wrote:
> > Just to wrap up this thread: the tentative arch/ patches below did not
> > go into 5.18-rc2, but 5.18-rc3 will contain
> > 1bdec44b1eee ("tmpfs: fix regressions from wider use of ZERO_PAGE")
> > which fixes a further issue, and deletes the line which gave you trouble.
> >
> > With arch/h8300 removed from linux-next, and arch/arm losing a page by
> > the patch below, I don't think it's worth my arguing for those changes.
> > I'd still prefer arch/m68k to expose its empty_zero_page in ZERO_PAGE(),
> > or else not allocate it; but I won't be pursuing this further.
>
> Thanks for pointing this out. It certainly does look wrong to me for
> the m68k nommu case. I am not aware of any existing issues caused by
> this - but there is no good reason not to fix it.
>
> So I propose this change. Build and run tested on my m68knommu targets.
>
> Regards
> Greg
>
>
> From f809fb8fbca9e5e637b8fda380955bd799bb3926 Mon Sep 17 00:00:00 2001
> From: Greg Ungerer <gerg@linux-m68k.org>
> Date: Wed, 20 Apr 2022 23:27:47 +1000
> Subject: [PATCH] m68knommu: set ZERO_PAGE() allocated zeroed page
>
> The non-MMU m68k pagetable ZERO_PAGE() macro is being set to the
> somewhat non-sensical value of "virt_to_page(0)". The zeroth page
> is not in any way guaranteed to be a page full of "0". So the result
> is that ZERO_PAGE() will almost certainly contain random values.
>
> We already allocate a real "empty_zero_page" in the mm setup code shared
> between MMU m68k and non-MMU m68k. It is just not hooked up to the
> ZERO_PAGE() macro for the non-MMU m68k case.
>
> Fix ZERO_PAGE() to use the allocated "empty_zero_page" pointer.
>
> I am not aware of any specific issues caused by the old code.
>
> Link: https://lore.kernel.org/linux-m68k/2a462b23-5b8e-bbf4-ec7d-778434a3b9d7@google.com/T/#t
> Reported-by: Hugh Dickens <hughd@google.com>
> Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
> ---
> arch/m68k/include/asm/pgtable_no.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h
> index 87151d67d91e..bce5ca56c388 100644
> --- a/arch/m68k/include/asm/pgtable_no.h
> +++ b/arch/m68k/include/asm/pgtable_no.h
> @@ -42,7 +42,8 @@ extern void paging_init(void);
> * ZERO_PAGE is a global shared page that is always zero: used
> * for zero-mapped memory areas etc..
> */
> -#define ZERO_PAGE(vaddr) (virt_to_page(0))
> +extern void *empty_zero_page;
> +#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
>
> /*
> * All 32bit addresses are effectively valid for vmalloc...
And after that (or combined with this?), this can be factored
out from arch/m68k/include/asm/pgtable_{mm,no}.h into
arch/m68k/include/asm/pgtable.h.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2022-04-20 14:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <481a13f8-d339-f726-0418-ab4258228e91@foss.st.com>
[not found] ` <95a0d1dd-bcce-76c7-97b9-8374c9913321@google.com>
2022-04-06 6:22 ` Regression with v5.18-rc1 tag on STM32F7 and STM32H7 based boards Hugh Dickins
2022-04-06 7:01 ` Patrice CHOTARD
2022-04-16 0:58 ` Hugh Dickins
2022-04-20 13:52 ` Greg Ungerer
2022-04-20 14:44 ` Geert Uytterhoeven [this message]
2022-04-21 12:02 ` Greg Ungerer
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=CAMuHMdWA7n588XUKy2yondnZpAw_afFBz8DHxH0Q3Tt53HHsHg@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=akpm@linux-foundation.org \
--cc=alexandre.torgue@foss.st.com \
--cc=arnd@arndb.de \
--cc=bp@suse.de \
--cc=djwong@kernel.org \
--cc=gerg@linux-m68k.org \
--cc=hch@lst.de \
--cc=hughd@google.com \
--cc=lczerner@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mm@kvack.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=miklos@szeredi.hu \
--cc=mpatocka@redhat.com \
--cc=patrice.chotard@foss.st.com \
--cc=uclinux-h8-devel@lists.sourceforge.jp \
--cc=valentin.caron@foss.st.com \
--cc=ysato@users.sourceforge.jp \
--cc=zkabelac@redhat.com \
/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;
as well as URLs for NNTP newsgroup(s).