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 BA034C3DA4A for ; Mon, 19 Aug 2024 17:18:10 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From: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=+Uxaf2uPEGz6JAIwWcp+uLDwRv/wXm5qa8lSaQMiGRM=; b=Z97c4pDoDt7A6Y26Xf00yXO/dq sujkR3VIEEeZ4C9hjlrISgu8id9zlB8MFYrFIM9gbH+eWL8pFE4HA9p9bePsoqKuGsybcyFXoehJ9 wWgEFhZFfDfcFQeNIcGDCgxiUOayryTUInWe6dNn7wbQRbozF3ovFVzrlBCZNOnhpLrxwOUvL6tIx ODPULtPFuzhO0igNYg7JzbPvbV1ZRiDGh/sEfe+cKgnfh+4xwUzd4TmWBaNm/C3yC6yjFpvqjIw4+ pq2BfkegyQC7qvgmnTuwyMfAacEppzV6W6TilVWFGJaiNYCcRiaUKsFYQuKScQC3AwiBHhXWQizoQ UwPX1ywg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg614-00000002NEn-2IT5; Mon, 19 Aug 2024 17:18:02 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5sY-00000002Kdj-2LOC for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2024 17:09:15 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C2DDD60A3C; Mon, 19 Aug 2024 17:09:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31FABC4AF0E; Mon, 19 Aug 2024 17:09:09 +0000 (UTC) Date: Mon, 19 Aug 2024 18:09:06 +0100 From: Catalin Marinas To: Dave Martin Cc: Joey Gouly , linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org, aneesh.kumar@kernel.org, aneesh.kumar@linux.ibm.com, bp@alien8.de, broonie@kernel.org, christophe.leroy@csgroup.eu, dave.hansen@linux.intel.com, hpa@zytor.com, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, maz@kernel.org, mingo@redhat.com, mpe@ellerman.id.au, naveen.n.rao@linux.ibm.com, npiggin@gmail.com, oliver.upton@linux.dev, shuah@kernel.org, szabolcs.nagy@arm.com, tglx@linutronix.de, will@kernel.org, x86@kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v4 18/29] arm64: add POE signal support Message-ID: References: <20240503130147.1154804-1-joey.gouly@arm.com> <20240503130147.1154804-19-joey.gouly@arm.com> <20240801155441.GB841837@e124191.cambridge.arm.com> <20240806103532.GA1986436@e124191.cambridge.arm.com> <20240806143103.GB2017741@e124191.cambridge.arm.com> <20240815131815.GA3657684@e124191.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TUID: jP0NMMmVUuyc X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240819_100914_672182_9F49A2EB X-CRM114-Status: GOOD ( 14.77 ) 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, Aug 15, 2024 at 04:09:26PM +0100, Dave P Martin wrote: > On Thu, Aug 15, 2024 at 02:18:15PM +0100, Joey Gouly wrote: > > That's a lot of words to say, or ask, do you agree with the approach of only > > saving POR_EL0 in the signal frame if num_allocated_pkeys() > 1? > > > > Thanks, > > Joey > > ...So..., given all the above, it is perhaps best to go back to > dumping POR_EL0 unconditionally after all, unless we have a mechanism > to determine whether pkeys are in use at all. Ah, I can see why checking for POR_EL0_INIT is useful. Only checking for the allocated keys gets confusing with pkey 0. Not sure what the deal is with pkey 0. Is it considered allocated by default or unallocatable? If the former, it implies that pkeys are already in use (hence the additional check for POR_EL0_INIT). In principle the hardware allows us to use permissions where the pkeys do not apply but we'd run out of indices and PTE bits to encode them, so I think by default we should assume that pkey 0 is pre-allocated. So I agree that it's probably best to save it unconditionally. -- Catalin