linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Paul Walmsley <pjw@kernel.org>
To: Zongmin Zhou <min_halo@163.com>
Cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu,
	alex@ghiti.fr,  linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	 Zongmin Zhou <zhouzongmin@kylinos.cn>
Subject: Re: [PATCH] riscv: errata: select RISCV_ALTERNATIVE_EARLY for THEAD GHOSTWRITE
Date: Wed, 7 Oct 2026 09:04:51 -0600 (MDT)	[thread overview]
Message-ID: <1cfb2bbd-206b-4a5b-e136-7afbcde21e63@kernel.org> (raw)
In-Reply-To: <20260917074843.52716-1-min_halo@163.com>

On Thu, 17 Sep 2026, Zongmin Zhou wrote:

> From: Zongmin Zhou <zhouzongmin@kylinos.cn>
> 
> errata_probe_ghostwrite() only marks the CPU as vulnerable when it is
> called at the RISCV_ALTERNATIVES_EARLY_BOOT stage, and the mitigation
> in ghostwrite_enable_mitigation() only takes effect if the vulnerable
> state was recorded before the boot alternatives are patched.
> 
> The early boot stage is only executed when CONFIG_RISCV_ALTERNATIVE_EARLY
> is enabled, which currently is only selected by ERRATA_THEAD_MAE. In a
> kernel built with ERRATA_THEAD_GHOSTWRITE=y but ERRATA_THEAD_MAE=n, the
> early alternatives never run, so ghostwrite_state is never set to
> VULNERABLE: ghostwrite_enable_mitigation() returns false, xtheadvector
> remains enabled, and sysfs reports "Not affected" on a vulnerable
> T-Head C9xx CPU.
> 
> Select RISCV_ALTERNATIVE_EARLY from ERRATA_THEAD_GHOSTWRITE so that the
> vulnerability is detected in the early boot stage and the default
> mitigation is applied.
> 
> Fixes: 4bf97069239b ("riscv: Add ghostwrite vulnerability")
> Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>

Thanks, queued for v7.3-rc.


- Paul

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      reply	other threads:[~2026-10-07 15:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17  7:48 [PATCH] riscv: errata: select RISCV_ALTERNATIVE_EARLY for THEAD GHOSTWRITE Zongmin Zhou
2026-10-07 15:04 ` 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=1cfb2bbd-206b-4a5b-e136-7afbcde21e63@kernel.org \
    --to=pjw@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=min_halo@163.com \
    --cc=palmer@dabbelt.com \
    --cc=zhouzongmin@kylinos.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;
as well as URLs for NNTP newsgroup(s).