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 AE0CB14B964; Mon, 9 Sep 2024 16:28:51 +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=1725899331; cv=none; b=Di9fvRsaiwCn7x5G/jXG1cFeVfFxV5stuqdG1/ndLjC4IPLA/Up0vmdgpMs69pRliguBDbAluAc7txMoXinN5/KmtCt/KhG753aamqhPA8d620WKlJP5kw5nEM8u8lgz0P17V/ztl8y1kuAKoCafntKr/ZMGszAdZKngP4rF/Gw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725899331; c=relaxed/simple; bh=1XuRPIq83tCtJrBYSVOi/pW6Bd+pY01UHZdp1oKSDnA=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=LilQe9/GP/Y4Qlo1Fbqimc1Y3tkSVB3ybQGXVb5VbxlqMgmMir+AX99BPV9T0oZ/rDSe5fBWb7oQusqEzQCACgHI7T5Sc6n6SY0SWwPbTRr1dJnvUqSCBHE9grCmsVGvYk8x9z30emulg34/38f9MXwDbVZTXe9Uv+VafIu+Vf4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ke50+5vv; 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="ke50+5vv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CC38C4CECE; Mon, 9 Sep 2024 16:28:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725899331; bh=1XuRPIq83tCtJrBYSVOi/pW6Bd+pY01UHZdp1oKSDnA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ke50+5vvyBYGwfCbkMGu4lOUnHyZ8fTY1FgcdBDHi7TcKd59GTP9Slvmhd0g8dbH4 8ViJtZKrVmqVs0DaRD6kkCv29m6rY9NygnKCyoJH8IvIWCIAUuRhjU7856ty+RYpKm QPgt57HeDgKbjEen0VS5X4/IJ+vVZ9snbLFPKO2OekHbaSvJT29+pdzvfXJcIjRixF 8sE3gz0pIQSFVq5x3ngVWHtGziwwU9OUCTy9EiDs+h/fKt+VTlVMjVovhg1Bo6qeq9 f0D7NwMavnBZBzeDo4OY2R26tYLA5FBVnh8lSePWV99Ejl5tDfHnKg1VEi3Rkiq5RC F4Fa4T3TCuMxQ== 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.95) (envelope-from ) id 1snhFw-00BAZc-Q1; Mon, 09 Sep 2024 17:28:49 +0100 Date: Mon, 09 Sep 2024 17:28:48 +0100 Message-ID: <864j6o94fz.wl-maz@kernel.org> From: Marc Zyngier To: Shameerali Kolothum Thodi Cc: Oliver Upton , "kvmarm@lists.linux.dev" , Sebastian Ott , James Morse , "Suzuki\ K Poulose" , yuzenghui , "kvm@vger.kernel.org" , Shaoqin Huang , Eric Auger , "Wangzhou (B)" Subject: Re: [PATCH v5 07/10] KVM: arm64: Treat CTR_EL0 as a VM feature ID register In-Reply-To: <0db19a081d9e41f08b0043baeef16f16@huawei.com> References: <20240619174036.483943-1-oliver.upton@linux.dev> <20240619174036.483943-8-oliver.upton@linux.dev> <0db19a081d9e41f08b0043baeef16f16@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/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: kvm@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: shameerali.kolothum.thodi@huawei.com, oliver.upton@linux.dev, kvmarm@lists.linux.dev, sebott@redhat.com, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, kvm@vger.kernel.org, shahuang@redhat.com, eric.auger@redhat.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 Hi Shameer, On Mon, 09 Sep 2024 16:19:54 +0100, Shameerali Kolothum Thodi wrote: > > Hi Oliver/Sebastian, > > > -----Original Message----- > > From: Oliver Upton > > Sent: Wednesday, June 19, 2024 6:41 PM > > To: kvmarm@lists.linux.dev > > Cc: Marc Zyngier ; James Morse > > ; Suzuki K Poulose ; > > yuzenghui ; kvm@vger.kernel.org; Sebastian Ott > > ; Shaoqin Huang ; Eric Auger > > ; Oliver Upton > > Subject: [PATCH v5 07/10] KVM: arm64: Treat CTR_EL0 as a VM feature ID > > register > > [...] > > > @@ -2487,7 +2490,10 @@ static const struct sys_reg_desc sys_reg_descs[] = > > { > > { SYS_DESC(SYS_CCSIDR2_EL1), undef_access }, > > { SYS_DESC(SYS_SMIDR_EL1), undef_access }, > > { SYS_DESC(SYS_CSSELR_EL1), access_csselr, reset_unknown, > > CSSELR_EL1 }, > > - { SYS_DESC(SYS_CTR_EL0), access_ctr }, > > + ID_WRITABLE(CTR_EL0, CTR_EL0_DIC_MASK | > > + CTR_EL0_IDC_MASK | > > + CTR_EL0_DminLine_MASK | > > + CTR_EL0_IminLine_MASK), > > (Sorry if this was discussed earlier, but I couldn't locate it anywhere.) > > Is there a reason why we can't make the L1Ip writable as well here? > We do have hardware that reports VIPT and PIPT for L11p. > > The comment here states, > https://elixir.bootlin.com/linux/v6.11-rc7/source/arch/arm64/kernel/cpufeature.c#L489 > > " If we have differing I-cache policies, report it as the weakest - VIPT." > > Does this also mean it is safe to downgrade the PIPT to VIPT for Guest as well? It should be safe, as a PIPT CMO always does at least the same as VIPT, and potentially more if there is aliasing. Thanks, M. -- Without deviation from the norm, progress is not possible.