From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CEBF1CE7AB9 for ; Fri, 6 Sep 2024 07:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8bZWwASFqwBQarxxUwJxh4RrBYqJZtQzvrw5abj/Pg4=; b=p68lLRqxtU505GRbmLBJaShOfF qlGG14FnvcEBq+Rug8iaU7PNms9gvc63fNi1399fM0ujELcIryib1P6j+ykMF4D7SgE/+E5+tlxdw KNb74GGHWWekTaPkW9E2dprHRlwnX16AzR9nM9FSmhSKNBP53mSNbviQ5Dv2SSdEsdA9fj/f6f1Ts m+s7WdGF4c1+sWMqMXazodavyyUWIJHOWsIC6heUeWDu1BEEpY/Ptuc3mN4Sec17SKxzWWfnm+Gp7 u/+cDp0Ot0hdqLlFbcusKpd26MNWqr5EYfG5XmBG+oyONi6Fp6+DWI7Je5q3UMHzUetKGoce9aFs0 OmAtGSOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smTB5-0000000B2pp-0PN0; Fri, 06 Sep 2024 07:14:43 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smT12-0000000B0Ge-0AoV for linux-arm-kernel@lists.infradead.org; Fri, 06 Sep 2024 07:04:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7AE265C5665; Fri, 6 Sep 2024 07:04:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A36E3C4CEC4; Fri, 6 Sep 2024 07:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725606258; bh=0FA+XIN/Rv2y18b2DDGxt4kw89Tft0Xw5fB1+X9Mdpo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BB4gMC1AsUJMOW1tGS8d+pLxnnBm9CBB3Zs2Ztp0sfUz4/p0TASytsnYZsPIHO2hl Wo5t205nTTsv2lLLFV3qUosjvxB0sk1Gp5WOG8CMxqzymNpMA2Zb2wc19fmzVUwHPB WoATO2kjHHxzYTJn2MTZBLEKk2MUPOFjSLmDjTKzVjX7MwzVTt0WlVUAXK1tD9NEtj UrR64EaUcaXvlnp3NTFj/maz1SKnvx/E/Xis+2sQ3k40v2xny3nI59x9OSFq0+wFsV bVf0r4WYqZyY/w8H92fpISOT0JAzFoFLQPmn3VvE0QLq7FDMCaKsyls1gQoKRgGrhf 6rLdra+9YD3pQ== 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 1smT0y-00ACR1-6K; Fri, 06 Sep 2024 08:04:16 +0100 Date: Fri, 06 Sep 2024 08:04:15 +0100 Message-ID: <86h6atuuts.wl-maz@kernel.org> From: Marc Zyngier To: Joey Gouly Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu , Alexandru Elisei , Mark Brown Subject: Re: [PATCH v2 12/16] KVM: arm64: Implement AT S1PIE support In-Reply-To: <20240905153734.GA4157679@e124191.cambridge.arm.com> References: <20240903153834.1909472-1-maz@kernel.org> <20240903153834.1909472-13-maz@kernel.org> <20240905135820.GA4142389@e124191.cambridge.arm.com> <86ikvaup12.wl-maz@kernel.org> <20240905153734.GA4157679@e124191.cambridge.arm.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) 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: joey.gouly@arm.com, kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com, alexandru.elisei@arm.com, broonie@kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240906_000420_240025_FD8E5CA7 X-CRM114-Status: GOOD ( 31.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 05 Sep 2024 16:37:34 +0100, Joey Gouly wrote: > > On Thu, Sep 05, 2024 at 03:57:13PM +0100, Marc Zyngier wrote: > > Hi Joey, > > > > Thanks for having a look. > > > > On Thu, 05 Sep 2024 14:58:20 +0100, > > Joey Gouly wrote: > > > > > > Hello Marc! > > > > > > > static void compute_s1_permissions(struct kvm_vcpu *vcpu, u32 op, > > > > struct s1_walk_info *wi, > > > > struct s1_walk_result *wr, > > > > struct s1_perms *s1p) > > > > { > > > > - compute_s1_direct_permissions(vcpu, wi, wr, s1p); > > > > + if (!s1pie_enabled(vcpu, wi->regime)) > > > > + compute_s1_direct_permissions(vcpu, wi, wr, s1p); > > > > + else > > > > + compute_s1_indirect_permissions(vcpu, wi, wr, s1p); > > > > + > > > > compute_s1_hierarchical_permissions(vcpu, wi, wr, s1p); > > > > > > Is this (and the previous patch to split this up) right? > > > > > > Looking at this from the ARM ARM (ARM DDI 0487K.a): > > > > > > R JHSVW If Indirect permissions are used, then hierarchical > > > permissions are disabled and TCR_ELx.HPDn are RES 1. > > > > Odd. I was convinced that it was when S1POE is enabled that HPs were > > disabled. But you are absolutely right, and it is once more proven > > that I can't read. Oh well. > > For POE there is: > > RBVXDG Hierarchical Permissions are disabled and the > TCR_ELx.{HPD0, HPD1} bits are RES1 for stage 1 of a > translation regime using VMSAv8-64 if one or more of POE and > E0POE (for EL1&0, EL2&0) is enabled for that translation > regime. Right, this is the one I had at the back of my head. At the end of the day, it really looks like hierarchical permissions are as dead as the proverbial dodo, and their sole purpose left is to antagonise implementations. Hopefully someone realises that and eventually allows implementations to build TCR_ELx.HPD* as RES1. > > Not to worry, I've since found other issues with this series. I have > > forgotten the patch dealing with the fast path on another branch, and > > since decided that TCR2_EL2 needed extra care to cope with individual > > features being disabled. > > > > The rework is still useful, as I'm looking at POE as well, but I need > > to hoist the HP stuff up a notch. > > > > I'll repost things once I've sorted these things up. > > I think the rest of this patch looked fine though. Cool, thanks for having given it a look! M. -- Without deviation from the norm, progress is not possible.