get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 812475,
    "url": "http://patchwork.ozlabs.org/api/patches/812475/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911171235.29331-19-clg@kaod.org/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170911171235.29331-19-clg@kaod.org>",
    "list_archive_url": null,
    "date": "2017-09-11T17:12:32",
    "name": "[RFC,v2,18/21] ppc/xive: add device tree support",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0e23a73c9a7819ff4738d27156260295354c439a",
    "submitter": {
        "id": 68548,
        "url": "http://patchwork.ozlabs.org/api/people/68548/?format=api",
        "name": "Cédric Le Goater",
        "email": "clg@kaod.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911171235.29331-19-clg@kaod.org/mbox/",
    "series": [
        {
            "id": 2526,
            "url": "http://patchwork.ozlabs.org/api/series/2526/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2526",
            "date": "2017-09-11T17:12:14",
            "name": "Guest exploitation of the XIVE interrupt controller (POWER9)",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/2526/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/812475/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812475/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xrZcf0rJFz9s83\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 03:27:30 +1000 (AEST)",
            "from localhost ([::1]:59347 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1drSUa-0004E4-6c\n\tfor incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 13:27:28 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:35823)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <clg@kaod.org>) id 1drSIb-00025d-0m\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:15:11 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <clg@kaod.org>) id 1drSIW-0004s9-3E\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:15:05 -0400",
            "from 3.mo2.mail-out.ovh.net ([46.105.58.226]:53420)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <clg@kaod.org>) id 1drSIV-0004rm-St\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:15:00 -0400",
            "from player770.ha.ovh.net (b6.ovh.net [213.186.33.56])\n\tby mo2.mail-out.ovh.net (Postfix) with ESMTP id 80B67AB2DB\n\tfor <qemu-devel@nongnu.org>; Mon, 11 Sep 2017 19:14:58 +0200 (CEST)",
            "from zorba.kaod.org.com (LFbn-1-2231-173.w90-76.abo.wanadoo.fr\n\t[90.76.52.173]) (Authenticated sender: clg@kaod.org)\n\tby player770.ha.ovh.net (Postfix) with ESMTPSA id 4B5A53C0072;\n\tMon, 11 Sep 2017 19:14:51 +0200 (CEST)"
        ],
        "From": "=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>",
        "To": "qemu-ppc@nongnu.org, qemu-devel@nongnu.org,\n\tDavid Gibson <david@gibson.dropbear.id.au>,\n\tBenjamin Herrenschmidt <benh@kernel.crashing.org>,\n\tAlexey Kardashevskiy <aik@ozlabs.ru>, Alexander Graf <agraf@suse.de>",
        "Date": "Mon, 11 Sep 2017 19:12:32 +0200",
        "Message-Id": "<20170911171235.29331-19-clg@kaod.org>",
        "X-Mailer": "git-send-email 2.13.5",
        "In-Reply-To": "<20170911171235.29331-1-clg@kaod.org>",
        "References": "<20170911171235.29331-1-clg@kaod.org>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "X-Ovh-Tracer-Id": "14164383780940712787",
        "X-VR-SPAMSTATE": "OK",
        "X-VR-SPAMSCORE": "-100",
        "X-VR-SPAMCAUSE": "gggruggvucftvghtrhhoucdtuddrfeelledrgedtgdduudehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm",
        "Content-Transfer-Encoding": "quoted-printable",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]",
        "X-Received-From": "46.105.58.226",
        "Subject": "[Qemu-devel] [RFC PATCH v2 18/21] ppc/xive: add device tree support",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Id": "<qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.nongnu.org/archive/html/qemu-devel/>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Cc": "=?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"
    },
    "content": "Like for XICS, the XIVE interface for the guest is described in the\ndevice tree under the \"interrupt-controller\" node. A couple of new\nproperties are specific to XIVE :\n\n - \"reg\"\n\n   contains the base address and size of the thread interrupt\n   managnement areas (TIMA), also called rings, for the User level and\n   for the Guest OS level. Only the Guest OS level is taken into\n   account today.\n\n - \"ibm,xive-eq-sizes\"\n\n   the size of the event queues. One cell per size supported, contains\n   log2 of size, in ascending order.\n\n - \"ibm,xive-lisn-ranges\"\n\n   the interrupt numbers ranges assigned to the guest. These are\n   allocated using a simple bitmap.\n\nand also under the root node :\n\n - \"ibm,plat-res-int-priorities\"\n\n   contains a list of priorities that the hypervisor has reserved for\n   its own use. Simulate ranges as defined by the PowerVM Hypervisor.\n\nSigned-off-by: Cédric Le Goater <clg@kaod.org>\n---\n hw/intc/spapr_xive_hcall.c  | 54 +++++++++++++++++++++++++++++++++++++++++++++\n include/hw/ppc/spapr_xive.h |  1 +\n 2 files changed, 55 insertions(+)",
    "diff": "diff --git a/hw/intc/spapr_xive_hcall.c b/hw/intc/spapr_xive_hcall.c\nindex 4c77b65683de..7b19ea6373dd 100644\n--- a/hw/intc/spapr_xive_hcall.c\n+++ b/hw/intc/spapr_xive_hcall.c\n@@ -874,3 +874,57 @@ void spapr_xive_hcall_init(sPAPRMachineState *spapr)\n     spapr_register_hypercall(H_INT_SYNC, h_int_sync);\n     spapr_register_hypercall(H_INT_RESET, h_int_reset);\n }\n+\n+void spapr_xive_populate(sPAPRXive *xive, void *fdt, uint32_t phandle)\n+{\n+    int node;\n+    uint64_t timas[2 * 2];\n+    uint32_t lisn_ranges[] = {\n+        cpu_to_be32(xive->nr_irqs - xive->nr_targets + xive->ics->offset),\n+        cpu_to_be32(xive->nr_targets),\n+    };\n+    uint32_t eq_sizes[] = {\n+        cpu_to_be32(12), /* 4K */\n+        cpu_to_be32(16), /* 64K */\n+        cpu_to_be32(21), /* 2M */\n+        cpu_to_be32(24), /* 16M */\n+    };\n+\n+    /* Use some ranges to exercise the Linux driver, which should\n+     * result in Linux choosing priority 6. This is not strictly\n+     * necessary\n+     */\n+    uint32_t reserved_priorities[] = {\n+        cpu_to_be32(1),  /* start */\n+        cpu_to_be32(2),  /* count */\n+        cpu_to_be32(7),  /* start */\n+        cpu_to_be32(0xf8),  /* count */\n+    };\n+    int i;\n+\n+    /* Thread Interrupt Management Areas : User and OS */\n+    for (i = 0; i < 2; i++) {\n+        timas[i * 2] = cpu_to_be64(xive->tm_base + i * (1 << xive->tm_shift));\n+        timas[i * 2 + 1] = cpu_to_be64(1 << xive->tm_shift);\n+    }\n+\n+    _FDT(node = fdt_add_subnode(fdt, 0, \"interrupt-controller\"));\n+\n+    _FDT(fdt_setprop_string(fdt, node, \"name\", \"interrupt-controller\"));\n+    _FDT(fdt_setprop_string(fdt, node, \"device_type\", \"power-ivpe\"));\n+    _FDT(fdt_setprop(fdt, node, \"reg\", timas, sizeof(timas)));\n+\n+    _FDT(fdt_setprop_string(fdt, node, \"compatible\", \"ibm,power-ivpe\"));\n+    _FDT(fdt_setprop(fdt, node, \"ibm,xive-eq-sizes\", eq_sizes,\n+                     sizeof(eq_sizes)));\n+    _FDT(fdt_setprop(fdt, node, \"ibm,xive-lisn-ranges\", lisn_ranges,\n+                     sizeof(lisn_ranges)));\n+\n+    /* For SLOF */\n+    _FDT(fdt_setprop_cell(fdt, node, \"linux,phandle\", phandle));\n+    _FDT(fdt_setprop_cell(fdt, node, \"phandle\", phandle));\n+\n+    /* top properties */\n+    _FDT(fdt_setprop(fdt, 0, \"ibm,plat-res-int-priorities\",\n+                     reserved_priorities, sizeof(reserved_priorities)));\n+}\ndiff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h\nindex ae5ff89533c0..0a156f2d8591 100644\n--- a/include/hw/ppc/spapr_xive.h\n+++ b/include/hw/ppc/spapr_xive.h\n@@ -69,5 +69,6 @@ struct sPAPRXive {\n typedef struct sPAPRMachineState sPAPRMachineState;\n \n void spapr_xive_hcall_init(sPAPRMachineState *spapr);\n+void spapr_xive_populate(sPAPRXive *xive, void *fdt, uint32_t phandle);\n \n #endif /* PPC_SPAPR_XIVE_H */\n",
    "prefixes": [
        "RFC",
        "v2",
        "18/21"
    ]
}