Re: [PATCH] riscv: cfi: reduce shadow stack size limit from 2GB to 512MB
From: Mark Brown
Date: Thu May 28 2026 - 07:15:47 EST
On Thu, May 28, 2026 at 09:07:04AM +0800, Zong Li wrote:
> Because the RISC-V shadow stack stores very similar data to GCS, I
> also reduced the RISC-V shadow stack size to 2G in my recent patch.
> You can find the reasons for this change here:
> https://lists.infradead.org/pipermail/linux-riscv/2026-May/091308.html
> In the same thread, we discussed if we could make the size even
> smaller. Thank David for his helpful analysis on this topic.
> Since GCS has been merged for a few years now, we'd like to learn from
> your experience. We want to make sure we are not missing any important
> impacts or issues. Therefore, we would really appreciate it if you
> could share your thoughts with us. This will give us the confidence to
> move forward with the patch
Nobody has reported it causing them a problem, but there's not really
much practical use yet due to hardware availability so that might change
and I'm not sure how much inference you can draw there - there is much
more test use than production use at this stage. I would be astonished
if anyone wanted the shadow stack to be bigger, the more likely problem
is excessive VA usage but we felt it was better to err on the side of
using too much memory. The general feedback from userspace people was
that they weren't too concerned about issues.
Attachment:
signature.asc
Description: PGP signature