Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Han Gao" <gaohan@iscas.ac.cn>, "Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Baoquan He" <baoquan.he@linux.dev>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Pasha Tatashin" <pasha.tatashin@soleen.com>,
	"Pratyush Yadav" <pratyush@kernel.org>, "Yao Zi" <me@ziyao.cc>
Cc: "Han Gao" <rabenda.cn@gmail.com>, kexec@lists.infradead.org
Subject: Re: [PATCH 2/5] riscv: kexec_file: Pair PC-relative low parts with their high parts
Date: Fri, 23 Oct 2026 07:45:06 +0000	[thread overview]
Message-ID: <sashiko-outbox-182435@kernel.org> (raw)
In-Reply-To: <20261023-riscv-kexec-cma-fixes-v1-2-825b90ea23c4@iscas.ac.cn>

> From: Han Gao <gaohan@iscas.ac.cn>
> 
> The purgatory relocation code applies R_RISCV_PCREL_HI20 to the auipc
> and to the instruction after it, and ignores R_RISCV_PCREL_LO12_I. This
> assumes that the low part immediately follows its high part. Compilers
> may schedule several auipc instructions before their users; clang does
> so in sha256_init(), which corrupts the hash and leaves purgatory
> spinning on a digest mismatch.
> 
> Apply the high part to the auipc only. Resolve each R_RISCV_PCREL_LO12_I
> and R_RISCV_PCREL_LO12_S through the R_RISCV_PCREL_HI20 at the address
> its symbol labels, as the module loader does.
> 
> Fixes: 838b3e28488f ("RISC-V: Load purgatory in kexec_file")
> Signed-off-by: Han Gao <gaohan@iscas.ac.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261023-riscv-kexec-cma-fixes-v1-0-825b90ea23c4@iscas.ac.cn?part=2



  reply	other threads:[~2026-10-23  7:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  7:33 [PATCH 0/5] riscv: kexec: fix kexec_file with CMA-backed segments Han Gao via B4 Relay
2026-10-23  7:33 ` [PATCH 1/5] riscv: kexec: Disable the MMU before walking the entry list Han Gao via B4 Relay
2026-10-23  7:39   ` sashiko-bot
2026-10-23  7:33 ` [PATCH 2/5] riscv: kexec_file: Pair PC-relative low parts with their high parts Han Gao via B4 Relay
2026-10-23  7:45   ` sashiko-bot [this message]
2026-10-23  7:33 ` [PATCH 3/5] kexec_file: Honor the segment alignment for CMA allocations Han Gao via B4 Relay
2026-10-23  8:18   ` sashiko-bot
2026-10-23  7:33 ` [PATCH 4/5] kexec_core: Clear the unused part of CMA segments Han Gao via B4 Relay
2026-10-23  8:04   ` sashiko-bot
2026-10-23  7:33 ` [PATCH 5/5] riscv: mm: Reserve the DTB before scanning reserved memory Han Gao via B4 Relay
2026-10-23  8:06   ` sashiko-bot

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=sashiko-outbox-182435@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=baoquan.he@linux.dev \
    --cc=gaohan@iscas.ac.cn \
    --cc=justinstitt@google.com \
    --cc=kexec@lists.infradead.org \
    --cc=me@ziyao.cc \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=palmer@dabbelt.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=pjw@kernel.org \
    --cc=pratyush@kernel.org \
    --cc=rabenda.cn@gmail.com \
    --cc=rppt@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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