From: sashiko-bot@kernel.org
To: "Colton Lewis" <coltonlewis@google.com>
Cc: "Oliver Upton" <oupton@kernel.org>,
"Marc Zyngier" <maz@kernel.org>,
kvmarm@lists.linux.dev
Subject: Re: [PATCH 6.6 v2 4/6] KVM: arm64: Initialize HCR_EL2.E2H early
Date: Wed, 08 Jul 2026 23:03:53 +0000 [thread overview]
Message-ID: <20260708230354.332C21F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260708225124.4130846-5-coltonlewis@google.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Writes to control-plane system registers are not immediately followed by an isb().
- [High] Missing `dsb` after `tlbi alle2` in `__pkvm_init_switch_pgd`.
--
--- Patch [4]: [PATCH 6.6 v2 4/6] KVM: arm64: Initialize HCR_EL2.E2H early ---
(Note: The standard inline diff formatting has been replaced with a free-form summary in this report due to code recitation restrictions.)
commit 016cd26b0c3a9694155a974c024598368716d8e4
Author: Mark Rutland <mark.rutland@arm.com>
KVM: arm64: Initialize HCR_EL2.E2H early
This patch addresses an issue where HCR_EL2.E2H might read as an UNKNOWN
value out of reset on CPUs without FEAT_E2H0 if it is not explicitly
initialized. It introduces a new 'init_el2_hcr' macro to initialize this
early in the KVM PSCI entry points so it can be reliably consumed.
Link: https://lore.kernel.org/r/20250227180526.1204723-2-mark.rutland@arm.com
[Severity: High]
This is a pre-existing issue, but in arch/arm64/kvm/hyp/nvhe/hyp-init.S and
arch/arm64/include/asm/el2_setup.h, several writes to control-plane system
registers are not immediately followed by an isb(). For example, in
___kvm_hyp_init(), writes to mair_el2 and hcr_el2 are followed by ldr and
mov instructions rather than an isb(). Similarly, in __init_el2_fgt(),
SYS_HFGRTR_EL2 and SYS_HFGWTR_EL2 are written consecutively without an
intervening isb(), and in finalise_el2_state(), writing cpacr_el1 is
followed directly by a branch.
Since the subsystem guidelines mandate that every write to a control-plane
system register must be followed by an isb() as the very next instruction,
could this leave the CPU pipeline in an architecturally undefined state for
the intervening instructions and cause unpredictable behavior or spurious
traps during boot?
[Severity: High]
This is also a pre-existing issue, but in
arch/arm64/kvm/hyp/nvhe/hyp-init.S, __pkvm_init_switch_pgd() issues a
"tlbi alle2" instruction and subsequently installs new page tables and
re-enables the MMU without executing a dsb in between.
Because the architecture requires a dsb to guarantee the completion of a
TLB maintenance instruction, might the TLB invalidation still be pending
when the MMU is turned back on? Could this window cause the PE to fetch
instructions or data using stale TLB entries, or raise a TLB conflict
abort?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260708225124.4130846-1-coltonlewis@google.com?part=4
next prev parent reply other threads:[~2026-07-08 23:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 22:51 [PATCH 6.6 v2 0/6] arm64: KVM: Backport VHE-only boot fixes Colton Lewis
2026-07-08 22:51 ` [PATCH 6.6 v2 1/6] arm64: sysreg: Add layout for ID_AA64MMFR4_EL1 Colton Lewis
2026-07-08 23:03 ` sashiko-bot
2026-07-09 10:16 ` Marc Zyngier
2026-07-09 20:30 ` Colton Lewis
2026-07-08 22:51 ` [PATCH 6.6 v2 2/6] arm64: Treat HCR_EL2.E2H as RES1 when ID_AA64MMFR4_EL1.E2H0 is negative Colton Lewis
2026-07-08 22:59 ` sashiko-bot
2026-07-08 22:51 ` [PATCH 6.6 v2 3/6] arm64: Fix early handling of FEAT_E2H0 not being implemented Colton Lewis
2026-07-08 23:01 ` sashiko-bot
2026-07-08 22:51 ` [PATCH 6.6 v2 4/6] KVM: arm64: Initialize HCR_EL2.E2H early Colton Lewis
2026-07-08 23:03 ` sashiko-bot [this message]
2026-07-08 22:51 ` [PATCH 6.6 v2 5/6] KVM: arm64: Initialize SCTLR_EL1 in __kvm_hyp_init_cpu() Colton Lewis
2026-07-08 22:51 ` [PATCH 6.6 v2 6/6] arm64: Revamp HCR_EL2.E2H RES1 detection Colton Lewis
2026-07-08 22:59 ` 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=20260708230354.332C21F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=coltonlewis@google.com \
--cc=kvmarm@lists.linux.dev \
--cc=maz@kernel.org \
--cc=oupton@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.