From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754849AbcKNQoe (ORCPT ); Mon, 14 Nov 2016 11:44:34 -0500 Received: from mga06.intel.com ([134.134.136.31]:1029 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753954AbcKNQoc (ORCPT ); Mon, 14 Nov 2016 11:44:32 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,491,1473145200"; d="scan'208";a="1059319488" Subject: Re: [PATCH] mm/pkeys: generate pkey system call code only if ARCH_HAS_PKEYS is selected To: Heiko Carstens , Andrew Morton References: <20161114111251.70084-1-heiko.carstens@de.ibm.com> Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mark Rutland From: Dave Hansen Message-ID: <8d880fbe-5a20-c027-4c8f-8a464d81dcbb@linux.intel.com> Date: Mon, 14 Nov 2016 08:44:24 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20161114111251.70084-1-heiko.carstens@de.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/14/2016 03:12 AM, Heiko Carstens wrote: > Having code for the pkey_mprotect, pkey_alloc and pkey_free system > calls makes only sense if ARCH_HAS_PKEYS is selected. If not selected > these system calls will always return -ENOSPC or -EINVAL. > > To simplify things and have less code generate the pkey system call > code only if ARCH_HAS_PKEYS is selected. > > For architectures which have already wired up the system calls, but do > not select ARCH_HAS_PKEYS this will result in less generated code and > a different return code: the three system calls will now always return > -ENOSYS, using the cond_syscall mechanism. > > For architectures which have not wired up the system calls less > unreachable code will be generated. > > Signed-off-by: Heiko Carstens This is fine with me. FWIW: Acked-by: Dave Hansen From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by kanga.kvack.org (Postfix) with ESMTP id 1244B6B025E for ; Mon, 14 Nov 2016 11:44:28 -0500 (EST) Received: by mail-pa0-f72.google.com with SMTP id kr7so93388456pab.5 for ; Mon, 14 Nov 2016 08:44:28 -0800 (PST) Received: from mga06.intel.com (mga06.intel.com. [134.134.136.31]) by mx.google.com with ESMTPS id d4si22908728pfd.152.2016.11.14.08.44.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 08:44:27 -0800 (PST) Subject: Re: [PATCH] mm/pkeys: generate pkey system call code only if ARCH_HAS_PKEYS is selected References: <20161114111251.70084-1-heiko.carstens@de.ibm.com> From: Dave Hansen Message-ID: <8d880fbe-5a20-c027-4c8f-8a464d81dcbb@linux.intel.com> Date: Mon, 14 Nov 2016 08:44:24 -0800 MIME-Version: 1.0 In-Reply-To: <20161114111251.70084-1-heiko.carstens@de.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Heiko Carstens , Andrew Morton Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mark Rutland On 11/14/2016 03:12 AM, Heiko Carstens wrote: > Having code for the pkey_mprotect, pkey_alloc and pkey_free system > calls makes only sense if ARCH_HAS_PKEYS is selected. If not selected > these system calls will always return -ENOSPC or -EINVAL. > > To simplify things and have less code generate the pkey system call > code only if ARCH_HAS_PKEYS is selected. > > For architectures which have already wired up the system calls, but do > not select ARCH_HAS_PKEYS this will result in less generated code and > a different return code: the three system calls will now always return > -ENOSYS, using the cond_syscall mechanism. > > For architectures which have not wired up the system calls less > unreachable code will be generated. > > Signed-off-by: Heiko Carstens This is fine with me. FWIW: Acked-by: Dave Hansen -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org