From: Fuad Tabba <tabba@google.com>
To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Cc: maz@kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com,
suzuki.poulose@arm.com, yuzenghui@huawei.com,
catalin.marinas@arm.com, will@kernel.org, tabba@google.com
Subject: [PATCH v1 1/5] arm64: Remove dead code resetting HCR_EL2 for pKVM
Date: Thu, 27 Nov 2025 12:22:06 +0000 [thread overview]
Message-ID: <20251127122210.4111702-2-tabba@google.com> (raw)
In-Reply-To: <20251127122210.4111702-1-tabba@google.com>
The pKVM lifecycle does not support tearing down the hypervisor and
returning to the hyp stub once initialized. The transition to protected
mode is one-way.
Consequently, the code path in hyp-init.S responsible for resetting
EL2 registers (triggered by kexec or hibernation) is unreachable in
protected mode.
Remove the dead code handling HCR_EL2 reset for
ARM64_KVM_PROTECTED_MODE.
No functional change intended.
Signed-off-by: Fuad Tabba <tabba@google.com>
---
arch/arm64/kvm/hyp/nvhe/hyp-init.S | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-init.S b/arch/arm64/kvm/hyp/nvhe/hyp-init.S
index aada42522e7b..0d42eedc7167 100644
--- a/arch/arm64/kvm/hyp/nvhe/hyp-init.S
+++ b/arch/arm64/kvm/hyp/nvhe/hyp-init.S
@@ -260,11 +260,6 @@ reset:
msr sctlr_el2, x5
isb
-alternative_if ARM64_KVM_PROTECTED_MODE
- mov_q x5, HCR_HOST_NVHE_FLAGS
- msr_hcr_el2 x5
-alternative_else_nop_endif
-
/* Install stub vectors */
adr_l x5, __hyp_stub_vectors
msr vbar_el2, x5
--
2.52.0.487.g5c8c507ade-goog
next prev parent reply other threads:[~2025-11-27 12:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-27 12:22 [PATCH v1 0/5] KVM: arm64: Enforce MTE disablement at EL2 Fuad Tabba
2025-11-27 12:22 ` Fuad Tabba [this message]
2025-11-27 12:22 ` [PATCH v1 2/5] arm64: Clear HCR_EL2.ATA when MTE is not supported or disabled Fuad Tabba
2025-11-27 12:22 ` [PATCH v1 3/5] KVM: arm64: Refactor enter_exception64() Fuad Tabba
2025-11-27 12:22 ` [PATCH v1 4/5] arm64: Inject UNDEF when accessing MTE sysregs with MTE disabled Fuad Tabba
2025-11-27 14:17 ` Marc Zyngier
2025-11-27 14:41 ` Fuad Tabba
2025-11-28 8:43 ` Marc Zyngier
2025-11-28 8:53 ` Fuad Tabba
2025-11-28 12:10 ` Will Deacon
2025-11-27 12:22 ` [PATCH v1 5/5] KVM: arm64: Use kvm_has_mte() in pKVM trap initialization Fuad Tabba
2025-12-02 22:43 ` [PATCH v1 0/5] KVM: arm64: Enforce MTE disablement at EL2 Oliver Upton
2025-12-05 17:00 ` Will Deacon
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=20251127122210.4111702-2-tabba@google.com \
--to=tabba@google.com \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/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).