get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 818314,
    "url": "http://patchwork.ozlabs.org/api/patches/818314/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/sparclinux/patch/e16385d5ab0556cfa905f0fc7d6b7f8604735958.1506089472.git.khalid.aziz@oracle.com/",
    "project": {
        "id": 10,
        "url": "http://patchwork.ozlabs.org/api/projects/10/?format=api",
        "name": "Linux SPARC Development ",
        "link_name": "sparclinux",
        "list_id": "sparclinux.vger.kernel.org",
        "list_email": "sparclinux@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<e16385d5ab0556cfa905f0fc7d6b7f8604735958.1506089472.git.khalid.aziz@oracle.com>",
    "list_archive_url": null,
    "date": "2017-09-25T16:48:56",
    "name": "[v8,5/9] sparc64: Add handler for \"Memory Corruption Detected\" trap",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "38a4ffec4306f7770f9dbc728a6df4bee084eb9f",
    "submitter": {
        "id": 42386,
        "url": "http://patchwork.ozlabs.org/api/people/42386/?format=api",
        "name": "Khalid Aziz",
        "email": "khalid.aziz@oracle.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/sparclinux/patch/e16385d5ab0556cfa905f0fc7d6b7f8604735958.1506089472.git.khalid.aziz@oracle.com/mbox/",
    "series": [
        {
            "id": 4990,
            "url": "http://patchwork.ozlabs.org/api/series/4990/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/sparclinux/list/?series=4990",
            "date": "2017-09-25T16:48:55",
            "name": "Application Data Integrity feature introduced by SPARC M7",
            "version": 8,
            "mbox": "http://patchwork.ozlabs.org/series/4990/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/818314/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/818314/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<sparclinux-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=sparclinux-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3y199Y3QTqz9t62\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 26 Sep 2017 02:52:17 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S936256AbdIYQvz (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 25 Sep 2017 12:51:55 -0400",
            "from aserp1040.oracle.com ([141.146.126.69]:40805 \"EHLO\n\taserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S936219AbdIYQvw (ORCPT\n\t<rfc822; sparclinux@vger.kernel.org>); Mon, 25 Sep 2017 12:51:52 -0400",
            "from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233])\n\tby aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2)\n\twith ESMTP id v8PGp8Ah021152\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Mon, 25 Sep 2017 16:51:09 GMT",
            "from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])\n\tby aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v8PGp8Gl017141\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Mon, 25 Sep 2017 16:51:08 GMT",
            "from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25])\n\tby userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv8PGp7dh014506; Mon, 25 Sep 2017 16:51:08 GMT",
            "from concerto.us.oracle.com (/24.9.64.241)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Mon, 25 Sep 2017 09:51:07 -0700"
        ],
        "From": "Khalid Aziz <khalid.aziz@oracle.com>",
        "To": "davem@davemloft.net, dave.hansen@linux.intel.com",
        "Cc": "Khalid Aziz <khalid.aziz@oracle.com>, dan.carpenter@oracle.com,\n\tLiam.Howlett@oracle.com, mhocko@suse.com, mingo@kernel.org,\n\tpaul.gortmaker@windriver.com, vegard.nossum@oracle.com,\n\tjane.chu@oracle.com, sparclinux@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org, Khalid Aziz <khalid@gonehiking.org>",
        "Subject": "[PATCH v8 5/9] sparc64: Add handler for \"Memory Corruption\n\tDetected\" trap",
        "Date": "Mon, 25 Sep 2017 10:48:56 -0600",
        "Message-Id": "<e16385d5ab0556cfa905f0fc7d6b7f8604735958.1506089472.git.khalid.aziz@oracle.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": [
            "<cover.1506089472.git.khalid.aziz@oracle.com>",
            "<cover.1506089472.git.khalid.aziz@oracle.com>"
        ],
        "References": [
            "<cover.1506089472.git.khalid.aziz@oracle.com>",
            "<cover.1506089472.git.khalid.aziz@oracle.com>"
        ],
        "X-Source-IP": "aserv0021.oracle.com [141.146.126.233]",
        "Sender": "sparclinux-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<sparclinux.vger.kernel.org>",
        "X-Mailing-List": "sparclinux@vger.kernel.org"
    },
    "content": "M7 and newer processors add a \"Memory corruption Detected\" trap with\nthe addition of ADI feature. This trap is vectored into kernel by HV\nthrough resumable error trap with error attribute for the resumable\nerror set to 0x00000800.\n\nSigned-off-by: Khalid Aziz <khalid.aziz@oracle.com>\nCc: Khalid Aziz <khalid@gonehiking.org>\n---\nv7:\n\t- new patch split off from patch 4/4 in v6\n\n arch/sparc/kernel/traps_64.c | 59 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 59 insertions(+)",
    "diff": "diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c\nindex 7775d011691c..565e3c2836aa 100644\n--- a/arch/sparc/kernel/traps_64.c\n+++ b/arch/sparc/kernel/traps_64.c\n@@ -1825,6 +1825,7 @@ struct sun4v_error_entry {\n #define SUN4V_ERR_ATTRS_ASI\t\t0x00000080\n #define SUN4V_ERR_ATTRS_PRIV_REG\t0x00000100\n #define SUN4V_ERR_ATTRS_SPSTATE_MSK\t0x00000600\n+#define SUN4V_ERR_ATTRS_MCD\t\t0x00000800\n #define SUN4V_ERR_ATTRS_SPSTATE_SHFT\t9\n #define SUN4V_ERR_ATTRS_MODE_MSK\t0x03000000\n #define SUN4V_ERR_ATTRS_MODE_SHFT\t24\n@@ -2022,6 +2023,56 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,\n \t}\n }\n \n+/* Handle memory corruption detected error which is vectored in\n+ * through resumable error trap.\n+ */\n+void do_mcd_err(struct pt_regs *regs, struct sun4v_error_entry ent)\n+{\n+\tsiginfo_t info;\n+\n+\tif (notify_die(DIE_TRAP, \"MCD error\", regs, 0, 0x34,\n+\t\t       SIGSEGV) == NOTIFY_STOP)\n+\t\treturn;\n+\n+\tif (regs->tstate & TSTATE_PRIV) {\n+\t\t/* MCD exception could happen because the task was\n+\t\t * running a system call with MCD enabled and passed a\n+\t\t * non-versioned pointer or pointer with bad version\n+\t\t * tag to the system call. In such cases, hypervisor\n+\t\t * places the address of offending instruction in the\n+\t\t * resumable error report. This is a deferred error,\n+\t\t * so the read/write that caused the trap was potentially\n+\t\t * retired long time back and we may have no choice\n+\t\t * but to send SIGSEGV to the process.\n+\t\t */\n+\t\tconst struct exception_table_entry *entry;\n+\n+\t\tentry = search_exception_tables(regs->tpc);\n+\t\tif (entry) {\n+\t\t\t/* Looks like a bad syscall parameter */\n+#ifdef DEBUG_EXCEPTIONS\n+\t\t\tpr_emerg(\"Exception: PC<%016lx> faddr<UNKNOWN>\\n\",\n+\t\t\t\t regs->tpc);\n+\t\t\tpr_emerg(\"EX_TABLE: insn<%016lx> fixup<%016lx>\\n\",\n+\t\t\t\t ent.err_raddr, entry->fixup);\n+#endif\n+\t\t\tregs->tpc = entry->fixup;\n+\t\t\tregs->tnpc = regs->tpc + 4;\n+\t\t\treturn;\n+\t\t}\n+\t}\n+\n+\t/* Send SIGSEGV to the userspace process with the right signal\n+\t * code\n+\t */\n+\tinfo.si_signo = SIGSEGV;\n+\tinfo.si_errno = 0;\n+\tinfo.si_code = SEGV_ADIDERR;\n+\tinfo.si_addr = (void __user *)ent.err_raddr;\n+\tinfo.si_trapno = 0;\n+\tforce_sig_info(SIGSEGV, &info, current);\n+}\n+\n /* We run with %pil set to PIL_NORMAL_MAX and PSTATE_IE enabled in %pstate.\n  * Log the event and clear the first word of the entry.\n  */\n@@ -2059,6 +2110,14 @@ void sun4v_resum_error(struct pt_regs *regs, unsigned long offset)\n \t\tgoto out;\n \t}\n \n+\t/* If this is a memory corruption detected error vectored in\n+\t * by HV through resumable error trap, call the handler\n+\t */\n+\tif (local_copy.err_attrs & SUN4V_ERR_ATTRS_MCD) {\n+\t\tdo_mcd_err(regs, local_copy);\n+\t\treturn;\n+\t}\n+\n \tsun4v_log_error(regs, &local_copy, cpu,\n \t\t\tKERN_ERR \"RESUMABLE ERROR\",\n \t\t\t&sun4v_resum_oflow_cnt);\n",
    "prefixes": [
        "v8",
        "5/9"
    ]
}