From patchwork Fri Sep 8 22:44:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 811866 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xptHq11HBz9sCZ for ; Sat, 9 Sep 2017 09:07:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y5CEUQ1q"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xptHp6mbVzDrW9 for ; Sat, 9 Sep 2017 09:07:02 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y5CEUQ1q"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400d:c09::241; helo=mail-qk0-x241.google.com; envelope-from=ram.n.pai@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y5CEUQ1q"; dkim-atps=neutral Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xpsrQ2YcVzDrcw for ; Sat, 9 Sep 2017 08:46:46 +1000 (AEST) Received: by mail-qk0-x241.google.com with SMTP id d70so2319242qkc.1 for ; Fri, 08 Sep 2017 15:46:46 -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:in-reply-to:references; bh=fI87wqS09rjPsxj4rgpePywskMJXvvD0GsRtmxqdjzc=; b=Y5CEUQ1q/wsvJNJuo2DxGK+2cufyvqebiO5q1tAh7gNlTpjV2S9DXfCR7ebe62xZOR MI25IfzKIhlg53Hp30WwDA69ZrX+gmDxekE6Zrjdk+sKzmIra0wNY8iRH6mj1kWyCY93 e61sVn7yqtmN6WkOVedvF9FVD+0Jwm87wSiuOTG9ezc+rYtR+o0GjuBy7J1Nfae0X7Tq rqfgxPSd5djsVdfPevwRrtJ/Udrv4IrUSTWpRodcZ6Jdq/GeNi21bQXitrlkf55fO4iH /9dyzybbBPcglJkeqGKUOJyhH6OwgmGYl8DGc0FcdGSd5GRZE0kblT3/A9znhOUTJ5H2 M6Jw== 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 :in-reply-to:references; bh=fI87wqS09rjPsxj4rgpePywskMJXvvD0GsRtmxqdjzc=; b=nk/eJo8u1X1G2H0NuD9RBnpNVbMemdfLYJSDrebYhRHGk5o/l9GH/NpW0UXtmL4im5 eNvUndPJ/ry83bx1ynLM/R+NzBn3wtbwshzR4ZJt0L9XXKJUhNvb1i1JwQ/Hm2FOgGgj jllBlqiWqI+kkqNdelNlm9W+5llBNcgHdKtJJFMm6Piyv6xLemWWCEuPuwKQruzeKdzb RIlG1MDfEctpHFP5dbekFFsklvpE7OrpF2GXpzL0im5cCQOA4AdZavL6hN4qA5LZoTcC G3HGYQ6zADir2/jSScmeLkaJOdak7aA4fdofLyVgD3l/4IFULrh1fEU2c7X1P3+Zne29 L02A== X-Gm-Message-State: AHPjjUgxFy8rVDbmWzKQwtCvF5e3OsCMFXuPsz0K0UXy/y3jmr2Hqgt9 FwX8r4kqeATQLQ== X-Google-Smtp-Source: AOwi7QDpCv3lwtSa3Sgd5IvrEWG+Z+aPbk+e8MpzYh2p9z/pRqWPS69QYboJ5HAf+3OXyHBuAjRAAQ== X-Received: by 10.55.100.11 with SMTP id y11mr5570378qkb.54.1504910804189; Fri, 08 Sep 2017 15:46:44 -0700 (PDT) Received: from localhost.localdomain (50-39-103-96.bvtn.or.frontiernet.net. [50.39.103.96]) by smtp.gmail.com with ESMTPSA id x124sm2033726qka.85.2017.09.08.15.46.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Sep 2017 15:46:43 -0700 (PDT) From: Ram Pai To: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 02/25] powerpc: define an additional vma bit for protection keys. Date: Fri, 8 Sep 2017 15:44:50 -0700 Message-Id: <1504910713-7094-11-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1504910713-7094-1-git-send-email-linuxram@us.ibm.com> References: <1504910713-7094-1-git-send-email-linuxram@us.ibm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ebiederm@xmission.com, linuxram@us.ibm.com, mhocko@kernel.org, paulus@samba.org, aneesh.kumar@linux.vnet.ibm.com, bauerman@linux.vnet.ibm.com, khandual@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" powerpc needs an additional vma bit to support 32 keys. Till the additional vma bit lands in include/linux/mm.h we have to define it in powerpc specific header file. This is needed to get pkeys working on power. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/pkeys.h | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h index c02305a..44e01a2 100644 --- a/arch/powerpc/include/asm/pkeys.h +++ b/arch/powerpc/include/asm/pkeys.h @@ -3,6 +3,24 @@ extern bool pkey_inited; extern bool pkey_execute_disable_support; + +/* + * powerpc needs an additional vma bit to support 32 keys. + * Till the additional vma bit lands in include/linux/mm.h + * we have to carry the hunk below. This is needed to get + * pkeys working on power. -- Ram + */ +#ifndef VM_HIGH_ARCH_BIT_4 +#define VM_HIGH_ARCH_BIT_4 36 +#define VM_HIGH_ARCH_4 BIT(VM_HIGH_ARCH_BIT_4) +#define VM_PKEY_SHIFT VM_HIGH_ARCH_BIT_0 +#define VM_PKEY_BIT0 VM_HIGH_ARCH_0 +#define VM_PKEY_BIT1 VM_HIGH_ARCH_1 +#define VM_PKEY_BIT2 VM_HIGH_ARCH_2 +#define VM_PKEY_BIT3 VM_HIGH_ARCH_3 +#define VM_PKEY_BIT4 VM_HIGH_ARCH_4 +#endif + #define ARCH_VM_PKEY_FLAGS 0 static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey)