From: Muchun Song <muchun.song@linux.dev>
To: Xionggui Chen <evers_chen@163.com>
Cc: Muchun Song <muchun.song@linux.dev>,
Palmer Dabbelt <palmer@dabbelt.com>,
Alexandre Ghiti <alex@ghiti.fr>,
Xionggui Chen <chenxionggui@lanxincomputing.com>,
Paul Walmsley <pjw@kernel.org>, Albert Ou <aou@eecs.berkeley.edu>,
"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jisheng Zhang <jszhang@kernel.org>,
"David Hildenbrand (Arm)" <david@kernel.org>,
Vivian Wang <wangruikang@iscas.ac.cn>,
"Guo Ren (Alibaba DAMO Academy)" <guoren@kernel.org>,
Troy Mitchell <troy.mitchell@linux.dev>,
Nam Cao <namcao@linutronix.de>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] riscv: mm: Disable GCOV instrumentation in set_satp_mode()
Date: Thu, 3 Dec 2026 20:25:33 +0800 [thread overview]
Message-ID: <A60524D7-BBFE-4E14-8EA4-A53B974135B3@linux.dev> (raw)
In-Reply-To: <20261119050049.174124-1-evers_chen@163.com>
> On Nov 19, 2026, at 13:00, Xionggui Chen <evers_chen@163.com> wrote:
>
> From: Xionggui Chen <chenxionggui@lanxincomputing.com>
>
> When CONFIG_GCOV_PROFILE_ALL is enabled, GCC instruments
> set_satp_mode() with GCOV counter updates.
>
> The function temporarily enables an identity mapping to probe
> supported SATP modes. GCOV instrumentation may access counters
> outside this temporary mapping while SATP is enabled, causing
> a Store/AMO page fault during early boot.
>
> On QEMU virt with Linux 7.4.0-rc1, the fault occurs immediately
> after writing satp. The faulting instruction is an amoadd.d
> updating a GCOV counter in set_satp_mode().
>
> Mark set_satp_mode() with __no_profile to prevent GCOV counter
> accesses during SATP probing, while preserving GCOV coverage
> for the other functions in init.c.
>
> Without this change, QEMU fails during early boot. With this
> change, the kernel reaches root filesystem mounting.
>
> The fix was also verified on RISC-V hardware with Linux 7.2.0.
>
> Signed-off-by: Xionggui Chen <chenxionggui@lanxincomputing.com>
Acked-by: Muchun Song (ByteDance) <muchun.song@linux.dev>
Thanks.
prev parent reply other threads:[~2026-12-03 12:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 5:00 Xionggui Chen
[not found] ` <390148175bd6ad32b78b63ecf0f93b1325bd3f3e.97e6a8d6.b10d.4af0.9cd4.cd65446467db@feishu.cn>
2026-12-03 9:56 ` cxg
2026-12-03 12:16 ` [External] " yunhui cui
2026-12-04 1:02 ` Guo Ren
2026-12-03 12:25 ` Muchun Song [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=A60524D7-BBFE-4E14-8EA4-A53B974135B3@linux.dev \
--to=muchun.song@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=chenxionggui@lanxincomputing.com \
--cc=david@kernel.org \
--cc=evers_chen@163.com \
--cc=guoren@kernel.org \
--cc=jszhang@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=namcao@linutronix.de \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rppt@kernel.org \
--cc=troy.mitchell@linux.dev \
--cc=wangruikang@iscas.ac.cn \
/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®