get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 808040,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/808040/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/747daf1a700a5340eeeedd9d98188bf89f75bb85.1504161284.git.sam.bobroff@au1.ibm.com/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/1.2/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": "<747daf1a700a5340eeeedd9d98188bf89f75bb85.1504161284.git.sam.bobroff@au1.ibm.com>",
    "list_archive_url": null,
    "date": "2017-08-31T06:38:46",
    "name": "[1/1] ppc: spapr: Move VCPU ID calculation into sPAPR",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "4777f6a47ec8920e7174275213c6564ff2da8a43",
    "submitter": {
        "id": 64137,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/64137/?format=api",
        "name": "Sam Bobroff",
        "email": "sam.bobroff@au1.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/747daf1a700a5340eeeedd9d98188bf89f75bb85.1504161284.git.sam.bobroff@au1.ibm.com/mbox/",
    "series": [
        {
            "id": 752,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/752/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=752",
            "date": "2017-08-31T06:38:46",
            "name": "[1/1] ppc: spapr: Move VCPU ID calculation into sPAPR",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/752/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/808040/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/808040/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 3xjXnd3qRsz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 16:40:53 +1000 (AEST)",
            "from localhost ([::1]:54148 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 1dnJ9n-0005UB-Mq\n\tfor incoming@patchwork.ozlabs.org; Thu, 31 Aug 2017 02:40:51 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:51132)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <sam.bobroff@au1.ibm.com>) id 1dnJ8z-00051d-6X\n\tfor qemu-devel@nongnu.org; Thu, 31 Aug 2017 02:40:07 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <sam.bobroff@au1.ibm.com>) id 1dnJ8s-0004UX-Rn\n\tfor qemu-devel@nongnu.org; Thu, 31 Aug 2017 02:40:01 -0400",
            "from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43749)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <sam.bobroff@au1.ibm.com>)\n\tid 1dnJ8s-0004Tw-IK\n\tfor qemu-devel@nongnu.org; Thu, 31 Aug 2017 02:39:54 -0400",
            "from pps.filterd (m0098396.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7V6doxD106582\n\tfor <qemu-devel@nongnu.org>; Thu, 31 Aug 2017 02:39:52 -0400",
            "from e23smtp06.au.ibm.com (e23smtp06.au.ibm.com [202.81.31.148])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cpc4g5bs3-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Thu, 31 Aug 2017 02:39:50 -0400",
            "from localhost\n\tby e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <sam.bobroff@au1.ibm.com>;\n\tThu, 31 Aug 2017 16:38:51 +1000",
            "from d23relay06.au.ibm.com (202.81.31.225)\n\tby e23smtp06.au.ibm.com (202.81.31.212) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 31 Aug 2017 16:38:49 +1000",
            "from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139])\n\tby d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tv7V6cmR839714950; Thu, 31 Aug 2017 16:38:48 +1000",
            "from d23av04.au.ibm.com (localhost [127.0.0.1])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tv7V6cnXZ025339; Thu, 31 Aug 2017 16:38:49 +1000",
            "from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tv7V6cnpu025336; Thu, 31 Aug 2017 16:38:49 +1000",
            "from tungsten.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114])\n\t(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.au.ibm.com (Postfix) with ESMTPSA id E1123A038E;\n\tThu, 31 Aug 2017 16:38:47 +1000 (AEST)"
        ],
        "Date": "Thu, 31 Aug 2017 16:38:46 +1000",
        "From": "Sam Bobroff <sam.bobroff@au1.ibm.com>",
        "To": "qemu-ppc@nongnu.org, qemu-devel@nongnu.org",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=us-ascii",
        "Content-Disposition": "inline",
        "User-Agent": "NeoMutt/20170113 (1.7.2)",
        "X-TM-AS-MML": "disable",
        "x-cbid": "17083106-0040-0000-0000-000003523511",
        "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused",
        "x-cbparentid": "17083106-0041-0000-0000-00000CD03845",
        "Message-Id": "<747daf1a700a5340eeeedd9d98188bf89f75bb85.1504161284.git.sam.bobroff@au1.ibm.com>",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-31_01:, , signatures=0",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1708310101",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]",
        "X-Received-From": "148.163.156.1",
        "Subject": "[Qemu-devel] [PATCH 1/1] ppc: spapr: Move VCPU ID calculation into\n\tsPAPR",
        "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": "david@gibson.dropbear.id.au",
        "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": "Move the calculation of a CPU's VCPU ID out of the generic PPC code\n(ppc_cpu_realizefn()) and into sPAPR specific code\n(spapr_cpu_core_realize()) where it belongs.\n\nUnfortunately, due to the way things are ordered, we still need to\ndefault the VCPU ID in ppc_cpu_realizfn() but at least doing that\ndoesn't require any interaction with sPAPR.\n\nSigned-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>\n---\nThis is follow up work arising from my work to clean up the way CPU VCPU IDs are\nhandled on PowerPC. It had looked like it would be difficult to move the actual\nVCPU ID calculation out of generic code but it turned out to be OK.\n\nIt's based on dgibson/ppc-for-2.11.\n\nCheers,\nSam.\n\n hw/ppc/spapr_cpu_core.c     | 11 +++++++++++\n target/ppc/translate_init.c | 18 +++---------------\n 2 files changed, 14 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c\nindex 5e319d9bbb..84dcc6e264 100644\n--- a/hw/ppc/spapr_cpu_core.c\n+++ b/hw/ppc/spapr_cpu_core.c\n@@ -211,6 +211,7 @@ error:\n \n static void spapr_cpu_core_realize(DeviceState *dev, Error **errp)\n {\n+    sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());\n     sPAPRCPUCore *sc = SPAPR_CPU_CORE(OBJECT(dev));\n     sPAPRCPUCoreClass *scc = SPAPR_CPU_CORE_GET_CLASS(OBJECT(dev));\n     CPUCore *cc = CPU_CORE(OBJECT(dev));\n@@ -237,6 +238,16 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp)\n         cs = CPU(obj);\n         cpu = POWERPC_CPU(cs);\n         cs->cpu_index = cc->core_id + i;\n+        cpu->vcpu_id = (cc->core_id * spapr->vsmt / smp_threads) + i;\n+        if (kvm_enabled() && !kvm_vcpu_id_is_valid(cpu->vcpu_id)) {\n+            error_setg(&local_err, \"Can't create CPU with id %d in KVM\",\n+                       cpu->vcpu_id);\n+            error_append_hint(&local_err, \"Adjust the number of cpus to %d \"\n+                              \"or try to raise the number of threads per core\\n\",\n+                              cpu->vcpu_id * smp_threads / spapr->vsmt);\n+            goto err;\n+        }\n+\n \n         /* Set NUMA node for the threads belonged to core  */\n         cpu->node_id = sc->node_id;\ndiff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c\nindex 7f6a349e43..1f7286c893 100644\n--- a/target/ppc/translate_init.c\n+++ b/target/ppc/translate_init.c\n@@ -9903,28 +9903,15 @@ static void ppc_cpu_realizefn(DeviceState *dev, Error **errp)\n     PowerPCCPU *cpu = POWERPC_CPU(dev);\n     PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);\n     Error *local_err = NULL;\n-#if !defined(CONFIG_USER_ONLY)\n-    int max_smt = kvmppc_smt_threads();\n-#endif\n \n     cpu_exec_realizefn(cs, &local_err);\n     if (local_err != NULL) {\n         error_propagate(errp, local_err);\n         return;\n     }\n-\n-#if !defined(CONFIG_USER_ONLY)\n-    cpu->vcpu_id = (cs->cpu_index / smp_threads) * max_smt\n-        + (cs->cpu_index % smp_threads);\n-\n-    if (kvm_enabled() && !kvm_vcpu_id_is_valid(cpu->vcpu_id)) {\n-        error_setg(errp, \"Can't create CPU with id %d in KVM\", cpu->vcpu_id);\n-        error_append_hint(errp, \"Adjust the number of cpus to %d \"\n-                          \"or try to raise the number of threads per core\\n\",\n-                          cpu->vcpu_id * smp_threads / max_smt);\n-        goto unrealize;\n+    if (cpu->vcpu_id == UNASSIGNED_CPU_INDEX) {\n+        cpu->vcpu_id = cs->cpu_index;\n     }\n-#endif\n \n     if (tcg_enabled()) {\n         if (ppc_fixup_cpu(cpu) != 0) {\n@@ -10625,6 +10612,7 @@ static void ppc_cpu_initfn(Object *obj)\n     CPUPPCState *env = &cpu->env;\n \n     cs->env_ptr = env;\n+    cpu->vcpu_id = UNASSIGNED_CPU_INDEX;\n \n     env->msr_mask = pcc->msr_mask;\n     env->mmu_model = pcc->mmu_model;\n",
    "prefixes": [
        "1/1"
    ]
}