From: Alexandre Ghiti <alex@ghiti.fr>
To: Alexandre Ghiti <alexghiti@rivosinc.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Andrew Jones <ajones@ventanamicro.com>,
Qinglin Pan <panqinglin2020@iscas.ac.cn>,
Ryan Roberts <ryan.roberts@arm.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH -fixes 0/2] Fix set_huge_pte_at()
Date: Tue, 3 Oct 2023 17:43:10 +0200 [thread overview]
Message-ID: <305b4dec-c99d-3cee-4563-8d7dcbae9384@ghiti.fr> (raw)
In-Reply-To: <20230928151846.8229-1-alexghiti@rivosinc.com>
+cc Andrew: Would you mind taking this patchset in your tree for the
next rc? This patchset depends on a previous fix for arm64 that you
merged in rc4 which is not in the riscv -fixes branch yet.
I saw with Palmer and he should ack this shortly.
If I can do anything else to help, let me know.
Thanks,
Alex
On 28/09/2023 17:18, Alexandre Ghiti wrote:
> A recent report [1] from Ryan for arm64 revealed that we do not handle
> swap entries when setting a hugepage backed by a NAPOT region (the
> contpte riscv equivalent).
>
> As explained in [1], the issue was discovered by a new test in kselftest
> which uses poison entries, but the symptoms are different from arm64 though:
>
> - the riscv kernel bugs because we do not handle VM_FAULT_HWPOISON*,
> this is fixed by patch 1,
> - after that, the test passes because the first pte_napot() fails (the
> poison entry does not have the N bit set), and then we only set the
> first page table entry covering the NAPOT hugepage, which is enough
> for hugetlb_fault() to correctly raise a VM_FAULT_HWPOISON wherever we
> write in this mapping since only this first page table entry is
> checked
> (see https://elixir.bootlin.com/linux/v6.6-rc3/source/mm/hugetlb.c#L6071).
> But this seems fragile so patch 2 sets all page table entries of a
> NAPOT mapping.
>
> [1]: https://lore.kernel.org/linux-arm-kernel/20230922115804.2043771-1-ryan.roberts@arm.com/
>
>
> Alexandre Ghiti (2):
> riscv: Handle VM_FAULT_[HWPOISON|HWPOISON_LARGE] faults instead of
> panicking
> riscv: Fix set_huge_pte_at() for NAPOT mappings when a swap entry is
> set
>
> arch/riscv/mm/fault.c | 2 +-
> arch/riscv/mm/hugetlbpage.c | 19 +++++++++++++------
> 2 files changed, 14 insertions(+), 7 deletions(-)
>
next prev parent reply other threads:[~2023-10-03 15:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 15:18 [PATCH -fixes 0/2] Fix set_huge_pte_at() Alexandre Ghiti
2023-09-28 15:18 ` [PATCH -fixes 1/2] riscv: Handle VM_FAULT_[HWPOISON|HWPOISON_LARGE] faults instead of panicking Alexandre Ghiti
2023-09-28 15:18 ` [PATCH -fixes 2/2] riscv: Fix set_huge_pte_at() for NAPOT mappings when a swap entry is set Alexandre Ghiti
2023-09-30 9:14 ` Conor Dooley
2023-10-02 7:18 ` Alexandre Ghiti
2023-10-02 13:11 ` Conor Dooley
2023-10-03 15:35 ` Alexandre Ghiti
2023-10-03 7:42 ` Andrew Jones
2023-10-03 15:43 ` Alexandre Ghiti [this message]
2023-10-03 16:04 ` [PATCH -fixes 0/2] Fix set_huge_pte_at() Andrew Morton
2023-10-04 16:37 ` Palmer Dabbelt
2023-10-26 8:57 ` Alexandre Ghiti
2023-10-26 14:13 ` Andrew Morton
2023-10-26 14:15 ` Alexandre Ghiti
2023-10-26 14:30 ` Ryan Roberts
2023-10-26 14:54 ` Andrew Morton
2023-10-26 15:00 ` Ryan Roberts
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=305b4dec-c99d-3cee-4563-8d7dcbae9384@ghiti.fr \
--to=alex@ghiti.fr \
--cc=ajones@ventanamicro.com \
--cc=akpm@linux-foundation.org \
--cc=alexghiti@rivosinc.com \
--cc=aou@eecs.berkeley.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=panqinglin2020@iscas.ac.cn \
--cc=paul.walmsley@sifive.com \
--cc=ryan.roberts@arm.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