get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/811880/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 811880,
    "url": "http://patchwork.ozlabs.org/api/patches/811880/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1504910713-7094-25-git-send-email-linuxram@us.ibm.com/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<1504910713-7094-25-git-send-email-linuxram@us.ibm.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1504910713-7094-25-git-send-email-linuxram@us.ibm.com/",
    "date": "2017-09-08T22:45:04",
    "name": "[16/25] powerpc: Program HPTE key protection bits",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "104093d58c2dc91925485c883c61d572e4bf487f",
    "submitter": {
        "id": 2667,
        "url": "http://patchwork.ozlabs.org/api/people/2667/?format=api",
        "name": "Ram Pai",
        "email": "linuxram@us.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1504910713-7094-25-git-send-email-linuxram@us.ibm.com/mbox/",
    "series": [
        {
            "id": 2303,
            "url": "http://patchwork.ozlabs.org/api/series/2303/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=2303",
            "date": "2017-09-08T22:44:40",
            "name": "powerpc: Free up RPAGE_RSV bits",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/2303/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/811880/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/811880/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xptsx5vj3z9s75\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  9 Sep 2017 09:33:09 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xptsx4jpPzDrJZ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  9 Sep 2017 09:33:09 +1000 (AEST)",
            "from mail-qt0-x244.google.com (mail-qt0-x244.google.com\n\t[IPv6:2607:f8b0:400d:c0d::244])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xpsrv5SrqzDrcp\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSat,  9 Sep 2017 08:47:11 +1000 (AEST)",
            "by mail-qt0-x244.google.com with SMTP id p55so2360852qtc.2\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 08 Sep 2017 15:47:11 -0700 (PDT)",
            "from localhost.localdomain (50-39-103-96.bvtn.or.frontiernet.net.\n\t[50.39.103.96]) by smtp.gmail.com with ESMTPSA id\n\tx124sm2033726qka.85.2017.09.08.15.47.08\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 08 Sep 2017 15:47:09 -0700 (PDT)"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"b1j19QdC\"; dkim-atps=neutral",
            "lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"b1j19QdC\"; dkim-atps=neutral",
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400d:c0d::244; helo=mail-qt0-x244.google.com;\n\tenvelope-from=ram.n.pai@gmail.com; receiver=<UNKNOWN>)",
            "lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"b1j19QdC\"; dkim-atps=neutral"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=sender:from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=K0Hf24GDDrh6AlK5eTHjFSCAfYT9HXtaGm00Pg9S4iA=;\n\tb=b1j19QdC9oG6Wc1CQg/7kvJcmgviJsZTTeH+BEXIOc92p/wfuJ4omXYwAENPS8XfD/\n\tsh6qSHre5DnLUZzIqT7zBi7Xsh0OsFf/aR0ySs0tFsI0rLk7GqVivkrng0Eiq3VYvxdR\n\t1Tmy4tQidCwU0ryD+U4ZbU5Q42nFw4d1QIVJMe0Anm7vH14Bw9mG8RnFPAJHqKQU1dGV\n\tWsCEGZ08+GSsbn9ftz70e0nYZU35ZB2JMrVjnUxgiChMvj38h51CvycUAOECWaVE5APs\n\tLzDdjl++e2lyWuCtbX5qCe7/hUr+LIQcHIoTlSAe13hK+L0pwYrmh1gPkCKg4zgedxwt\n\t+QxQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:sender:from:to:cc:subject:date:message-id\n\t:in-reply-to:references;\n\tbh=K0Hf24GDDrh6AlK5eTHjFSCAfYT9HXtaGm00Pg9S4iA=;\n\tb=P1kkeNaynQ3CyX/KFNnsv3rZBGER0evxXBAkTbyLyFTkO/A3UvCivwHVeV+E+kc/R1\n\t5NJx5LUmAi/BOmRSTujaddmsYb3be4UbG+anOznE8i2VXSgevQ1u4TPzdfgL9mujnFhB\n\t7aRHCT8SYZgS/MhkxF+h7uLl1Xj4zYLkd6MDY5K+OFniJcvbbWsbpTrI0ggjZjAu1dKf\n\tC+YVOHhtHDc9udrTuMp/Ztna3glhw1n/MNCXEHmr+TkW9D5Bp/Gf8/ikBcEgky9r8Pmg\n\t08+uqelIVrfjZDJjwN4shFEnDdizpSmihxUULAhV59XidTd36w0ABe4610G4OhpUPCe6\n\t8YnA==",
        "X-Gm-Message-State": "AHPjjUh7+qSQIUMlyWObijoOwnAvSCkYmGwB06xH4thdRHKfirrG7p1e\n\tqWKPEX861xsz7w==",
        "X-Google-Smtp-Source": "AOwi7QBX+YvRxiQl2p1n6n2DbeDNHDOdlO/oGcIkGvsZ8MHLzh3xoMMnF6NzL6BYae4d/Z5VkO/17Q==",
        "X-Received": "by 10.200.46.209 with SMTP id i17mr6044270qta.235.1504910829869; \n\tFri, 08 Sep 2017 15:47:09 -0700 (PDT)",
        "From": "Ram Pai <linuxram@us.ibm.com>",
        "To": "mpe@ellerman.id.au,\n\tlinuxppc-dev@lists.ozlabs.org",
        "Subject": "[PATCH 16/25] powerpc: Program HPTE key protection bits",
        "Date": "Fri,  8 Sep 2017 15:45:04 -0700",
        "Message-Id": "<1504910713-7094-25-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\n\t<linuxppc-dev.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>",
        "Cc": "ebiederm@xmission.com, linuxram@us.ibm.com, mhocko@kernel.org,\n\tpaulus@samba.org, aneesh.kumar@linux.vnet.ibm.com,\n\tbauerman@linux.vnet.ibm.com, khandual@linux.vnet.ibm.com",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"
    },
    "content": "Map the PTE protection key bits to the HPTE key protection bits,\nwhile creating HPTE  entries.\n\nSigned-off-by: Ram Pai <linuxram@us.ibm.com>\n---\n arch/powerpc/include/asm/book3s/64/mmu-hash.h |    5 +++++\n arch/powerpc/include/asm/mmu_context.h        |    6 ++++++\n arch/powerpc/include/asm/pkeys.h              |   13 +++++++++++++\n arch/powerpc/mm/hash_utils_64.c               |    1 +\n 4 files changed, 25 insertions(+), 0 deletions(-)",
    "diff": "diff --git a/arch/powerpc/include/asm/book3s/64/mmu-hash.h b/arch/powerpc/include/asm/book3s/64/mmu-hash.h\nindex 508275b..2e22357 100644\n--- a/arch/powerpc/include/asm/book3s/64/mmu-hash.h\n+++ b/arch/powerpc/include/asm/book3s/64/mmu-hash.h\n@@ -90,6 +90,8 @@\n #define HPTE_R_PP0\t\tASM_CONST(0x8000000000000000)\n #define HPTE_R_TS\t\tASM_CONST(0x4000000000000000)\n #define HPTE_R_KEY_HI\t\tASM_CONST(0x3000000000000000)\n+#define HPTE_R_KEY_BIT0\t\tASM_CONST(0x2000000000000000)\n+#define HPTE_R_KEY_BIT1\t\tASM_CONST(0x1000000000000000)\n #define HPTE_R_RPN_SHIFT\t12\n #define HPTE_R_RPN\t\tASM_CONST(0x0ffffffffffff000)\n #define HPTE_R_RPN_3_0\t\tASM_CONST(0x01fffffffffff000)\n@@ -104,6 +106,9 @@\n #define HPTE_R_C\t\tASM_CONST(0x0000000000000080)\n #define HPTE_R_R\t\tASM_CONST(0x0000000000000100)\n #define HPTE_R_KEY_LO\t\tASM_CONST(0x0000000000000e00)\n+#define HPTE_R_KEY_BIT2\t\tASM_CONST(0x0000000000000800)\n+#define HPTE_R_KEY_BIT3\t\tASM_CONST(0x0000000000000400)\n+#define HPTE_R_KEY_BIT4\t\tASM_CONST(0x0000000000000200)\n #define HPTE_R_KEY\t\t(HPTE_R_KEY_LO | HPTE_R_KEY_HI)\n \n #define HPTE_V_1TB_SEG\t\tASM_CONST(0x4000000000000000)\ndiff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h\nindex 8e5a87e..04e9221 100644\n--- a/arch/powerpc/include/asm/mmu_context.h\n+++ b/arch/powerpc/include/asm/mmu_context.h\n@@ -150,6 +150,12 @@ static inline int vma_pkey(struct vm_area_struct *vma)\n {\n \treturn 0;\n }\n+\n+static inline u64 pte_to_hpte_pkey_bits(u64 pteflags)\n+{\n+\treturn 0x0UL;\n+}\n+\n #endif /* CONFIG_PPC64_MEMORY_PROTECTION_KEYS */\n \n #endif /* __KERNEL__ */\ndiff --git a/arch/powerpc/include/asm/pkeys.h b/arch/powerpc/include/asm/pkeys.h\nindex 0d2488a..cd3924c 100644\n--- a/arch/powerpc/include/asm/pkeys.h\n+++ b/arch/powerpc/include/asm/pkeys.h\n@@ -67,6 +67,19 @@ static inline int vma_pkey(struct vm_area_struct *vma)\n #define AMR_RD_BIT 0x1UL\n #define AMR_WR_BIT 0x2UL\n #define IAMR_EX_BIT 0x1UL\n+\n+static inline u64 pte_to_hpte_pkey_bits(u64 pteflags)\n+{\n+\tif (!pkey_inited)\n+\t\treturn 0x0UL;\n+\n+\treturn (((pteflags & H_PAGE_PKEY_BIT0) ? HPTE_R_KEY_BIT0 : 0x0UL) |\n+\t\t((pteflags & H_PAGE_PKEY_BIT1) ? HPTE_R_KEY_BIT1 : 0x0UL) |\n+\t\t((pteflags & H_PAGE_PKEY_BIT2) ? HPTE_R_KEY_BIT2 : 0x0UL) |\n+\t\t((pteflags & H_PAGE_PKEY_BIT3) ? HPTE_R_KEY_BIT3 : 0x0UL) |\n+\t\t((pteflags & H_PAGE_PKEY_BIT4) ? HPTE_R_KEY_BIT4 : 0x0UL));\n+}\n+\n #define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2 | \\\n \t\t\t\tVM_PKEY_BIT3 | VM_PKEY_BIT4)\n #define AMR_BITS_PER_PKEY 2\ndiff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c\nindex 67f62b5..a739a2d 100644\n--- a/arch/powerpc/mm/hash_utils_64.c\n+++ b/arch/powerpc/mm/hash_utils_64.c\n@@ -232,6 +232,7 @@ unsigned long htab_convert_pte_flags(unsigned long pteflags)\n \t\t */\n \t\trflags |= HPTE_R_M;\n \n+\trflags |= pte_to_hpte_pkey_bits(pteflags);\n \treturn rflags;\n }\n \n",
    "prefixes": [
        "16/25"
    ]
}