Received: by 10.192.165.148 with SMTP id m20csp552710imm; Fri, 4 May 2018 15:02:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpKZX+/WFgBKt88WuZGo048VNNx3vSHoJH7EONah7b1C2rAMcaLWG8fEMEKiOxgA3oZoWPD X-Received: by 2002:a17:902:9303:: with SMTP id bc3-v6mr29213148plb.18.1525471326540; Fri, 04 May 2018 15:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525471326; cv=none; d=google.com; s=arc-20160816; b=s03JYDOaPlehf1AevGLl4/5mHfVBySvbV4dUELuNknDrL+TvdBavaLakCzz0Ma2DC4 dglC8WOcjNFlmHp+cImCPPyZEFvnXp4ZBCnjpJJQV0HpkI3h3o8nT5830skKRYNpgBF9 V8wfk8Pg4JCLU/FPJJFCCGHmZ/731vBs9RS56aYlm5OnMhi09YwakYfxXDC/2iPuBBSe AbkYdN1M008IwRvEpsBLq5BqCCReNzOeysJYXAjXTak4MRszPWJ5IoQs4ialEUvtUB8w WEzUy7BzJi+Lks9HTqQLzhLUHFav63ka58Yn1rs5iuD1Dt2Xw309bnt2s0ZdKVxD5UKb vIJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=9iglb2/kMOFnfKTo1Ydy0zwk8HC/08AHjTMCVe03db0=; b=OhmxtV8m8E+TPxNcowYCDs96nxEe2jGHJXvSu7x6kZX2S3TZ5b1OIxA943QnvwlieO 5C2akst/CdkddxWHiIsl6W9hIo6xXPkr1Mu7Y2Uj0Fz0svGReVxFXYnBBP0lujIQR4hv A0I+5NA+ht8kXQooiBRdsxEeY9iTb2iM9fXEoeu7TsBQzD928cMxQkL5xVwXNo83Ayj8 Qgr1hLIQMaaH/8kZV4Sm4qHdTu/SbmYCXXDQcQ/SFzhNzTIkBlHkIED9wUCqMfaAupu7 ux7btr1g0ZmJqmST579WyN6wWoEuUhJZUDCT/8MUejxwYEoFqPRIxHlXftfnvokm85DC ghAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=q+Kz8XDH; 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 r10-v6si11475326pgs.647.2018.05.04.15.01.52; Fri, 04 May 2018 15:02:06 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=q+Kz8XDH; 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 S1751811AbeEDWAG (ORCPT + 99 others); Fri, 4 May 2018 18:00:06 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:34451 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751781AbeEDWAE (ORCPT ); Fri, 4 May 2018 18:00:04 -0400 Received: by mail-qk0-f194.google.com with SMTP id p186so17810931qkd.1; Fri, 04 May 2018 15:00:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=9iglb2/kMOFnfKTo1Ydy0zwk8HC/08AHjTMCVe03db0=; b=q+Kz8XDHjVLYWWtaPqWpzdGY6bqfXuajvq/eK2iTJH/0KoC9w6SDdoISxM4XfeWaHy ZIVeJo9v1/E+IXMT9WiPwn6tVndSVfvgWGDZ+ssEPiVtm0SaZdITcpRvqiUcLBuF3a/0 BKem5e9ZLfDXxRgwVchlDomFC1tJm810pb6yaudrd8Nk1Kcy9h6dfI9z+99Zj4bBADzt aB4rM0VSjrzmDmXHdbR6lG4xMdU8y6dP/1FnZ9KXjsxs7Z12DPC1YVqAdLhlO0rvkVgB T7c92Lg9L8cyqV5/2egIPv6A+Cr5O1tIXbLIYvATQwWSMwKO75d4XuKKeHvukADM/Eqo eU+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=9iglb2/kMOFnfKTo1Ydy0zwk8HC/08AHjTMCVe03db0=; b=dt9y766oNCPP1O/74G/NYphAnA/Ypew0WBe7s7nVgeasivy44wOinuRUhCuXe6sFjt jorascrdL0OCnjJvofaTbjl5+G3oeSTH55OF1Jpgeh8uWu6FtzpTq8E8O/HGPQwGx+Nu dfmFdn/rwhYGdA0yO+2h+F1FN0ppnFMF1O2F89Mh3QYh/7cow+6zjcdwI97iomNW1t3i y+IaaQCgrConiwdk8EyGudGoGUDRoL8aLHKwFx/hFIW5Ctf6wpQj1fWlKZMR/+tARH6k 5H0eOq6ZU13Kc5prcqfWqm3U9kT1nuez5eCa77f3dfZSfOUghNLAXhBvHxlshGvYMhX7 V1aA== X-Gm-Message-State: ALQs6tDZ4kiYTZNZxCF5CeTik6GDGbudHj4rMhy9cc6CiX5KmtVhRwp1 yWSY+J1Nl4WMRsaBTl/vcW8= X-Received: by 10.55.65.82 with SMTP id o79mr11709381qka.327.1525471203737; Fri, 04 May 2018 15:00:03 -0700 (PDT) Received: from localhost.localdomain ([170.225.9.142]) by smtp.gmail.com with ESMTPSA id i45-v6sm15488910qta.12.2018.05.04.14.59.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 May 2018 15:00:01 -0700 (PDT) From: Ram Pai To: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, dave.hansen@intel.com, 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, linuxram@us.ibm.com, corbet@lwn.net, arnd@arndb.de Subject: [PATCH v13 0/3] mm, x86, powerpc: Enhancements to Memory Protection Keys. Date: Fri, 4 May 2018 14:59:40 -0700 Message-Id: <1525471183-21277-1-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series provides arch-neutral enhancements to enable memory-keys on new architecutes, and the corresponding changes in x86 and powerpc specific code to support that. a) Provides ability to support upto 32 keys. PowerPC can handle 32 keys and hence needs this. b) Arch-neutral code; and not the arch-specific code, determines the format of the string, that displays the key for each vma in smaps. History: ------- version 14: (1) made VM_PKEY_BIT4 unusable on x86, #defined it to 0 -- comment by Dave Hansen (2) due to some reason this patch series continue to break some or the other build. The last series passed everything but created a merge conflict followed by build failure for Michael Ellermen. :( version v13: (1) fixed a git bisect error. :( version v12: (1) fixed compilation errors seen with various x86 configs. version v11: (1) code that displays key in smaps is not any more defined under CONFIG_ARCH_HAS_PKEYS. - Comment by Eric W. Biederman and Michal Hocko (2) merged two patches that implemented (1). - comment by Michal Hocko version prior to v11: (1) used one additional bit from VM_HIGH_ARCH_* to support 32 keys. - Suggestion by Dave Hansen. (2) powerpc specific changes to support memory keys. Ram Pai (3): mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS is enabled mm, powerpc, x86: introduce an additional vma bit for powerpc pkey mm, x86, powerpc: display pkey in smaps only if arch supports pkeys arch/powerpc/include/asm/mmu_context.h | 5 ----- arch/powerpc/include/asm/pkeys.h | 2 ++ arch/x86/include/asm/mmu_context.h | 5 ----- arch/x86/include/asm/pkeys.h | 1 + arch/x86/kernel/fpu/xstate.c | 5 +++++ arch/x86/kernel/setup.c | 8 -------- fs/proc/task_mmu.c | 16 +++++++++------- include/linux/mm.h | 15 +++++++++++---- include/linux/pkeys.h | 7 ++++++- 9 files changed, 34 insertions(+), 30 deletions(-)