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 6DF53C27C79 for ; Mon, 17 Jun 2024 13:42:58 +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: Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From: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=3ZBlbppOoi/sPSeYF7gaxdAuqfyJGO0cqsg4bud1ypk=; b=4WgvYCWXc+Bvu7UNcZPUdheUS5 OU7EYtpiSjLobgAv0/Icn4ZG2NZ3w92Cess2yHei4VDOyme1K0RSQMH4cqcYgx2573a0O+W7vFaDu tshQ4SIwtvYHIVl9SaN84TuifsOgyGwBVqLvM+e24E15Fv9G8PTOsiXTkVWe6b46sYzHFxYw7ds5X d6UM0hNcHtJJNiJ19S/hTBQcSUSssDqFxzjLF4qqICYaiAHuNIrdO6WaX4r/3yvVY0yEfxSKsn7lR ilJE5rOzn8PEDUt8GwB4nb85BItYbGGPnwgmFcRLHb6wnPlz6wo75hN0Y+gHW1DMltXZqM88AkL7L RbJwvyXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCdE-0000000AujW-2zjc; Mon, 17 Jun 2024 13:42:48 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJCdC-0000000Auig-3xHG for linux-arm-kernel@lists.infradead.org; Mon, 17 Jun 2024 13:42:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718631764; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3ZBlbppOoi/sPSeYF7gaxdAuqfyJGO0cqsg4bud1ypk=; b=UJKNdY69sRfGjKblEoiWm7BKktjvVfo2U7ryXNNMoRYzkDVHG2FG6mYrFUjOwZsPMTa2rz i1jQrYhSsVgKShaF5O7e4gBZNczX3cItVMWMcluy6MiAZpUkFbp4MaTQFVM9TJXawl8cT8 +pcMkCZtmX1BUmV5ytai4+/Cg3OpKAA= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-449-htwtfZpzNTiLJPIb1IiYrA-1; Mon, 17 Jun 2024 09:40:42 -0400 X-MC-Unique: htwtfZpzNTiLJPIb1IiYrA-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E0D2A19560AE; Mon, 17 Jun 2024 13:40:37 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.203]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 744B819560AE; Mon, 17 Jun 2024 13:40:29 +0000 (UTC) From: Florian Weimer To: Szabolcs Nagy Cc: Joey Gouly , dave.hansen@linux.intel.com, 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, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, 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, tglx@linutronix.de, will@kernel.org, x86@kernel.org, kvmarm@lists.linux.dev Subject: Re: [PATCH v4 17/29] arm64: implement PKEYS support In-Reply-To: (Szabolcs Nagy's message of "Fri, 31 May 2024 17:27:30 +0100") References: <20240503130147.1154804-1-joey.gouly@arm.com> <20240503130147.1154804-18-joey.gouly@arm.com> <20240531152138.GA1805682@e124191.cambridge.arm.com> Date: Mon, 17 Jun 2024 15:40:27 +0200 Message-ID: <87a5jj4rhw.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240617_064247_150811_ABD8E853 X-CRM114-Status: GOOD ( 10.75 ) 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 * Szabolcs Nagy: >> A user can still set it by interacting with the register directly, but I guess >> we want something for the glibc interface.. >> >> Dave, any thoughts here? > > adding Florian too, since i found an old thread of his that tried > to add separate PKEY_DISABLE_READ and PKEY_DISABLE_EXECUTE, but > it did not seem to end up upstream. (this makes more sense to me > as libc api than the weird disable access semantics) I still think it makes sense to have a full complenent of PKEY_* flags complementing the PROT_* flags, in a somewhat abstract fashion for pkey_alloc only. The internal protection mask register encoding will differ from architecture to architecture, but the abstract glibc functions pkey_set and pkey_get could use them (if we are a bit careful). Thanks, Florian