From: Marc Zyngier <maz@kernel.org>
To: Yeoreum Yun <yeoreum.yun@arm.com>
Cc: catalin.marinas@arm.com, will@kernel.org, broonie@kernel.org,
oliver.upton@linux.dev, anshuman.khandual@arm.com,
robh@kernel.org, james.morse@arm.com, mark.rutland@arm.com,
joey.gouly@arm.com, ry111@xry111.site, Dave.Martin@arm.com,
ahmed.genidi@arm.com, kevin.brodsky@arm.com,
scott@os.amperecomputing.com, mbenes@suse.cz,
james.clark@linaro.org, frederic@kernel.org, rafael@kernel.org,
pavel@kernel.org, ryan.roberts@arm.com, suzuki.poulose@arm.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
kvmarm@lists.linux.dev
Subject: Re: [PATCH 10/11] KVM: arm64: nv: support SCTLR2_ELx on nv
Date: Mon, 04 Aug 2025 14:11:38 +0100 [thread overview]
Message-ID: <86pldb6xkl.wl-maz@kernel.org> (raw)
In-Reply-To: <20250804121724.3681531-11-yeoreum.yun@arm.com>
On Mon, 04 Aug 2025 13:17:23 +0100,
Yeoreum Yun <yeoreum.yun@arm.com> wrote:
[...]
> diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
> index dc1d26559bfa..a4d3b2d2fd80 100644
> --- a/arch/arm64/kvm/nested.c
> +++ b/arch/arm64/kvm/nested.c
> @@ -1704,6 +1704,19 @@ int kvm_init_nv_sysregs(struct kvm_vcpu *vcpu)
> TCR2_EL2_AMEC1 | TCR2_EL2_DisCH0 | TCR2_EL2_DisCH1);
> set_sysreg_masks(kvm, TCR2_EL2, res0, res1);
>
> + /*
> + * SCTLR2_EL2 - until explicit support for each feature, set all as RES0.
> + */
> + res0 = SCTLR2_EL2_RES0 | SCTLR2_EL2_EMEC;
> + res0 |= SCTLR2_EL2_EASE;
> + res0 |= SCTLR2_EL2_NMEA;
> + res0 |= (SCTLR2_EL2_EnADERR | SCTLR2_EL2_EnANERR);
> + res0 |= SCTLR2_EL2_EnIDCP128;
> + res0 |= (SCTLR2_EL2_CPTA | SCTLR2_EL2_CPTA0 |
> + SCTLR2_EL2_CPTM | SCTLR2_EL2_CPTM0);
> + res1 = SCTLR2_EL2_RES1;
> + set_sysreg_masks(kvm, SCTLR2_EL2, res0, res1);
This patch is obsolete, but I'd like to point out that this is not the
way we describe these things. Each bit of the register needs to be
tracked against the feature it is part of, and not blindly added to
the RES0 set. See
https://lore.kernel.org/all/20250708172532.1699409-15-oliver.upton@linux.dev/
for the equivalent change.
You should *NEVER* describe a functional bit as RESx without
considering whether the feature is exposed to the guest, irrespective
of what the kernel supports.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2025-08-04 13:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-04 12:17 [PATCH 00/11] support SCTLR2_ELx Yeoreum Yun
2025-08-04 12:17 ` [PATCH 01/11] arm64/sysreg: add system registers SCTLR2_EL2 Yeoreum Yun
2025-08-04 12:24 ` Mark Brown
2025-08-04 13:05 ` Yeoreum Yun
2025-08-04 12:17 ` [PATCH 02/11] arm64: make SCTLR2_EL1 accessible Yeoreum Yun
2025-08-04 12:17 ` [PATCH 03/11] arm64: initialise SCTLR2_ELx register at boot time Yeoreum Yun
2025-08-04 12:17 ` [PATCH 04/11] arm64: cpufeature: add FEAT_SCTLR2 feature Yeoreum Yun
2025-08-04 12:17 ` [PATCH 05/11] arm64: save/restore SCTLR2_EL1 when cpu_suspend()/resume() Yeoreum Yun
2025-08-04 12:17 ` [PATCH 06/11] arm64: init SCTLR2_EL1 at cpu_soft_restart() Yeoreum Yun
2025-08-04 12:17 ` [PATCH 07/11] arm64: make the per-task SCTLR2_EL1 Yeoreum Yun
2025-08-05 9:01 ` kernel test robot
2025-08-04 12:17 ` [PATCH 08/11] KVM: arm64: initialise SCTLR2_EL1 at __kvm_host_psci_cpu_entry() Yeoreum Yun
2025-08-04 12:17 ` [PATCH 09/11] KVM: arm64: support SCTLR2_EL1 for guest Yeoreum Yun
2025-08-04 12:17 ` [PATCH 10/11] KVM: arm64: nv: support SCTLR2_ELx on nv Yeoreum Yun
2025-08-04 13:11 ` Marc Zyngier [this message]
2025-08-04 15:03 ` Yeoreum Yun
2025-08-04 12:17 ` [PATCH 11/11] KVM: arm64: expose FEAT_SCTLR2 feature to guest Yeoreum Yun
2025-08-04 12:37 ` [PATCH 00/11] support SCTLR2_ELx Marc Zyngier
2025-08-04 13:04 ` Yeoreum Yun
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=86pldb6xkl.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=Dave.Martin@arm.com \
--cc=ahmed.genidi@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=frederic@kernel.org \
--cc=james.clark@linaro.org \
--cc=james.morse@arm.com \
--cc=joey.gouly@arm.com \
--cc=kevin.brodsky@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mbenes@suse.cz \
--cc=oliver.upton@linux.dev \
--cc=pavel@kernel.org \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=ry111@xry111.site \
--cc=ryan.roberts@arm.com \
--cc=scott@os.amperecomputing.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
--cc=yeoreum.yun@arm.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).