Received: by 10.213.65.68 with SMTP id h4csp98922imn; Thu, 15 Mar 2018 10:41:57 -0700 (PDT) X-Google-Smtp-Source: AG47ELvP+0MBZRr5GeeqObGxsH9Y4O4OUqM8ESmhoy7iP1NOu0EcDdrIS7YRV1hqIYQwrpCHxyV9 X-Received: by 2002:a17:902:33c2:: with SMTP id b60-v6mr9123742plc.222.1521135717270; Thu, 15 Mar 2018 10:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521135717; cv=none; d=google.com; s=arc-20160816; b=uLHHPGjoFTW+ge6FuxSxmue/qNMWxbc3YNfDtfi1/MAvxTKRcqtQq7tPRSUpLhBjjS gNvWKtpsQTpPdgflMUQMFZlZywVw6HH8GJacPWidl2T0hriuP9xSMAYE1KUo2AmLEgus jvY8H+UP2wpdFk3I+5REhaTfNBETPJFQduo3DPHd3ZfYwk/4QO7EOE5gan5JhJaVu6WV wF8iDG4VZAUFoBJi13cGY4NUl/i5wwvHQNIs4IQrX3w8u+HhWOMoVpKIE16+yIag0yjK 4PwwS+c7GUKPAOmBBmKSqdiez33agdqvR+Y4qxwpgzp3b0/vvC1OWgintC+AM6yev+GR NOaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=zepUa1alm7u1sflNwkljTJVlQK/mEQ23oRCDhRXBkGM=; b=v3daU2zPBOAeh5LnE1hvNDZdCrOVQM9WVGF741N/JkTKwrBmxzGWcvVTrgFS9NQR/l O0GV5UABWtCInAItBM2w1lyX5hc+dGQP1YhVKmqNedeTBLcMZyZMBORVgWjPC8a1m1iy CV1FJ23UdLJQK7XWbsOzBUAn2j428AER21yFewLJP+lSWQ+smDc50hc6rVQTRuyUb0l6 iuhJFIaE4zRfSBBasWvhfX6EaRLnD/GE0N7xxihkj3kM15dVpi+Py97gJDo9OMDz5Ml9 usPVs6qDsaTb5ofMGMhZqjitDxLoZq2YcnDHL0qKIF+eBKCOsJiVuHa9LIHZvooljOUv EyRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z61-v6si4348532plb.716.2018.03.15.10.41.43; Thu, 15 Mar 2018 10:41:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932326AbeCORkU (ORCPT + 99 others); Thu, 15 Mar 2018 13:40:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39546 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752152AbeCORkS (ORCPT ); Thu, 15 Mar 2018 13:40:18 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2FHeDq4123487 for ; Thu, 15 Mar 2018 13:40:18 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gqunkwtpq-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 15 Mar 2018 13:40:17 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Mar 2018 17:40:13 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Mar 2018 17:40:07 -0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2FHe7aE1573248; Thu, 15 Mar 2018 17:40:07 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C340A42041; Thu, 15 Mar 2018 17:32:20 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 09CEC42047; Thu, 15 Mar 2018 17:32:16 +0000 (GMT) Received: from ram.oc3035372033.ibm.com (unknown [9.85.168.17]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Thu, 15 Mar 2018 17:32:15 +0000 (GMT) Date: Thu, 15 Mar 2018 10:39:59 -0700 From: Ram Pai To: Dave Hansen Cc: Thomas Gleixner , mingo@redhat.com, mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com, corbet@lwn.net, arnd@arndb.de, fweimer@redhat.com, msuchanek@suse.com, Ulrich.Weigand@de.ibm.com Subject: Re: [PATCH v3] x86: treat pkey-0 special Reply-To: Ram Pai References: <1521061214-22385-1-git-send-email-linuxram@us.ibm.com> <20180315172129.GD1060@ram.oc3035372033.ibm.com> <2bf8e659-5a8d-a2d5-ea52-e4d395ea2201@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2bf8e659-5a8d-a2d5-ea52-e4d395ea2201@intel.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 18031517-0040-0000-0000-000004216384 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031517-0041-0000-0000-000026246DE3 Message-Id: <20180315173959.GE1060@ram.oc3035372033.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-15_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803150193 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 10:31:51AM -0700, Dave Hansen wrote: > On 03/15/2018 10:21 AM, Ram Pai wrote: > > On Thu, Mar 15, 2018 at 08:55:31AM -0700, Dave Hansen wrote: > >> On 03/15/2018 02:46 AM, Thomas Gleixner wrote: > >>>> + if (!pkey || !mm_pkey_is_allocated(mm, pkey)) > >>> Why this extra check? mm_pkey_is_allocated(mm, 0) should not return true > >>> ever. If it does, then this wants to be fixed. > >> I was thinking that we _do_ actually want it to seem allocated. It just > >> get "allocated" implicitly when an mm is created. I think that will > >> simplify the code if we avoid treating it specially in as many places as > >> possible. > > I think, the logic that makes pkey-0 special must to go > > in arch-neutral code. How about checking for pkey-0 in sys_pkey_free() > > itself? > > This is for protection against shooting yourself in the foot? Yes, that > can go in sys_pkey_free(). > > Does this need manpage and/or selftests updates? Yes. it needs selftest, manpage and documentation updates too. Unfortunately I am not getting enough reviewed-by for my selftests and documentation changes. :-( Need help! -- Ram Pai