From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 756A0318138; Tue, 9 Sep 2025 10:10:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757412631; cv=none; b=G4SwgXHDymhMMmLIMh5/OUlPMd7CL94QvHJkbZHJY7H1/p2qbWtevQTA0W5mx0wmZJr3xK1TTWvtPrW6k+xCW5L8vZsP5v9Qdcd0/mCmJLAQUlv5At5CXscrL4Po5tFFLDquAZ+Co9XT6QkyEv/n7PWKcZ0JPcCVbhl8Tqa5Qmk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757412631; c=relaxed/simple; bh=8dFaAu/k8M7eyPENQa+Q5aInG87lPBk4mrOmpVQhByk=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=rSkp4M8kfCgXnVssiUizgCeUf+BzE1fRFnjkjfSCzZw/DWswbVmd/BPN5GwYPvyo87IPiYO1iOrR4G9sP/whLSojiaC7LAV1EbwhgNJzOUxaRrhiJaL/srcYi60f7ZCAuEfXz0ifljVLq9dv4PTieEXkbTR2Y6qYyuzTXF3PaKM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b4zARQ9K; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b4zARQ9K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FF08C4AF09; Tue, 9 Sep 2025 10:10:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1757412631; bh=8dFaAu/k8M7eyPENQa+Q5aInG87lPBk4mrOmpVQhByk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=b4zARQ9Kn/I/jDOwzfat35RVovH1ZuTfkR+vc8thJ5Ctz6h8iJE267FUKQYvWP5Pa JPkJcn+hv1/LOfRdUSRdfZUWFvVMdTf+f3aTA3SKFCCtSggySYO8iPocxnQbkGKCl4 AXWnT7W/QHpcqCv2ZucUonUfEbWTj+AAnpWVTnpWiYKcNHu61DT7xkrxydlE9G6KPY tLdzeZriXMl8b4Zny6ZPAmZ+AICVcw042SDKdtbq+qKwia+vvl9yBaDhAhXSUJ+3dE Og/n4qQVCdTpzU2Mk+XW6eJUMXq3z2l5Jut6MgfjJ3Aik7fjl/Ln4tV0CK9Gnqm0HR u+fmT3b9mI1ww== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1uvvIy-00000004de3-3Ufv; Tue, 09 Sep 2025 10:10:28 +0000 Date: Tue, 09 Sep 2025 11:10:28 +0100 Message-ID: <86ldmoc4x7.wl-maz@kernel.org> From: Marc Zyngier To: Oliver Upton Cc: Jinqian Yang , 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 In-Reply-To: References: <20250909034415.3822478-1-yangjinqian1@huawei.com> <20250909034415.3822478-2-yangjinqian1@huawei.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: oliver.upton@linux.dev, 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 X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Tue, 09 Sep 2025 08:07:15 +0100, Oliver Upton 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 > > 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.