Received: by 10.223.176.46 with SMTP id f43csp1934515wra; Sun, 21 Jan 2018 07:35:38 -0800 (PST) X-Google-Smtp-Source: AH8x226qX8WSSxH2Bm9WPOIe75+0nho6lqBdc6piqUkbBvwMek0juCZ+kR7Oojqe4jgOuNnNucia X-Received: by 10.99.60.13 with SMTP id j13mr4729906pga.306.1516548938446; Sun, 21 Jan 2018 07:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516548938; cv=none; d=google.com; s=arc-20160816; b=o8SpNWz6Yql7SMKZbGzTrVHFsytIRT0Bpo9WCloxtP5j6QNCpBSTtaA/4WrYO6MwRA woPAlMaN0Zu0jNR9OZDFuwNaGN3APNgrGJCcYsvoA15Nem+oYLm3kQ5OghWgUt5MnWQ/ 1KfPc0+UTxSQrbX0s+aXD4g8rZKxc9D6gLEQ+ZMf/z/XqHKx0/OFwkRxz8xOvnJWBvHR ynTdqPPJg5Qh2LKnH9E2Bm/hMqSVJoTh45sAVJ0yJSiJ3htHNZwUavxkr5496I/5qCMN 4XOriHZ/XEr/A3lsDKvWURWPmAJJnlk1QB3M1yOng59mWb6uS9pp60t1dHdVEXV1kZVw 2r+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:references :in-reply-to:subject:cc:to:from:arc-authentication-results; bh=6PL1J6/W80Hu39jAy83VrGZ8QVvfwgQ9+S1PyPI+qLU=; b=V19W0SP9i66YrYrk53sPRIWcysjDGZ1/F/jW8rzfaK0uvkK5Xr/mNkURTTcLGGIxns xXgW6p+lNxGOqEuQYwMdH7Mma5qhKPzxk45eTqT3B9KJOMnq5Gyp2aaj4V4ECqsfmnQ2 PDfIW4J9M6pV+6yFc1TYg1RThDU2I4BmOELZq6mRcIa9H5ZzOn3YFyzCjbCQFwqaXrmf CjPknUuTZM71Aa/ADXD083YF9XP82/97imliuMAkoiUCYNZKv07V/fnExbtr2et/csBZ 89aWdHpGz/DWy/bxRc+lvpp15BcZEzkI78krwVXF10kyG6l16FKXLsz08QZBCYE1oaC3 GCrg== 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 u14si12082325pgn.261.2018.01.21.07.35.23; Sun, 21 Jan 2018 07:35:38 -0800 (PST) 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 S1750947AbeAUPeX (ORCPT + 99 others); Sun, 21 Jan 2018 10:34:23 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38268 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750766AbeAUPeV (ORCPT ); Sun, 21 Jan 2018 10:34:21 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0LFYKUv125455 for ; Sun, 21 Jan 2018 10:34:21 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fmkxhej1d-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 21 Jan 2018 10:34:20 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 21 Jan 2018 15:34:15 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 21 Jan 2018 15:34:09 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0LFY8Oc48496830; Sun, 21 Jan 2018 15:34:08 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7AEF3A404D; Sun, 21 Jan 2018 15:27:50 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77677A4040; Sun, 21 Jan 2018 15:27:45 +0000 (GMT) Received: from skywalker (unknown [9.85.83.136]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Sun, 21 Jan 2018 15:27:45 +0000 (GMT) Received: (nullmailer pid 10183 invoked by uid 1000); Sun, 21 Jan 2018 15:34:02 -0000 From: "Aneesh Kumar K.V" To: Ram Pai , mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, arnd@arndb.de Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, dave.hansen@intel.com, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com, linuxram@us.ibm.com Subject: Re: [PATCH v10 01/27] mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS is enabled In-Reply-To: <1516326648-22775-2-git-send-email-linuxram@us.ibm.com> References: <1516326648-22775-1-git-send-email-linuxram@us.ibm.com> <1516326648-22775-2-git-send-email-linuxram@us.ibm.com> Date: Sun, 21 Jan 2018 21:04:02 +0530 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 18012115-0012-0000-0000-000005A62795 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012115-0013-0000-0000-00001921A97C Message-Id: <87mv17rzth.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-21_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=8 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-1801210227 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ram Pai writes: > VM_PKEY_BITx are defined only if CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS > is enabled. Powerpc also needs these bits. Hence lets define the > VM_PKEY_BITx bits for any architecture that enables > CONFIG_ARCH_HAS_PKEYS. > Reviewed-by: Aneesh Kumar K.V > Signed-off-by: Ram Pai > --- > fs/proc/task_mmu.c | 4 ++-- > include/linux/mm.h | 9 +++++---- > 2 files changed, 7 insertions(+), 6 deletions(-) > > diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c > index 339e4c1..b139617 100644 > --- a/fs/proc/task_mmu.c > +++ b/fs/proc/task_mmu.c > @@ -674,13 +674,13 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma) > [ilog2(VM_MERGEABLE)] = "mg", > [ilog2(VM_UFFD_MISSING)]= "um", > [ilog2(VM_UFFD_WP)] = "uw", > -#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS > +#ifdef CONFIG_ARCH_HAS_PKEYS > /* These come out via ProtectionKey: */ > [ilog2(VM_PKEY_BIT0)] = "", > [ilog2(VM_PKEY_BIT1)] = "", > [ilog2(VM_PKEY_BIT2)] = "", > [ilog2(VM_PKEY_BIT3)] = "", > -#endif > +#endif /* CONFIG_ARCH_HAS_PKEYS */ > }; > size_t i; > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index ea818ff..01381d3 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -228,15 +228,16 @@ extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *, > #define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4) > #endif /* CONFIG_ARCH_USES_HIGH_VMA_FLAGS */ > > -#if defined(CONFIG_X86) > -# define VM_PAT VM_ARCH_1 /* PAT reserves whole VMA at once (x86) */ > -#if defined (CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS) > +#ifdef CONFIG_ARCH_HAS_PKEYS > # define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0 > # define VM_PKEY_BIT0 VM_HIGH_ARCH_0 /* A protection key is a 4-bit value */ > # define VM_PKEY_BIT1 VM_HIGH_ARCH_1 > # define VM_PKEY_BIT2 VM_HIGH_ARCH_2 > # define VM_PKEY_BIT3 VM_HIGH_ARCH_3 > -#endif > +#endif /* CONFIG_ARCH_HAS_PKEYS */ > + > +#if defined(CONFIG_X86) > +# define VM_PAT VM_ARCH_1 /* PAT reserves whole VMA at once (x86) */ > #elif defined(CONFIG_PPC) > # define VM_SAO VM_ARCH_1 /* Strong Access Ordering (powerpc) */ > #elif defined(CONFIG_PARISC) > -- > 1.7.1 > > -- > 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