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 47DCBC4167B for ; Thu, 7 Dec 2023 15:45:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DCED86B0096; Thu, 7 Dec 2023 10:45:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D7F926B009B; Thu, 7 Dec 2023 10:45:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C6E556B009C; Thu, 7 Dec 2023 10:45:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B7EC26B0096 for ; Thu, 7 Dec 2023 10:45:00 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8CBD1120118 for ; Thu, 7 Dec 2023 15:45:00 +0000 (UTC) X-FDA: 81540445560.13.048A835 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf02.hostedemail.com (Postfix) with ESMTP id 85E358000D for ; Thu, 7 Dec 2023 15:44:58 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf02.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1701963898; 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; bh=TJJl2lY0uQi2L88BUHvX2iVYlIZ6c0MsVwhx+dtvSfs=; b=egZaXQTVJ1Vqr7n5YAo0DfeXiDLM7St2m+Wassy8MgpAxr2uiv31HvQkdJ4BRPLQRFhwo5 FkFkSuzpFb3Bh+3MzX3IKMGuczGV5llXJS4LnKqlYql/pSlFYwm0aq9RTlLxUw+zJBDcWh NTm11bS4eeQSxoVBbHiENM+jPyI8sBA= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf02.hostedemail.com: domain of joey.gouly@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=joey.gouly@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1701963898; a=rsa-sha256; cv=none; b=yAqAcmerVq4S0SFU0pANvKTCzcO82o3VLg94fspPoy7G21ObmYNlENwfnlxbaYFNyNxD7r Qlg5po3gU1B9PKpIdJ0sR+FDRGMWp5r+3S8dKb/Epas1ZReXUSgDzuNfyomi2frd1mVhKh OZy/xoH8mgB9GXAP3KuW1IbEnyRaR5w= 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 58626106F; Thu, 7 Dec 2023 07:45:43 -0800 (PST) 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 474873F762; Thu, 7 Dec 2023 07:44:55 -0800 (PST) Date: Thu, 7 Dec 2023 15:44:44 +0000 From: Joey Gouly To: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org, akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com, broonie@kernel.org, dave.hansen@linux.intel.com, maz@kernel.org, oliver.upton@linux.dev, shuah@kernel.org, will@kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, James Morse , Suzuki K Poulose , Zenghui Yu Subject: Re: [PATCH v3 11/25] arm64: enable ARCH_HAS_PKEYS on arm64 Message-ID: <20231207154444.GA85238@e124191.cambridge.arm.com> References: <20231124163510.1835740-1-joey.gouly@arm.com> <20231124163510.1835740-12-joey.gouly@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 85E358000D X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: cqmntb6kmfe43ua7msdwjrcg4cyn14yy X-HE-Tag: 1701963898-664472 X-HE-Meta: U2FsdGVkX1+YRxr5kuy6IgqhxPvmJingedSzTQLk1Cao+8XrYgMrCd4jHzrtA7KZPvj1GuIvGHwLtP8YTnZmrYkL/gvXiSjFimYxoXi1rFwuK4yedL6kLOinkOFzp6CbL54P5hW7oqcInZbfi8ZwrTw6hffsMiHqd6bo7TWacIqFC6ykYkloM8OuZEa0J6gAGmniUP0dBq4bTe9dhM/xdPcamTS/9vAncfa01SS6GDQXWE1BjZvDL5jIEe3zcJCZx+w8D3iYr/SUML0RQC4qu4xzVgoZdlp4F2VP5l5ZldEpoBZNH+gU5ATTqJLsOXAiH3Q3Q8VeVgzjGvnwEgnCTSSGF/Nkl7roILLJGsdVRjl+/lsgztvVJAKtj4yD4Y9egoDCJyzEPujfha/wYqDEGx/VfcIDtFGXSE50OzBxMM1nqxSEHI6ShuuU405wnWA7lcFsGfToH/P3cnRjKHuslNEE4aqBNAJJxPxu9Rj+4E7iWeO3UFpZAh2jhkbpOvtipSK/iaOWGztJCnmjcpF9aagNKhsizNXVWMU2vOQqKifSIIRygnknCAHSlKEYXQ82cEpJLQyoVlsktNKk8ttpM/wP9mWaKQ+epu1+SVf2c0qCdAHPvVJB1ayISRKw39jcNtA8XlTq5DP42Isxd0rpkX58bbGeiU675PXHsynKgYLbexoluauzMGjrFoo25xRuPu4l5tVVHAfOwsx+87ERZjHu5ZFs8dIdWyj3qVCKmIq5iMHP+YrtiO2DTp8z3RKL/WFcOgP6IquwH2WXc0Oxht1T/fgJBgZATUciC74i7PNtI9LXktuLukyMGa5vW5xDgmiP+mSkZ+IF3Sovn7ELT0EQ+XlfXZjAAJotuP8OpOYKj0E05C/RFjpJavhW5xBdFsgYy5/A/If2/7JhK5QwJsFZContBkb97IZyt3CB6VzMXBZe1xYbuuQ1lo9ostlSIqWjlUPxB2b9VbaSHGC pQVLK6rN FjQTRAcxVor0JmsXLOTUSLUD4CNkTwi1kgZ3oFeFl+8tA6mxnFoEJaG3Vt4rfbYee0G3u/kP72aNNXcnx4W0ZNaxAQXrHm/LTtiiGr14XnapkXwWk6506eFOJs7FvzZoyip8aslEUYRvyRm99Td05CbZSrDAQWj/PQfsQ 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: Hi, Thanks to you and Mark for the comments so far! On Thu, Dec 07, 2023 at 03:25:17PM +0000, Catalin Marinas wrote: > On Fri, Nov 24, 2023 at 04:34:56PM +0000, Joey Gouly wrote: > > diff --git a/arch/arm64/include/asm/pkeys.h b/arch/arm64/include/asm/pkeys.h > > new file mode 100644 > > index 000000000000..5761fb48fd53 > > --- /dev/null > > +++ b/arch/arm64/include/asm/pkeys.h > > @@ -0,0 +1,54 @@ > > +/* SPDX-License-Identifier: GPL-2.0 */ > > +/* > > + * Copyright (C) 2023 Arm Ltd. > > + * > > + * Based on arch/x86/include/asm/pkeys.h > > +*/ > > + > > +#ifndef _ASM_ARM64_PKEYS_H > > +#define _ASM_ARM64_PKEYS_H > > + > > +#define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2) > > + > > +#define arch_max_pkey() 0 > > + > > +int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, > > + unsigned long init_val); > > + > > +static inline bool arch_pkeys_enabled(void) > > +{ > > + return false; > > +} > > + > > +static inline int vma_pkey(struct vm_area_struct *vma) > > +{ > > + return -1; > > +} > > What's the point of these dummies? I guess they'll be populated later > but I haven't reached that point. Could we not just leave them out for > now and add the complete version directly? This would work better with > an earlier comment to move the Kconfig entry towards the end of the > series. I think the suggestion to move the Kconfig to the end is good, and I agree that it will probably remove these dummy implementations. > > Also, they don't seem to match the generic include/linux/pkeys.h > dummies. For example, vma_pkey() returns 0 in the generic version, -1 > here. Should they actually match? If for some reason I need to keep them after the Kconfig move, I will look into this further. Thanks, Joey