From patchwork Fri Sep 8 22:44:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 811869 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xptQX6szYz9t16 for ; Sat, 9 Sep 2017 09:12:52 +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="fPZAHwnI"; 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 3xptQX5lvbzDrRN for ; Sat, 9 Sep 2017 09:12:52 +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="fPZAHwnI"; 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:c0d::244; helo=mail-qt0-x244.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="fPZAHwnI"; dkim-atps=neutral Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (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 3xpsrW0xZDzDrcq for ; Sat, 9 Sep 2017 08:46:51 +1000 (AEST) Received: by mail-qt0-x244.google.com with SMTP id k2so2348751qte.5 for ; Fri, 08 Sep 2017 15:46:51 -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=cKvJD8XmWWJDnK0JjFmsWIcButm+nhdKAoO4+AUYtl4=; b=fPZAHwnImYmrQQojQy6Qo22kUByyyBHkHwiqBJqIrDHOdtfmaFH45tqjhNgFgTTAQ1 RruPpZTyAXJgEo4YoPpGHD48db1xClSwj2O9t37M0Ymj6qak9R4wmcMAGKenTk8Utx1E fLZg/pKYm5PowrariLpEY82yMeksgOUDZwRvVIiNXxVg6djlyvyKOYXbCb9s0dTY7fvF oQ8w6KDzOqlk8E6VAYYvdhRJzaswp3iFq2tgNG9Ux6HFWBKgsvy9sIXQrSiO8kHgXeyJ fW5X+Q6TEb6TMlWsIPCuRxuACAfXN0deCf3OWnit9WFvXa37CQusGKYtq5zNRFH3ggrv gA0g== 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=cKvJD8XmWWJDnK0JjFmsWIcButm+nhdKAoO4+AUYtl4=; b=grWOVbBjI9WMX53PRjBl5g5I3pokcmvTJxWlvCbjewy1BZSLPsDLj6FvnsusLiuQCT h5dTCA5OwfK/Yf85GkQk7iyfqgKHWrmN8ERfbf7mHZpsLVY5sGxnHo1RtYpwTJzkQUhz +pN9vvPO59NRHV3xHMrqAxu8DmREllzRIq4llwpQAgiCfQJBN2PHvFgtIgz75pA8SqIj ikAkZ3L0mNcdqDi98BzAk8qb2T605fZm4WSwMzP7dG92rbjcYCYmiBbLOfStMbM8S+lj DjEJMxxsYsbMlJtXkLbp0cEKTOoRUlqD3UUa5H2TBkKSCwmlHMQRn19PPXPMDmjFKs/q 3gZw== X-Gm-Message-State: AHPjjUjn1UUxUDejA8B7ZU2Iixtv7WhOjzKmQPm/f9UBFQJah/x2j3CG rLxWY4PYL5isDg== X-Google-Smtp-Source: AOwi7QDi13Ira9oBW4FlUM0Bd4N94QNUaWVp4zRHYr7N9Gauga56+bBPyDOxygiTCjSMdi82IkC6QA== X-Received: by 10.200.8.72 with SMTP id x8mr6171582qth.108.1504910809282; Fri, 08 Sep 2017 15:46:49 -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.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Sep 2017 15:46:48 -0700 (PDT) From: Ram Pai To: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 05/25] powerpc: helper functions to initialize AMR, IAMR and UAMOR registers Date: Fri, 8 Sep 2017 15:44:53 -0700 Message-Id: <1504910713-7094-14-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" Introduce helper functions that can initialize the bits in the AMR, IAMR and UAMOR register; the bits that correspond to the given pkey. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/pkeys.h | 1 + arch/powerpc/mm/pkeys.c | 46 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h index 133f8c4..5a83ed7 100644 --- a/arch/powerpc/include/asm/pkeys.h +++ b/arch/powerpc/include/asm/pkeys.h @@ -26,6 +26,7 @@ #define arch_max_pkey() pkeys_total #define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2 | \ VM_PKEY_BIT3 | VM_PKEY_BIT4) +#define AMR_BITS_PER_PKEY 2 #define pkey_alloc_mask(pkey) (0x1 << pkey) diff --git a/arch/powerpc/mm/pkeys.c b/arch/powerpc/mm/pkeys.c index ebc9e84..178aa33 100644 --- a/arch/powerpc/mm/pkeys.c +++ b/arch/powerpc/mm/pkeys.c @@ -59,3 +59,49 @@ void __init pkey_initialize(void) for (i = 2; i < (pkeys_total - os_reserved); i++) initial_allocation_mask &= ~(0x1<