From patchwork Thu Jun 14 00:29:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 929143 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 415l9x1TZQz9s3x for ; Thu, 14 Jun 2018 10:39:17 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SEwf0KpO"; 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 415l9w6hYfzF0TM for ; Thu, 14 Jun 2018 10:39:16 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com 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="SEwf0KpO"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400d:c0d::22f; helo=mail-qt0-x22f.google.com; envelope-from=ram.n.pai@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SEwf0KpO"; dkim-atps=neutral Received: from mail-qt0-x22f.google.com (mail-qt0-x22f.google.com [IPv6:2607:f8b0:400d:c0d::22f]) (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 415kyY7091zDrqP for ; Thu, 14 Jun 2018 10:29:25 +1000 (AEST) Received: by mail-qt0-x22f.google.com with SMTP id l10-v6so4263320qtj.0 for ; Wed, 13 Jun 2018 17:29:25 -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=3VSYuD3Gbp6VgqSQwu7CZGU2vTVmq20ysgD87w1dMoM=; b=SEwf0KpOiXxfcx0wwPTRyQhoyQZS9zZ1ajyLgpKFPgGLi5vYa1yFtRcILqM7LJu0im 9Fan4QBfkpnQ5J8Us1MandjxWiA6NQzK9bmunlsqC9gzyUyJ477xHvbrBDH8eJ2yn89R 1z7ST5pcTIA8RJhkIMmprU93pFPwlAA6HXpx4nKAHTI9pY5FcrG5KYl90MVPNTNNNemi Tdg7gIBzuK+0xoqCXfD4I0mvY/kGGrDLCs9VKKMQDDgnkaNnynuB93BITZ2XYWECUKqA XHzQ3qmkkFyOoZtqIVyMlusQGEi9oPMkGxbzMKP4KboGy50iq8JRn2rXaelCnVhwoPD7 jzhg== 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=3VSYuD3Gbp6VgqSQwu7CZGU2vTVmq20ysgD87w1dMoM=; b=Cyr4/YUKL71hPsYewRjnPKUrpfCziSqhByFYLJXPYjeXtNpR/gHw25AaQ3HbtA1mZL Prl/OE04WSCy668Dw88tqmbwvnmrwhjsnnK/dzmOcBDd8ks0MMDumlnQomd8J4zyY9zy 5MRf2FAIRp0Ph2PrPqnrUDXBJwKFxkhjQZ6+IGJo943Vco0n9b6353QI6+BAMtLzU46m k3zEvkBBRkfmf7GHnBT7sPIkrAOAeTdug8n9OgGg5AaxbP2YrCWIHvhJCAG8mIE1GQX1 zvYPsjSlF/ZxeAjd0gzqIxZZhXww9yY/AAyRjEDd9SNXBe5m8jOIj54OUydzsXfIiULM yhfA== X-Gm-Message-State: APt69E04UglMbchC9thnncKaqYUSngl8pAJ3Diy5G512lnfFwL4SCKYg yfoit2MkiUW6eNhoVg20ZQc= X-Google-Smtp-Source: ADUXVKJJcRj36wvyQRdUTvcNSFaXY15o0IEWqHADW4hoFQLfZ+K+7LO6mMiGlNwR1vQqjRhXl4gZGg== X-Received: by 2002:ac8:36d:: with SMTP id w45-v6mr338943qtg.382.1528936163530; Wed, 13 Jun 2018 17:29:23 -0700 (PDT) Received: from localhost.localdomain (50-39-100-161.bvtn.or.frontiernet.net. [50.39.100.161]) by smtp.gmail.com with ESMTPSA id s12-v6sm3159581qkl.65.2018.06.13.17.29.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 17:29:23 -0700 (PDT) From: Ram Pai To: mpe@ellerman.id.au Subject: [PATCH v2 3/6] powerpc/pkeys: fix calculation of total pkeys. Date: Wed, 13 Jun 2018 17:29:01 -0700 Message-Id: <1528936144-6696-4-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1528936144-6696-1-git-send-email-linuxram@us.ibm.com> References: <1528936144-6696-1-git-send-email-linuxram@us.ibm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fweimer@redhat.com, Ulrich.Weigand@de.ibm.com, linuxram@us.ibm.com, mhocko@kernel.org, dave.hansen@intel.com, aneesh.kumar@linux.vnet.ibm.com, luto@kernel.org, bauerman@linux.vnet.ibm.com, msuchanek@suse.de, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Total number of pkeys calculation is off by 1. Fix it. CC: Florian Weimer CC: Michael Ellerman CC: Thiago Jung Bauermann Signed-off-by: Ram Pai --- 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);