get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 806336,
    "url": "http://patchwork.ozlabs.org/api/patches/806336/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170828015654.2530-6-Sergio.G.DelReal@gmail.com/",
    "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": "<20170828015654.2530-6-Sergio.G.DelReal@gmail.com>",
    "list_archive_url": null,
    "date": "2017-08-28T01:56:45",
    "name": "[05/14] hvf: use new helper functions for put/get xsave",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "4b732c8a18a82e82efb77ad56ff3326fb693b1b6",
    "submitter": {
        "id": 70675,
        "url": "http://patchwork.ozlabs.org/api/people/70675/?format=api",
        "name": "Sergio Andres Gomez Del Real",
        "email": "sergio.g.delreal@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170828015654.2530-6-Sergio.G.DelReal@gmail.com/mbox/",
    "series": [
        {
            "id": 56,
            "url": "http://patchwork.ozlabs.org/api/series/56/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=56",
            "date": "2017-08-28T01:56:40",
            "name": "add support for Hypervisor.framework in QEMU",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/56/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/806336/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/806336/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>)",
            "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=\"qyNRi8AG\"; dkim-atps=neutral"
        ],
        "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 3xgZg72wBnz9sNw\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon, 28 Aug 2017 11:58:27 +1000 (AEST)",
            "from localhost ([::1]:36498 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 1dm9Jp-0004wt-6x\n\tfor incoming@patchwork.ozlabs.org; Sun, 27 Aug 2017 21:58:25 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:42011)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <sergio.g.delreal@gmail.com>) id 1dm9Iz-0004st-7V\n\tfor qemu-devel@nongnu.org; Sun, 27 Aug 2017 21:57:34 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <sergio.g.delreal@gmail.com>) id 1dm9Iy-000127-1J\n\tfor qemu-devel@nongnu.org; Sun, 27 Aug 2017 21:57:33 -0400",
            "from mail-vk0-x244.google.com ([2607:f8b0:400c:c05::244]:38039)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <sergio.g.delreal@gmail.com>)\n\tid 1dm9Ix-00011j-SZ\n\tfor qemu-devel@nongnu.org; Sun, 27 Aug 2017 21:57:31 -0400",
            "by mail-vk0-x244.google.com with SMTP id w84so1879899vkd.5\n\tfor <qemu-devel@nongnu.org>; Sun, 27 Aug 2017 18:57:31 -0700 (PDT)",
            "from localhost.localdomain ([191.109.6.191])\n\tby smtp.gmail.com with ESMTPSA id\n\ty12sm2696824uad.22.2017.08.27.18.57.30\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSun, 27 Aug 2017 18:57:30 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=r5Pl/nqVC271HQv9X4REmrU0HXcLthFF30DzdcPDwyg=;\n\tb=qyNRi8AGVTw4KyMYr3z73gZ/98bvRf2d43zHbXtBfIuTouS17BmIO33IzT8F7jLLNP\n\t6od/TcTdJyPi7BN6S1nwroE61aMZ4D5/XxeW+t2aFN0XDxhWCultUSlFg/KHPdeP5x3Y\n\tP8QJhaKxIZn/5+fML+0DDQzI6lEiAnzekiJ5HBFZlvwK9B5Kxm0FOFn3Qt0Yes/tLDcm\n\tyl8X2XRDbui6SP+k/wViiALuknu2x2yMOOehDgelxVlw5quKHCd31jl2TxI4oW8RVMX1\n\tBf//ugq1rOuRaCbTyCESgy06qwc6wi0uX60nS/sXjNjz+t5fYr9BH85O8OXO+fzDqw8q\n\ti3Ow==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=r5Pl/nqVC271HQv9X4REmrU0HXcLthFF30DzdcPDwyg=;\n\tb=PorD1wfLZN7x/B23OhdLkZKwW3B0J+xFaJKxodG/c2o0RenlrpHRX0WS7mptgxXMFR\n\twP38g1GiZeCnbf9f3q7KmFdWPty5URN/ZNRC4GCs2Yjdf8e+mcs0vZFgawb83/yBxxtO\n\ttHKZVlwqPTrqM7zDhueb5Tiec6HK0UX+s8H+e/U2bCOI7F+8mpEERKpoIRGLGVHt1hQS\n\tqZLtXRCKHun0ipdt9LCY279SGDNRzov8Hci/OxsccJXNHYl7zeRaR00Fl78fRi4Mho5B\n\tgRSzTSg+V/GbjPu/M65kUG6dg3oVQ9gFEtbEsaQJVkFuHJRsdrOP2Uru94UJRwwQjClE\n\trHPA==",
        "X-Gm-Message-State": "AHYfb5jbFjpvs33cm3cPIUDOHXt5YX0s2o2mapFcZNOPZCsbHKtq5oFr\n\tqUPGJnSz7dyMpHrG",
        "X-Received": "by 10.31.54.215 with SMTP id d206mr3628155vka.24.1503885451090; \n\tSun, 27 Aug 2017 18:57:31 -0700 (PDT)",
        "From": "Sergio Andres Gomez Del Real <sergio.g.delreal@gmail.com>",
        "X-Google-Original-From": "Sergio Andres Gomez Del Real\n\t<Sergio.G.DelReal@gmail.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Sun, 27 Aug 2017 20:56:45 -0500",
        "Message-Id": "<20170828015654.2530-6-Sergio.G.DelReal@gmail.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170828015654.2530-1-Sergio.G.DelReal@gmail.com>",
        "References": "<20170828015654.2530-1-Sergio.G.DelReal@gmail.com>",
        "X-detected-operating-system": "by eggs.gnu.org: Genre and OS details not\n\trecognized.",
        "X-Received-From": "2607:f8b0:400c:c05::244",
        "Subject": "[Qemu-devel] [PATCH 05/14] hvf: use new helper functions for\n\tput/get xsave",
        "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": "Sergio Andres Gomez Del Real <Sergio.G.DelReal@gmail.com>",
        "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": "This commit makes use of the helper functions for handling xsave in\nxsave_helper.c, which are shared with kvm.\n\nSigned-off-by: Sergio Andres Gomez Del Real <Sergio.G.DelReal@gmail.com>\n---\n target/i386/hvf-utils/x86hvf.c | 63 ++++++------------------------------------\n 1 file changed, 8 insertions(+), 55 deletions(-)",
    "diff": "diff --git a/target/i386/hvf-utils/x86hvf.c b/target/i386/hvf-utils/x86hvf.c\nindex d5668df37f..5c1d5ece36 100644\n--- a/target/i386/hvf-utils/x86hvf.c\n+++ b/target/i386/hvf-utils/x86hvf.c\n@@ -76,36 +76,13 @@ void hvf_get_segment(SegmentCache *qseg, struct vmx_segment *vmx_seg)\n void hvf_put_xsave(CPUState *cpu_state)\n {\n \n-    int x;\n     struct hvf_xsave_buf *xsave;\n-    \n+\n     xsave = X86_CPU(cpu_state)->env.kvm_xsave_buf;\n-    memset(xsave, 0, sizeof(*xsave)); \n-    \n-    memcpy(&xsave->data[4], &X86_CPU(cpu_state)->env.fpdp, sizeof(X86_CPU(cpu_state)->env.fpdp));\n-    memcpy(&xsave->data[2], &X86_CPU(cpu_state)->env.fpip, sizeof(X86_CPU(cpu_state)->env.fpip));\n-    memcpy(&xsave->data[8], &X86_CPU(cpu_state)->env.fpregs, sizeof(X86_CPU(cpu_state)->env.fpregs));\n-    memcpy(&xsave->data[144], &X86_CPU(cpu_state)->env.ymmh_regs, sizeof(X86_CPU(cpu_state)->env.ymmh_regs));\n-    memcpy(&xsave->data[288], &X86_CPU(cpu_state)->env.zmmh_regs, sizeof(X86_CPU(cpu_state)->env.zmmh_regs));\n-    memcpy(&xsave->data[272], &X86_CPU(cpu_state)->env.opmask_regs, sizeof(X86_CPU(cpu_state)->env.opmask_regs));\n-    memcpy(&xsave->data[240], &X86_CPU(cpu_state)->env.bnd_regs, sizeof(X86_CPU(cpu_state)->env.bnd_regs));\n-    memcpy(&xsave->data[256], &X86_CPU(cpu_state)->env.bndcs_regs, sizeof(X86_CPU(cpu_state)->env.bndcs_regs));\n-    memcpy(&xsave->data[416], &X86_CPU(cpu_state)->env.hi16_zmm_regs, sizeof(X86_CPU(cpu_state)->env.hi16_zmm_regs));\n-    \n-    xsave->data[0] = (uint16_t)X86_CPU(cpu_state)->env.fpuc;\n-    xsave->data[0] |= (X86_CPU(cpu_state)->env.fpus << 16);\n-    xsave->data[0] |= (X86_CPU(cpu_state)->env.fpstt & 7) << 11;\n-    \n-    for (x = 0; x < 8; ++x)\n-        xsave->data[1] |= ((!X86_CPU(cpu_state)->env.fptags[x]) << x);\n-    xsave->data[1] |= (uint32_t)(X86_CPU(cpu_state)->env.fpop << 16);\n-    \n-    memcpy(&xsave->data[40], &X86_CPU(cpu_state)->env.xmm_regs, sizeof(X86_CPU(cpu_state)->env.xmm_regs));\n-    \n-    xsave->data[6] = X86_CPU(cpu_state)->env.mxcsr;\n-    *(uint64_t *)&xsave->data[128] = X86_CPU(cpu_state)->env.xstate_bv;\n-    \n-    if (hv_vcpu_write_fpstate(cpu_state->hvf_fd, xsave->data, 4096)){\n+\n+    x86_cpu_xsave_all_areas(X86_CPU(cpu_state), xsave);\n+\n+    if (hv_vcpu_write_fpstate(cpu_state->hvf_fd, xsave->data, 4096)) {\n         abort();\n     }\n }\n@@ -185,39 +162,15 @@ void hvf_put_msrs(CPUState *cpu_state)\n \n void hvf_get_xsave(CPUState *cpu_state)\n {\n-    int x;\n     struct hvf_xsave_buf *xsave;\n-    \n+\n     xsave = X86_CPU(cpu_state)->env.kvm_xsave_buf;\n-    \n+\n     if (hv_vcpu_read_fpstate(cpu_state->hvf_fd, xsave->data, 4096)) {\n         abort();\n     }\n \n-    memcpy(&X86_CPU(cpu_state)->env.fpdp, &xsave->data[4], sizeof(X86_CPU(cpu_state)->env.fpdp));\n-    memcpy(&X86_CPU(cpu_state)->env.fpip, &xsave->data[2], sizeof(X86_CPU(cpu_state)->env.fpip));\n-    memcpy(&X86_CPU(cpu_state)->env.fpregs, &xsave->data[8], sizeof(X86_CPU(cpu_state)->env.fpregs));\n-    memcpy(&X86_CPU(cpu_state)->env.ymmh_regs, &xsave->data[144], sizeof(X86_CPU(cpu_state)->env.ymmh_regs));\n-    memcpy(&X86_CPU(cpu_state)->env.zmmh_regs, &xsave->data[288], sizeof(X86_CPU(cpu_state)->env.zmmh_regs));\n-    memcpy(&X86_CPU(cpu_state)->env.opmask_regs, &xsave->data[272], sizeof(X86_CPU(cpu_state)->env.opmask_regs));\n-    memcpy(&X86_CPU(cpu_state)->env.bnd_regs, &xsave->data[240], sizeof(X86_CPU(cpu_state)->env.bnd_regs));\n-    memcpy(&X86_CPU(cpu_state)->env.bndcs_regs, &xsave->data[256], sizeof(X86_CPU(cpu_state)->env.bndcs_regs));\n-    memcpy(&X86_CPU(cpu_state)->env.hi16_zmm_regs, &xsave->data[416], sizeof(X86_CPU(cpu_state)->env.hi16_zmm_regs));\n-    \n-    \n-    X86_CPU(cpu_state)->env.fpuc = (uint16_t)xsave->data[0];\n-    X86_CPU(cpu_state)->env.fpus = (uint16_t)(xsave->data[0] >> 16);\n-    X86_CPU(cpu_state)->env.fpstt = (X86_CPU(cpu_state)->env.fpus >> 11) & 7;\n-    X86_CPU(cpu_state)->env.fpop = (uint16_t)(xsave->data[1] >> 16);\n-    \n-    for (x = 0; x < 8; ++x)\n-       X86_CPU(cpu_state)->env.fptags[x] =\n-        ((((uint16_t)xsave->data[1] >> x) & 1) == 0);\n-    \n-    memcpy(&X86_CPU(cpu_state)->env.xmm_regs, &xsave->data[40], sizeof(X86_CPU(cpu_state)->env.xmm_regs));\n-\n-    X86_CPU(cpu_state)->env.mxcsr = xsave->data[6];\n-    X86_CPU(cpu_state)->env.xstate_bv = *(uint64_t *)&xsave->data[128];\n+    x86_cpu_xrstor_all_areas(X86_CPU(cpu_state), xsave);\n }\n \n void hvf_get_segments(CPUState *cpu_state)\n",
    "prefixes": [
        "05/14"
    ]
}