From: Paul Walmsley <pjw@kernel.org>
To: Vivian Wang <wangruikang@iscas.ac.cn>
Cc: Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Alexandre Ghiti <alex@ghiti.fr>,
Alexander Potapenko <glider@google.com>,
Marco Elver <elver@google.com>,
Dmitry Vyukov <dvyukov@google.com>,
Yunhui Cui <cuiyunhui@bytedance.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
kasan-dev@googlegroups.com, Palmer Dabbelt <palmer@rivosinc.com>,
stable@vger.kernel.org, Yanko Kaneti <yaneti@declera.com>
Subject: Re: [PATCH v2 0/5] riscv: kfence: Handle the spurious fault after kfence_unprotect(), and related fixes
Date: Sun, 7 Jun 2026 00:40:34 -0600 (MDT) [thread overview]
Message-ID: <85e01c4c-6616-3ece-520f-30c6f8e53974@kernel.org> (raw)
In-Reply-To: <20260303-handle-kfence-protect-spurious-fault-v2-0-f80d8354d79d@iscas.ac.cn>
On Tue, 3 Mar 2026, Vivian Wang wrote:
> kfence_unprotect() on RISC-V doesn't flush TLBs, because we can't send
> IPIs in some contexts where kfence objects are allocated. This leads to
> spurious faults and kfence false positives.
>
> Avoid these spurious faults using the same "new_vmalloc" mechanism,
> which I have renamed new_valid_map_cpus to avoid confusion, since the
> kfence pool comes from the linear mapping, not vmalloc.
>
> Commit b3431a8bb336 ("riscv: Fix IPIs usage in kfence_protect_page()")
> only seemed to consider false negatives, which are indeed tolerable.
> False positives on the other hand are not okay since they waste
> developer time (or just my time somehow?) and spam kmsg making
> diagnosing other problems difficult.
>
> Patch 2 is the implementation to poke (what was called) new_vmalloc upon
> kfence_unprotect(). Patch 1 is some refactoring that patch 2 depends on.
> Patch 3 through 5 are some additional refactoring and minor fixes.
Thanks, queued for v7.2.
- Paul
prev parent reply other threads:[~2026-06-07 6:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-03 5:29 Vivian Wang
2026-03-03 5:29 ` [PATCH v2 1/5] riscv: mm: Extract helper mark_new_valid_map() Vivian Wang
2026-03-03 5:29 ` [PATCH v2 2/5] riscv: kfence: Call mark_new_valid_map() for kfence_unprotect() Vivian Wang
2026-03-03 5:29 ` [PATCH v2 3/5] riscv: mm: Rename new_vmalloc into new_valid_map_cpus Vivian Wang
2026-03-03 5:29 ` [PATCH v2 4/5] riscv: mm: Use the bitmap API for new_valid_map_cpus Vivian Wang
2026-03-03 5:29 ` [PATCH v2 5/5] riscv: mm: Unconditionally sfence.vma for spurious fault Vivian Wang
2026-06-07 6:40 ` Paul Walmsley [this message]
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=85e01c4c-6616-3ece-520f-30c6f8e53974@kernel.org \
--to=pjw@kernel.org \
--cc=alex@ghiti.fr \
--cc=cuiyunhui@bytedance.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=palmer@rivosinc.com \
--cc=stable@vger.kernel.org \
--cc=wangruikang@iscas.ac.cn \
--cc=yaneti@declera.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
all inboxes | Powered by JetHome®