From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755925AbcKBTP5 (ORCPT ); Wed, 2 Nov 2016 15:15:57 -0400 Received: from mga09.intel.com ([134.134.136.24]:12644 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752815AbcKBTP4 (ORCPT ); Wed, 2 Nov 2016 15:15:56 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,436,1473145200"; d="scan'208";a="1054242425" From: Dave Hansen Subject: Re: [PATCH] mm: only enable sys_pkey* when ARCH_HAS_PKEYS To: Mark Rutland , linux-kernel@vger.kernel.org References: <1477958904-9903-1-git-send-email-mark.rutland@arm.com> Cc: Andrew Morton , Mel Gorman , Russell King , Thomas Gleixner , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, torvalds@linux-foundation.org Message-ID: Date: Wed, 2 Nov 2016 12:15:50 -0700 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: <1477958904-9903-1-git-send-email-mark.rutland@arm.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 10/31/2016 05:08 PM, Mark Rutland wrote: > When an architecture does not select CONFIG_ARCH_HAS_PKEYS, the pkey_alloc > syscall will return -ENOSPC for all (otherwise well-formed) requests, as the > generic implementation of mm_pkey_alloc() returns -1. The other pkey syscalls > perform some work before always failing, in a similar fashion. > > This implies the absence of keys, but otherwise functional pkey support. This > is odd, since the architecture provides no such support. Instead, it would be > preferable to indicate that the syscall is not implemented, since this is > effectively the case. This makes the behavior of an x86 cpu without pkeys and an arm cpu without pkeys differ. Is that what we want? An application that _wants_ to use protection keys but can't needs to handle -ENOSPC anyway. On an architecture that will never support pkeys, it makes sense to do -ENOSYS, but that's not the case for arm, right?