get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 807356,
    "url": "http://patchwork.ozlabs.org/api/patches/807356/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/sparclinux/patch/1504049763-51918-2-git-send-email-rob.gardner@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": "<1504049763-51918-2-git-send-email-rob.gardner@oracle.com>",
    "list_archive_url": null,
    "date": "2017-08-29T23:36:02",
    "name": "[RFC,1/2] sparc64: Oracle DAX infrastructure",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": false,
    "hash": "444eefb92aa3506aad81916f5653147d005600ad",
    "submitter": {
        "id": 65883,
        "url": "http://patchwork.ozlabs.org/api/people/65883/?format=api",
        "name": "Rob Gardner",
        "email": "rob.gardner@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/1504049763-51918-2-git-send-email-rob.gardner@oracle.com/mbox/",
    "series": [
        {
            "id": 505,
            "url": "http://patchwork.ozlabs.org/api/series/505/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/sparclinux/list/?series=505",
            "date": "2017-08-29T23:36:02",
            "name": "[RFC,1/2] sparc64: Oracle DAX infrastructure",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/505/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/807356/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/807356/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 3xhlQx4yHLz9sMN\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 30 Aug 2017 09:36:57 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751314AbdH2Xg4 (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tTue, 29 Aug 2017 19:36:56 -0400",
            "from aserp1040.oracle.com ([141.146.126.69]:50563 \"EHLO\n\taserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751272AbdH2Xg4 (ORCPT\n\t<rfc822; sparclinux@vger.kernel.org>); Tue, 29 Aug 2017 19:36:56 -0400",
            "from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234])\n\tby aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2)\n\twith ESMTP id v7TNat6m014055\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK)\n\tfor <sparclinux@vger.kernel.org>; Tue, 29 Aug 2017 23:36:55 GMT",
            "from ca-qasparc12.us.oracle.com (ca-qasparc12.us.oracle.com\n\t[10.147.25.210])\n\tby aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id v7TNajoe023935; \n\tTue, 29 Aug 2017 23:36:54 GMT"
        ],
        "From": "Rob Gardner <rob.gardner@oracle.com>",
        "To": "sparclinux@vger.kernel.org",
        "Cc": "Rob Gardner <rob.gardner@oracle.com>,\n\tJonathan Helman <jonathan.helman@oracle.com>,\n\tSanath Kumar <sanath.s.kumar@oracle.com>",
        "Subject": "[RFC 1/2] sparc64: Oracle DAX infrastructure",
        "Date": "Tue, 29 Aug 2017 17:36:02 -0600",
        "Message-Id": "<1504049763-51918-2-git-send-email-rob.gardner@oracle.com>",
        "X-Mailer": "git-send-email 1.7.1",
        "In-Reply-To": "<1504049763-51918-1-git-send-email-rob.gardner@oracle.com>",
        "References": "<1504049763-51918-1-git-send-email-rob.gardner@oracle.com>",
        "X-Source-IP": "aserv0022.oracle.com [141.146.126.234]",
        "Sender": "sparclinux-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<sparclinux.vger.kernel.org>",
        "X-Mailing-List": "sparclinux@vger.kernel.org"
    },
    "content": "This patch adds hypercall function stubs and C templates for\nccb_submit/info/kill which provide coprocessor services for the Oracle\nData Analytics Accelerator, registration for the DAX api group, and\nall the various associated constants.\n\nSigned-off-by: Rob Gardner <rob.gardner@oracle.com>\nSigned-off-by: Jonathan Helman <jonathan.helman@oracle.com>\nSigned-off-by: Sanath Kumar <sanath.s.kumar@oracle.com>\n---\n arch/sparc/include/asm/hypervisor.h |  138 +++++++++++++++++++++++++++++++++++\n arch/sparc/kernel/hvapi.c           |    1 +\n arch/sparc/kernel/hvcalls.S         |   57 ++++++++++++++\n 3 files changed, 196 insertions(+), 0 deletions(-)",
    "diff": "diff --git a/arch/sparc/include/asm/hypervisor.h b/arch/sparc/include/asm/hypervisor.h\nindex 73cb897..401fafe 100644\n--- a/arch/sparc/include/asm/hypervisor.h\n+++ b/arch/sparc/include/asm/hypervisor.h\n@@ -75,6 +75,10 @@\n #define HV_ETOOMANY\t\t\t15 /* Too many items specified     */\n #define HV_ECHANNEL\t\t\t16 /* Invalid LDC channel          */\n #define HV_EBUSY\t\t\t17 /* Resource busy                */\n+#define HV_EUNAVAILABLE\t\t\t23 /* Resource or operation not\n+\t\t\t\t\t    * currently available, but may\n+\t\t\t\t\t    * become available in the future\n+\t\t\t\t\t    */\n \n /* mach_exit()\n  * TRAP:\tHV_FAST_TRAP\n@@ -922,6 +926,139 @@ unsigned long sun4v_mmu_map_perm_addr(unsigned long vaddr,\n  */\n #define HV_FAST_MEM_SYNC\t\t0x32\n \n+/* Coprocessor services\n+ *\n+ * M7 and later processors provide an on-chip coprocessor which\n+ * accelerates database operations, and is known internally as\n+ * DAX.\n+ */\n+\n+/* ccb_submit()\n+ * TRAP:\tHV_FAST_TRAP\n+ * FUNCTION:\tHV_CCB_SUBMIT\n+ * ARG0:\taddress of CCB array\n+ * ARG1:\tsize (in bytes) of CCB array being submitted\n+ * ARG2:\tflags\n+ * ARG3:\treserved\n+ * RET0:\tstatus (success or error code)\n+ * RET1:\tsize (in bytes) of CCB array that was accepted (might be less\n+ *\t\tthan arg1)\n+ * RET2:\tstatus data\n+ *\t\tif status == ENOMAP or ENOACCESS, identifies the VA in question\n+ *\t\tif status == EUNAVAILBLE, unavailable code\n+ * RET3:\treserved\n+ *\n+ * ERRORS:\tEOK\t\tsuccessful submission (check size)\n+ *\t\tEWOULDBLOCK\tcould not finish submissions, try again\n+ *\t\tEBADALIGN\tarray not 64B aligned or size not 64B multiple\n+ *\t\tENORADDR\tinvalid RA for array or in CCB\n+ *\t\tENOMAP\t\tcould not translate address (see status data)\n+ *\t\tEINVAL\t\tinvalid ccb or arguments\n+ *\t\tETOOMANY\ttoo many ccbs with all-or-nothing flag\n+ *\t\tENOACCESS\tguest has no access to submit ccbs or address\n+ *\t\t\t\tin CCB does not have correct permissions (check\n+ *\t\t\t\tstatus data)\n+ *\t\tEUNAVAILABLE\tccb operation could not be performed at this\n+ *\t\t\t\ttime (check status data)\n+ *\t\t\t\tStatus data codes:\n+ *\t\t\t\t\t0 - exact CCB could not be executed\n+ *\t\t\t\t\t1 - CCB opcode cannot be executed\n+ *\t\t\t\t\t2 - CCB version cannot be executed\n+ *\t\t\t\t\t3 - vcpu cannot execute CCBs\n+ *\t\t\t\t\t4 - no CCBs can be executed\n+ */\n+\n+#define HV_CCB_SUBMIT               0x34\n+#ifndef __ASSEMBLY__\n+unsigned long sun4v_ccb_submit(unsigned long ccb_buf,\n+\t\t\t       unsigned long len,\n+\t\t\t       unsigned long flags,\n+\t\t\t       unsigned long reserved,\n+\t\t\t       void *submitted_len,\n+\t\t\t       void *status_data);\n+#endif\n+\n+/* flags (ARG2) */\n+#define HV_CCB_QUERY_CMD\t\tBIT(1)\n+#define HV_CCB_ARG0_TYPE_REAL\t\t0UL\n+#define HV_CCB_ARG0_TYPE_PRIMARY\tBIT(4)\n+#define HV_CCB_ARG0_TYPE_SECONDARY\tBIT(5)\n+#define HV_CCB_ARG0_TYPE_NUCLEUS\tGENMASK(5, 4)\n+#define HV_CCB_ARG0_PRIVILEGED\t\tBIT(6)\n+#define HV_CCB_ALL_OR_NOTHING\t\tBIT(7)\n+#define HV_CCB_QUEUE_INFO\t\tBIT(8)\n+#define HV_CCB_VA_REJECT\t\t0UL\n+#define HV_CCB_VA_SECONDARY\t\tBIT(13)\n+#define HV_CCB_VA_NUCLEUS\t\tGENMASK(13, 12)\n+#define HV_CCB_VA_PRIVILEGED\t\tBIT(14)\n+#define HV_CCB_VA_READ_ADI_DISABLE\tBIT(15)\t/* DAX2 only */\n+\n+/* ccb_info()\n+ * TRAP:\tHV_FAST_TRAP\n+ * FUNCTION:\tHV_CCB_INFO\n+ * ARG0:\treal address of CCB completion area\n+ * RET0:\tstatus (success or error code)\n+ * RET1:\tinfo array\n+ *\t\t\t- RET1[0]: CCB state\n+ *\t\t\t- RET1[1]: dax unit\n+ *\t\t\t- RET1[2]: queue number\n+ *\t\t\t- RET1[3]: queue position\n+ *\n+ * ERRORS:\tEOK\t\toperation successful\n+ *\t\tEBADALIGN\taddress not 64B aligned\n+ *\t\tENORADDR\tRA in address not valid\n+ *\t\tEINVAL\t\tCA not valid\n+ *\t\tEWOULDBLOCK\tinfo not available for this CCB currently, try\n+ *\t\t\t\tagain\n+ *\t\tENOACCESS\tguest cannot use dax\n+ */\n+\n+#define HV_CCB_INFO                 0x35\n+#ifndef __ASSEMBLY__\n+unsigned long sun4v_ccb_info(unsigned long ca,\n+\t\t\t     void *info_arr);\n+#endif\n+\n+/* info array byte offsets (RET1) */\n+#define CCB_INFO_OFFSET_CCB_STATE\t0\n+#define CCB_INFO_OFFSET_DAX_UNIT\t2\n+#define CCB_INFO_OFFSET_QUEUE_NUM\t4\n+#define CCB_INFO_OFFSET_QUEUE_POS\t6\n+\n+/* CCB state (RET1[0]) */\n+#define HV_CCB_STATE_COMPLETED      0\n+#define HV_CCB_STATE_ENQUEUED       1\n+#define HV_CCB_STATE_INPROGRESS     2\n+#define HV_CCB_STATE_NOTFOUND       3\n+\n+/* ccb_kill()\n+ * TRAP:\tHV_FAST_TRAP\n+ * FUNCTION:\tHV_CCB_KILL\n+ * ARG0:\treal address of CCB completion area\n+ * RET0:\tstatus (success or error code)\n+ * RET1:\tCCB kill status\n+ *\n+ * ERRORS:\tEOK\t\toperation successful\n+ *\t\tEBADALIGN\taddress not 64B aligned\n+ *\t\tENORADDR\tRA in address not valid\n+ *\t\tEINVAL\t\tCA not valid\n+ *\t\tEWOULDBLOCK\tkill not available for this CCB currently, try\n+ *\t\t\t\tagain\n+ *\t\tENOACCESS\tguest cannot use dax\n+ */\n+\n+#define HV_CCB_KILL                 0x36\n+#ifndef __ASSEMBLY__\n+unsigned long sun4v_ccb_kill(unsigned long ca,\n+\t\t\t     void *kill_status);\n+#endif\n+\n+/* CCB kill status (RET1) */\n+#define HV_CCB_KILL_COMPLETED       0\n+#define HV_CCB_KILL_DEQUEUED        1\n+#define HV_CCB_KILL_KILLED          2\n+#define HV_CCB_KILL_NOTFOUND        3\n+\n /* Time of day services.\n  *\n  * The hypervisor maintains the time of day on a per-domain basis.\n@@ -3336,6 +3473,7 @@ unsigned long sun4v_m7_set_perfreg(unsigned long reg_num,\n #define HV_GRP_SDIO_ERR\t\t\t0x0109\n #define HV_GRP_REBOOT_DATA\t\t0x0110\n #define HV_GRP_ATU\t\t\t0x0111\n+#define HV_GRP_DAX\t\t\t0x0113\n #define HV_GRP_M7_PERF\t\t\t0x0114\n #define HV_GRP_NIAG_PERF\t\t0x0200\n #define HV_GRP_FIRE_PERF\t\t0x0201\ndiff --git a/arch/sparc/kernel/hvapi.c b/arch/sparc/kernel/hvapi.c\nindex 2677312..c3a923a 100644\n--- a/arch/sparc/kernel/hvapi.c\n+++ b/arch/sparc/kernel/hvapi.c\n@@ -40,6 +40,7 @@ struct api_info {\n \t{ .group = HV_GRP_SDIO_ERR,\t\t\t\t},\n \t{ .group = HV_GRP_REBOOT_DATA,\t\t\t\t},\n \t{ .group = HV_GRP_ATU,\t\t.flags = FLAG_PRE_API\t},\n+\t{ .group = HV_GRP_DAX,\t\t\t\t\t},\n \t{ .group = HV_GRP_NIAG_PERF,\t.flags = FLAG_PRE_API\t},\n \t{ .group = HV_GRP_FIRE_PERF,\t\t\t\t},\n \t{ .group = HV_GRP_N2_CPU,\t\t\t\t},\ndiff --git a/arch/sparc/kernel/hvcalls.S b/arch/sparc/kernel/hvcalls.S\nindex 4116ee5..f7d799e 100644\n--- a/arch/sparc/kernel/hvcalls.S\n+++ b/arch/sparc/kernel/hvcalls.S\n@@ -859,3 +859,60 @@ ENTRY(sun4v_m7_set_perfreg)\n \tretl\n \tnop\n ENDPROC(sun4v_m7_set_perfreg)\n+\n+\t/* %o0: address of CCB array\n+\t * %o1: size (in bytes) of CCB array\n+\t * %o2: flags\n+\t * %o3: reserved\n+\t *\n+\t * returns:\n+\t * %o0: status\n+\t * %o1: size (in bytes) of the CCB array that was accepted\n+\t * %o2: status data\n+\t * %o3: reserved\n+\t */\n+ENTRY(sun4v_ccb_submit)\n+\tmov\t%o5, %g1\n+\tmov\tHV_CCB_SUBMIT, %o5\n+\tta\tHV_FAST_TRAP\n+\tstx\t%o1, [%o4]\n+\tretl\n+\t stx\t%o2, [%g1]\n+ENDPROC(sun4v_ccb_submit)\n+EXPORT_SYMBOL(sun4v_ccb_submit)\n+\n+\t/* %o0: completion area ra for the ccb to get info\n+\t *\n+\t * returns:\n+\t * %o0: status\n+\t * %o1: CCB state\n+\t * %o2: position\n+\t * %o3: dax unit\n+\t * %o4: queue\n+\t */\n+ENTRY(sun4v_ccb_info)\n+\tmov\t%o1, %g1\n+\tmov\tHV_CCB_INFO, %o5\n+\tta\tHV_FAST_TRAP\n+\tsth\t%o1, [%g1 + CCB_INFO_OFFSET_CCB_STATE]\n+\tsth\t%o2, [%g1 + CCB_INFO_OFFSET_QUEUE_POS]\n+\tsth\t%o3, [%g1 + CCB_INFO_OFFSET_DAX_UNIT]\n+\tretl\n+\t sth\t%o4, [%g1 + CCB_INFO_OFFSET_QUEUE_NUM]\n+ENDPROC(sun4v_ccb_info)\n+EXPORT_SYMBOL(sun4v_ccb_info)\n+\n+\t/* %o0: completion area ra for the ccb to kill\n+\t *\n+\t * returns:\n+\t * %o0: status\n+\t * %o1: result of the kill\n+\t */\n+ENTRY(sun4v_ccb_kill)\n+\tmov\t%o1, %g1\n+\tmov\tHV_CCB_KILL, %o5\n+\tta\tHV_FAST_TRAP\n+\tretl\n+\t sth\t%o1, [%g1]\n+ENDPROC(sun4v_ccb_kill)\n+EXPORT_SYMBOL(sun4v_ccb_kill)\n",
    "prefixes": [
        "RFC",
        "1/2"
    ]
}