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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D939C27C79 for ; Mon, 17 Jun 2024 13:40:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DAD3D6B01F4; Mon, 17 Jun 2024 09:40:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D5D766B01F5; Mon, 17 Jun 2024 09:40:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C258A6B01F6; Mon, 17 Jun 2024 09:40:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 9B5FA6B01F4 for ; Mon, 17 Jun 2024 09:40:49 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 236C21C2551 for ; Mon, 17 Jun 2024 13:40:49 +0000 (UTC) X-FDA: 82240491018.12.E8B6079 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf15.hostedemail.com (Postfix) with ESMTP id 4F98FA0023 for ; Mon, 17 Jun 2024 13:40:47 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aY6BDo+c; spf=pass (imf15.hostedemail.com: domain of fweimer@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=fweimer@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718631644; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=3ZBlbppOoi/sPSeYF7gaxdAuqfyJGO0cqsg4bud1ypk=; b=cH1xoDF/Z/wPR4jWvNIxRKJFlk0bDieXfhIEY3ECQSy25jMrNmo7Y6O2iZBTNcGyHc3G77 N8llA8idEoBteHeTcXfth9XhLS6JR0n0hTXZxjNdyJlKfdUA/ip3HVfU8HGID+OptzRMLj CXkT7eHsAYDU5nCKw6coDywz6CKOvz4= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aY6BDo+c; spf=pass (imf15.hostedemail.com: domain of fweimer@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=fweimer@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718631644; a=rsa-sha256; cv=none; b=4v3Vpqr5QUtRQ7AM7tZnl5c4L343XPDqJ4+jcd/fPZpPQBeHVJDY/xe19xTyE98b+XDRza bWgJxYzg6Usm2D6c6yFRrQI3CtzQfTAflYZI4Odh3txArFzlb8LJu4D6vSoSizwVInmwgE 3g+4owJxv0ymx92X7Cqiug7fc3HMFQk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718631646; 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=aY6BDo+cLH2DDvPNkPazGI8GO3WiLr63J32GbDn6famSyfEB9H9McaaYQpCPHucTRfOnzV NsPywxfN5zeWrCua9XoioblZdSPzwdzof1/81rVQwRfPaZ6wQJ+ezWyrsLlwG1jg/4kQtU Vrx6d8WAZ04QA7g+aH4RBGwp2Q/MlDE= 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-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 4F98FA0023 X-Stat-Signature: neiise14qy3ikhhgyyizp14q1ue5s495 X-HE-Tag: 1718631647-234024 X-HE-Meta: U2FsdGVkX1+ofsP1dwv2lHBpiGEOIEVnFEkeFRv3rHA6Cnxbml6Jhk39r4GYCS7jeU2l1j8j8iU6Kl7Jrzafck4LfPtzYijO+URQ3/CjjYEyK5HwSQ6PpLzpNP86dFVdN7F7OyjLISrjxkS0ejyT9e0U76J5x1ba2F8B5tOGCiKkCL5tl6ZaqpG+yn5QIJAdCsZjKRvhLxu4Y+gDCrpxoWA/l+iAp/ZfvTEUJQLUe1XhiAJcykvMP4EOoyK2aEKlfFDW8vAOMQ4PybUSLhGg4fyQgTN0/W6DGMQ4iDKgpMgc4ePYPJa1yVaNElSyKmlXiYbvX8rSgN02z4DWEX5R5swyFLnnORp54hroTHY2ykrnzYh51PbPG9YB3ZzfJVyxB4j7kNiTwCIHOeH26Kx25rKdEi53y84aiv97fGQermxgQfBmYkwfD+RkQlhohrd8tJ7r7piL7OuO6mLQXmAcgH68s38Zp/7tfvriGTkVXUTsn93oJhuaIEX9qrP9DiB67j2oyABWkFVnwzePEeOsKJVfMXj6wQyqcMIat27WGRoDuIJSIE3FgkGRvdfvKGPkOP8yyXvrh2gjmZcONeqZ/UfE/udKtdDsxtjpZleKMCG5QGP2+qZBZxTrGfYFtzJNhxxZkqt4EL6W1NqUHEwLomLSNCV7095ErHqJiZss8XoUxwCgEqchr5wcqq3A4b73MmU6ZGMIuFonmfFt/1b1Ses6+Z8iP9aFAUuRU8nyNJRijLNZgXlWD40pTKfBBH/nlvzzMTKHEMwkSCcrIP8ten93kPYhEzmYweScPDWNuL5rtHwho9zeB0iVAmcUPZTMiy4tAb+Bv45bxenaiauJE5swm1sXZY+6RmDSm+/MysL9giDWm91SWezp/4VNOlwXc/8TPmUIIEphTtsjzrJhKXMcBQKcOjPgsnqvkKErFalXV7nLnPMTLOlxw1wohFh4AQK+Dsqx24YPz6OROki DDwG3UCb gsz39kybpjNdmio4opu+GU5WWzqdDSsmlYUcASymepV3MokAmNYV7qg/8eyUVxJVGpqp5M/lGLvXoMHjl6PwjIcg1CnVxFhZRPcL4orWvropXy5H7YN+kK67ZzVN8bs+RoijEAnd8Lu15TfBdwZS2j3matLGY/rddGJmFRSkoEiwytuzI3xfkj8oQnetTaePgKZzVs4RSb/+ONOsLUTx3s30n1/+pobmcGmFewrr8Mh1aUtk= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: * 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