public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Oliver Upton <oliver.upton@linux.dev>
Cc: Jinqian Yang <yangjinqian1@huawei.com>,
	yuzenghui@huawei.com, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org,
	liuyonglong@huawei.com, wangzhou1@hisilicon.com
Subject: Re: [PATCH v2 1/3] KVM: arm64: Make ID_AA64MMFR1_EL1.HCX writable from userspace
Date: Tue, 09 Sep 2025 11:10:28 +0100	[thread overview]
Message-ID: <86ldmoc4x7.wl-maz@kernel.org> (raw)
In-Reply-To: <aL_SIwQiz3QO1fKe@linux.dev>

On Tue, 09 Sep 2025 08:07:15 +0100,
Oliver Upton <oliver.upton@linux.dev> wrote:
> 
> On Tue, Sep 09, 2025 at 11:44:13AM +0800, Jinqian Yang wrote:
> > Allow userspace to downgrade HCX in ID_AA64MMFR1_EL1. Userspace can
> > only change this value from high to low.
> > 
> > Signed-off-by: Jinqian Yang <yangjinqian1@huawei.com>
> 
> I'm not sure our quality of emulation is that great in this case. We
> have no way of trapping the register and it is always stateful. Better
> yet, our RESx infrastructure doesn't account for the presence of
> FEAT_HCX and we happily merge the contents with the host's HCRX.

Yeah, that's not good, and definitely deserves a fix.

> We should make a reasonable attempt at upholding the architecture before
> allowing userspace to de-feature FEAT_HCX.

My concern here is the transitive implications of FEAT_HCX being
disabled: a quick look shows about 20 features that depend on
FEAT_HCX, and we don't really track this. I can probably generate the
dependency graph, but that's not going to be small. Or very useful.

However, we should be able to let FEAT_HCX being disabled without
problem if the downgrading is limited to non-EL2 VMs. Same thing for
FEAT_VHE.

What do you think?

	M.

-- 
Without deviation from the norm, progress is not possible.


  reply	other threads:[~2025-09-09 16:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-09  3:44 [PATCH v2 0/3] KVM: arm64: make EL2 feature fields writable in ID_AA64MMFR1_EL1 Jinqian Yang
2025-09-09  3:44 ` [PATCH v2 1/3] KVM: arm64: Make ID_AA64MMFR1_EL1.HCX writable from userspace Jinqian Yang
2025-09-09  7:07   ` Oliver Upton
2025-09-09 10:10     ` Marc Zyngier [this message]
2025-09-09 21:38       ` Oliver Upton
2025-09-10  1:57         ` Jinqian Yang
2025-09-09  3:44 ` [PATCH v2 2/3] KVM: arm64: Make ID_AA64MMFR1_EL1.TWED " Jinqian Yang
2025-09-09  3:44 ` [PATCH v2 3/3] KVM: arm64: Make ID_AA64MMFR1_EL1.VH " Jinqian Yang
2025-09-09  5:32   ` Oliver Upton
2025-09-10  1:42     ` Jinqian Yang
2025-09-09  7:00 ` [PATCH v2 0/3] KVM: arm64: make EL2 feature fields writable in ID_AA64MMFR1_EL1 Oliver Upton
2025-09-10  1:42   ` Jinqian Yang

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=86ldmoc4x7.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuyonglong@huawei.com \
    --cc=oliver.upton@linux.dev \
    --cc=wangzhou1@hisilicon.com \
    --cc=yangjinqian1@huawei.com \
    --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