Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/811886/?format=api
{ "id": 811886, "url": "http://patchwork.ozlabs.org/api/patches/811886/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1504910713-7094-29-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-29-git-send-email-linuxram@us.ibm.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1504910713-7094-29-git-send-email-linuxram@us.ibm.com/", "date": "2017-09-08T22:45:08", "name": "[20/25] powerpc: Handle exceptions caused by pkey violation", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "8dd255b44346005c65cbbce18e3e69bf9ce7066f", "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-29-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/811886/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811886/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 3xpv2R11L7z9sBW\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 9 Sep 2017 09:40:31 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xpv2Q6wLlzDrKx\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 9 Sep 2017 09:40:30 +1000 (AEST)", "from mail-qk0-x243.google.com (mail-qk0-x243.google.com\n\t[IPv6:2607:f8b0:400d:c09::243])\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 3xpss30776zDrd8\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSat, 9 Sep 2017 08:47:19 +1000 (AEST)", "by mail-qk0-x243.google.com with SMTP id d70so2319717qkc.1\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 08 Sep 2017 15:47:18 -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.15\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 08 Sep 2017 15:47:16 -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=\"fzg8zFM4\"; 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=\"fzg8zFM4\"; dkim-atps=neutral", "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gmail.com\n\t(client-ip=2607:f8b0:400d:c09::243; helo=mail-qk0-x243.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=\"fzg8zFM4\"; 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=z8dVgwpXJexQzx75mFomEgwFueWI9afcXLMsIEOU7vc=;\n\tb=fzg8zFM4GOVfJkae4vlwgranulqnX0P6XSMQpQ3xW0nbEB42o0lxit9A2bI78R4/D3\n\tO2eAvecjBgw69lTcAmLM8bhNBSmAOHwoY34M53qAOxx+70JAN97KIXRWw94z+AKHKZeV\n\tP4msMyq3N9Sm7IOhAoQo3T+UtHoKLncQ6DFyDuvZZLGcy/FBA56bIu52jC+Wu4L0jJ5v\n\t2Pr9kimXV0n9+Jaccz2dcI1So6VXQsN0QnwLehljlcX00+7fiE1pqqzIo+fp3RukRP7R\n\tq6A8zT9sndyHDbt8zqJOKMZFcNOsbli8J47C4tpz6OwkJqbp9/ENAsWAuAo67iGlKlrK\n\txqyg==", "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=z8dVgwpXJexQzx75mFomEgwFueWI9afcXLMsIEOU7vc=;\n\tb=RBkl60kwpO+toyaMe+AIkohl6bpFDpvpYIwDVaVH7yxGrmzs/A3CWJcaXgP4AcSlr9\n\tftMUmUYpb/MGlTxSZCpuU91U3jPHYLVk/0P/ml6RFIFEpKbauOzIqc29+6P4eRpBBKbQ\n\tGWGb6o2afs7nQDpsOvSCovW43paPkVbwD7aUGcBlOH71KYa7j+vTiuAGF2uYxatgis14\n\twoJ0/b8sWlq4JSgvLF7MvrsGnRR3zSAjSw4jjKu0JnSV02bw9pN5VZfMYJs9fkDAG9A+\n\tfs+/8esje2e1zCcTF1HRaZzYXuyeEVX/Qu9qLKKCxcIya5mo5uXHa8AsMSovcF+KlziM\n\t8sCw==", "X-Gm-Message-State": "AHPjjUgFkS1dXo044SOGWT4jf0xvT+rtDNXUBVIfrTmiSVk3cS7MjvOE\n\thGp4jelINy42ig==", "X-Google-Smtp-Source": "AOwi7QAOsuEW0j/kwUnbJNaZ1Y5JKP4fRNnqr9q/oT0EXJzWwZBd5jWdOsS5NsjpYsF0YEgJRtbn1w==", "X-Received": "by 10.55.217.67 with SMTP id u64mr6224981qki.104.1504910837138; \n\tFri, 08 Sep 2017 15:47:17 -0700 (PDT)", "From": "Ram Pai <linuxram@us.ibm.com>", "To": "mpe@ellerman.id.au,\n\tlinuxppc-dev@lists.ozlabs.org", "Subject": "[PATCH 20/25] powerpc: Handle exceptions caused by pkey violation", "Date": "Fri, 8 Sep 2017 15:45:08 -0700", "Message-Id": "<1504910713-7094-29-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": "Handle Data and Instruction exceptions caused by memory\nprotection-key.\n\nThe CPU will detect the key fault if the HPTE is already\nprogrammed with the key.\n\nHowever if the HPTE is not hashed, a key fault will not\nbe detected by the hardware. The software will detect\npkey violation in such a case.\n\nSigned-off-by: Ram Pai <linuxram@us.ibm.com>\n---\n arch/powerpc/mm/fault.c | 37 ++++++++++++++++++++++++++++++++-----\n 1 files changed, 32 insertions(+), 5 deletions(-)", "diff": "diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c\nindex 4797d08..a16bc43 100644\n--- a/arch/powerpc/mm/fault.c\n+++ b/arch/powerpc/mm/fault.c\n@@ -145,6 +145,23 @@ static noinline int bad_area(struct pt_regs *regs, unsigned long address)\n \treturn __bad_area(regs, address, SEGV_MAPERR);\n }\n \n+static int bad_page_fault_exception(struct pt_regs *regs, unsigned long address,\n+\t\t\t\t\tint si_code)\n+{\n+\tint sig = SIGBUS;\n+\tint code = BUS_OBJERR;\n+\n+#ifdef CONFIG_PPC64_MEMORY_PROTECTION_KEYS\n+\tif (si_code & DSISR_KEYFAULT) {\n+\t\tsig = SIGSEGV;\n+\t\tcode = SEGV_PKUERR;\n+\t}\n+#endif /* CONFIG_PPC64_MEMORY_PROTECTION_KEYS */\n+\n+\t_exception(sig, regs, code, address);\n+\treturn 0;\n+}\n+\n static int do_sigbus(struct pt_regs *regs, unsigned long address,\n \t\t unsigned int fault)\n {\n@@ -391,11 +408,9 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,\n \t\treturn 0;\n \n \tif (unlikely(page_fault_is_bad(error_code))) {\n-\t\tif (is_user) {\n-\t\t\t_exception(SIGBUS, regs, BUS_OBJERR, address);\n-\t\t\treturn 0;\n-\t\t}\n-\t\treturn SIGBUS;\n+\t\tif (!is_user)\n+\t\t\treturn SIGBUS;\n+\t\treturn bad_page_fault_exception(regs, address, error_code);\n \t}\n \n \t/* Additional sanity check(s) */\n@@ -492,6 +507,18 @@ static int __do_page_fault(struct pt_regs *regs, unsigned long address,\n \tif (unlikely(access_error(is_write, is_exec, vma)))\n \t\treturn bad_area(regs, address);\n \n+#ifdef CONFIG_PPC64_MEMORY_PROTECTION_KEYS\n+\tif (!arch_vma_access_permitted(vma, flags & FAULT_FLAG_WRITE,\n+\t\t\tis_exec, 0))\n+\t\treturn __bad_area(regs, address, SEGV_PKUERR);\n+#endif /* CONFIG_PPC64_MEMORY_PROTECTION_KEYS */\n+\n+\n+\t/* handle_mm_fault() needs to know if its a instruction access\n+\t * fault.\n+\t */\n+\tif (is_exec)\n+\t\tflags |= FAULT_FLAG_INSTRUCTION;\n \t/*\n \t * If for any reason at all we couldn't handle the fault,\n \t * make sure we exit gracefully rather than endlessly redo\n", "prefixes": [ "20/25" ] }