public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Ram Pai <linuxram@us•ibm.com>
To: mpe@ellerman•id.au
Cc: linuxppc-dev@lists•ozlabs.org, dave.hansen@intel•com,
	aneesh.kumar@linux•vnet.ibm.com, bsingharora@gmail•com,
	hbabu@us•ibm.com, mhocko@kernel•org, bauerman@linux•vnet.ibm.com,
	linuxram@us•ibm.com, Ulrich.Weigand@de•ibm.com,
	fweimer@redhat•com, luto@kernel•org, msuchanek@suse•de
Subject: [PATCH v2 3/6] powerpc/pkeys: fix calculation of total pkeys.
Date: Wed, 13 Jun 2018 17:29:01 -0700	[thread overview]
Message-ID: <1528936144-6696-4-git-send-email-linuxram@us.ibm.com> (raw)
In-Reply-To: <1528936144-6696-1-git-send-email-linuxram@us.ibm.com>

Total number of pkeys calculation is off by 1. Fix it.

CC: Florian Weimer <fweimer@redhat•com>
CC: Michael Ellerman <mpe@ellerman•id.au>
CC: Thiago Jung Bauermann <bauerman@linux•ibm.com>
Signed-off-by: Ram Pai <linuxram@us•ibm.com>
---
 arch/powerpc/mm/pkeys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c
index 6529f4e..b681bec 100644
--- a/arch/powerpc/mm/pkeys.c
+++ b/arch/powerpc/mm/pkeys.c
@@ -92,7 +92,7 @@ int pkey_initialize(void)
 	 * arch-neutral code.
 	 */
 	pkeys_total = min_t(int, pkeys_total,
-			(ARCH_VM_PKEY_FLAGS >> VM_PKEY_SHIFT));
+			((ARCH_VM_PKEY_FLAGS >> VM_PKEY_SHIFT)+1));
 
 	if (!pkey_mmu_enabled() || radix_enabled() || !pkeys_total)
 		static_branch_enable(&pkey_disabled);
-- 
1.7.1

  parent reply	other threads:[~2018-06-14  0:29 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14  0:28 [PATCH v2 0/6] powerpc/pkeys: fixes to pkeys Ram Pai
2018-06-14  0:28 ` [PATCH v2 1/6] powerpc/pkeys: Enable all user-allocatable pkeys at init Ram Pai
2018-06-19 12:39   ` Michael Ellerman
2018-06-19 14:25     ` Ram Pai
2018-06-21  4:14       ` Michael Ellerman
2018-06-21 17:24         ` Ram Pai
2018-06-14  0:29 ` [PATCH v2 2/6] powerpc/pkeys: Save the pkey registers before fork Ram Pai
2018-06-19 12:39   ` Michael Ellerman
2018-06-19 14:28     ` Ram Pai
2018-06-21  4:13       ` Michael Ellerman
2018-06-21 17:35         ` Ram Pai
2018-06-14  0:29 ` Ram Pai [this message]
2018-06-19 12:40   ` [PATCH v2 3/6] powerpc/pkeys: fix calculation of total pkeys Michael Ellerman
2018-06-14  0:29 ` [PATCH v2 4/6] powerpc/pkeys: Preallocate execute-only key Ram Pai
2018-06-19 12:40   ` Michael Ellerman
2018-06-19 16:38     ` Ram Pai
2018-06-21  0:28       ` Michael Ellerman
2018-06-29  3:02   ` Thiago Jung Bauermann
2018-06-14  0:29 ` [PATCH v2 5/6] powerpc/pkeys: make protection key 0 less special Ram Pai
2018-06-19 12:40   ` Michael Ellerman
2018-06-19 16:34     ` Ram Pai
2018-06-14  0:29 ` [PATCH v2 6/6] powerpc/pkeys: Deny read/write/execute by default Ram Pai
2018-06-19 12:39   ` Michael Ellerman
2018-06-19 13:19     ` Florian Weimer
2018-06-19 16:31     ` Ram Pai
2018-06-14 12:15 ` [PATCH v2 0/6] powerpc/pkeys: fixes to pkeys Florian Weimer
2018-06-19 12:40   ` Michael Ellerman
2018-06-20 15:08     ` Florian Weimer
2018-06-21 10:28       ` Michael Ellerman
2018-06-21 18:10         ` Ram Pai
2018-06-23 15:02           ` Michael Ellerman
2018-06-25 17:06             ` Ram Pai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1528936144-6696-4-git-send-email-linuxram@us.ibm.com \
    --to=linuxram@us$(echo .)ibm.com \
    --cc=Ulrich.Weigand@de$(echo .)ibm.com \
    --cc=aneesh.kumar@linux$(echo .)vnet.ibm.com \
    --cc=bauerman@linux$(echo .)vnet.ibm.com \
    --cc=bsingharora@gmail$(echo .)com \
    --cc=dave.hansen@intel$(echo .)com \
    --cc=fweimer@redhat$(echo .)com \
    --cc=hbabu@us$(echo .)ibm.com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=luto@kernel$(echo .)org \
    --cc=mhocko@kernel$(echo .)org \
    --cc=mpe@ellerman$(echo .)id.au \
    --cc=msuchanek@suse$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox