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 C059CC3DA4A for ; Tue, 20 Aug 2024 09:56: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=bnjw+ioMsX32W+/U+0afMGAjCJ8RkbI6twLdMA2W548=; b=pP+AZov0TUvk3LUa7HTNUXpkM3 S7/p24/qdetzP49pYyl88dF7CSxFfV1hjP18Ku5TGFj6O/rkBcKgdEdHCibgMsaW5euVUnXzNNZAR 998g1cG+hjdA21pXXFqY8aktw/X/IqyfPEqeeR0BQ4ZB9ahtl3vuSIXBumZtOsZ+kzGh323xAGLEj ihFh1B7yBkFfeyFB0X5TEdlw7/hKJ6Jay1XFGT8v2zUZJ7h0n1ypfPTMjQnNYyiQdDhVwoTF1Q7pl GbkZXclZU7Zzhf0efzscI5ZtK/f1GKtjEWmqOt1ZTKAQJfv8qVs52fdcvu0hanJsa4UnCkjksjFZH tzb3LM3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgLar-00000004gRS-3a2Q; Tue, 20 Aug 2024 09:56:01 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgLZn-00000004gBV-2zRH for linux-arm-kernel@bombadil.infradead.org; Tue, 20 Aug 2024 09:54:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bnjw+ioMsX32W+/U+0afMGAjCJ8RkbI6twLdMA2W548=; b=mobYlRtkFFarOY0odyTiJ4eTtK RdzbyGduJuFEiF9t10j7903VPt4oDFIGecW1YNO9RKkLOt+bVoT9BwZMKR3O6yKaf6JqWhfTwT+pH rb5L1IJJLg5tPj4QRmbcQmOBVFzy+1eLbuKlD/mPrRfvIKPQV8h9ZjI7yVWBmPt2WV+pZb1DUeKlI p2YMvUstrNiwDjgnTXit3ZRGRMMfSWA4j5hO/5Y89ExmgiHzBiuP6YhWV5D5EqYmaCt3IyF39UWNL +3703QL6Mmz66hGOytVOmGVjp/GS78O4U9bIJfSfnVeDDGiHC2KI9hDi1cgXr0X9lZGT8jIxBZAj4 i/RST6nA==; Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgLZk-00000009J39-0ccm for linux-arm-kernel@lists.infradead.org; Tue, 20 Aug 2024 09:54:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 50B44DA7; Tue, 20 Aug 2024 02:55:15 -0700 (PDT) Received: from e124191.cambridge.arm.com (e124191.cambridge.arm.com [10.1.197.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 532323F66E; Tue, 20 Aug 2024 02:54:46 -0700 (PDT) Date: Tue, 20 Aug 2024 10:54:41 +0100 From: Joey Gouly To: Catalin Marinas Cc: Dave Martin , 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: <20240820095441.GA688664@e124191.cambridge.arm.com> References: <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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240820_105452_447349_9CA695AA X-CRM114-Status: GOOD ( 20.10 ) 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 Mon, Aug 19, 2024 at 06:09:06PM +0100, Catalin Marinas wrote: > 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. > > You can consider pkey 0 allocated by default. You can actually pkey_free(0), there's nothing stopping that. > So I agree that it's probably best to save it unconditionally. Alright, will leave it as is! Thanks, Joey