get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2231348,
    "url": "http://patchwork.ozlabs.org/api/patches/2231348/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430160307.634093-2-cohuck@redhat.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": "<20260430160307.634093-2-cohuck@redhat.com>",
    "list_archive_url": null,
    "date": "2026-04-30T16:02:57",
    "name": "[PULL,v2,01/11] target/s390x/kvm: Simplify the async pfault handling code",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "631e1d4cf187ebeb0aabe110257776ddcb44a996",
    "submitter": {
        "id": 71914,
        "url": "http://patchwork.ozlabs.org/api/people/71914/?format=api",
        "name": "Cornelia Huck",
        "email": "cohuck@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260430160307.634093-2-cohuck@redhat.com/mbox/",
    "series": [
        {
            "id": 502335,
            "url": "http://patchwork.ozlabs.org/api/series/502335/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=502335",
            "date": "2026-04-30T16:02:58",
            "name": "[PULL,v2,01/11] target/s390x/kvm: Simplify the async pfault handling code",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/502335/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2231348/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2231348/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@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=At23GtMH;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g5zZK4xG0z1xqf\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 02:06:49 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wITs0-0000xE-AZ; Thu, 30 Apr 2026 12:04:08 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <cohuck@redhat.com>) id 1wITrN-0007d1-Np\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 12:03:30 -0400",
            "from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <cohuck@redhat.com>) id 1wITrH-00079p-QA\n for qemu-devel@nongnu.org; Thu, 30 Apr 2026 12:03:28 -0400",
            "from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-364-ysVl5qMaMWKfXlaZvHY3Jg-1; Thu,\n 30 Apr 2026 12:03:16 -0400",
            "from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 312E519560B4; Thu, 30 Apr 2026 16:03:15 +0000 (UTC)",
            "from gondolin.redhat.com (unknown [10.44.50.47])\n by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 1C31D18001ED; Thu, 30 Apr 2026 16:03:12 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777565001;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=xRYLKOrmE7/oEuDtADR2OmYYnbN1a9jH/1mSe5dCafw=;\n b=At23GtMHrDQZeVwzahr8GA9GCqJQUEhEiuUI82v3kBMfnD1owbMWJHrqONK5A9u/m5TRQw\n 6qyocV+YnXryaciYQrDDbImM5EfTaoWQH6BOG6b9DtacGN1KNhze1JghRMcriYL8ofOSYA\n s0Iyzu1OJSEV5h8CM31k5x0AYIqPPM4=",
        "X-MC-Unique": "ysVl5qMaMWKfXlaZvHY3Jg-1",
        "X-Mimecast-MFC-AGG-ID": "ysVl5qMaMWKfXlaZvHY3Jg_1777564995",
        "From": "Cornelia Huck <cohuck@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "qemu-s390x@nongnu.org, Thomas Huth <thuth@redhat.com>,\n Eric Farman <farman@linux.ibm.com>,\n Matthew Rosato <mjrosato@linux.ibm.com>,\n Christian Borntraeger <borntraeger@linux.ibm.com>,\n Cornelia Huck <cohuck@redhat.com>",
        "Subject": "[PULL v2 01/11] target/s390x/kvm: Simplify the async pfault handling\n code",
        "Date": "Thu, 30 Apr 2026 18:02:57 +0200",
        "Message-ID": "<20260430160307.634093-2-cohuck@redhat.com>",
        "In-Reply-To": "<20260430160307.634093-1-cohuck@redhat.com>",
        "References": "<20260430160307.634093-1-cohuck@redhat.com>",
        "MIME-Version": "1.0",
        "Content-type": "text/plain",
        "Content-Transfer-Encoding": "8bit",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.111",
        "Received-SPF": "pass client-ip=170.10.133.124; envelope-from=cohuck@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com",
        "X-Spam_score_int": "-20",
        "X-Spam_score": "-2.1",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no",
        "X-Spam_action": "no action",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "qemu development <qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://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 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "From: Thomas Huth <thuth@redhat.com>\n\nSince commit 126e7f78036 (\"kvm: require KVM_CAP_IOEVENTFD and\nKVM_CAP_IOEVENTFD_ANY_LENGTH\") we require at least kernel v4.4 to\nbe able to use KVM. KVM_CAP_ASYNC_PF is available in the kernel\nsince v3.15 and KVM_SYNC_PFAULT is available since kernel v3.18,\nso we can assume now that they are available in all supported\nkernels. Thus simplify the code a little bit by removing the\nchecks for these features.\n\nSigned-off-by: Thomas Huth <thuth@redhat.com>\nReviewed-by: Eric Farman <farman@linux.ibm.com>\nReviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>\nAcked-by: Christian Borntraeger <borntraeger@linux.ibm.com>\nMessage-ID: <20260317134531.460141-1-thuth@redhat.com>\nSigned-off-by: Cornelia Huck <cohuck@redhat.com>\n---\n target/s390x/kvm/kvm.c | 52 +++++++++---------------------------------\n 1 file changed, 11 insertions(+), 41 deletions(-)",
    "diff": "diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c\nindex 54d28e37d4dd..133e8c12fd4d 100644\n--- a/target/s390x/kvm/kvm.c\n+++ b/target/s390x/kvm/kvm.c\n@@ -140,7 +140,6 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = {\n     KVM_CAP_LAST_INFO\n };\n \n-static int cap_async_pf;\n static int cap_mem_op;\n static int cap_mem_op_extension;\n static int cap_s390_irq;\n@@ -333,6 +332,7 @@ int kvm_arch_get_default_type(MachineState *ms)\n int kvm_arch_init(MachineState *ms, KVMState *s)\n {\n     int required_caps[] = {\n+        KVM_CAP_ASYNC_PF,\n         KVM_CAP_DEVICE_CTRL,\n         KVM_CAP_SYNC_REGS,\n     };\n@@ -340,7 +340,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n     for (int i = 0; i < ARRAY_SIZE(required_caps); i++) {\n         if (!kvm_check_extension(s, required_caps[i])) {\n             error_report(\"KVM is missing capability #%d - \"\n-                         \"please use kernel 3.15 or newer\", required_caps[i]);\n+                         \"please use kernel 4.4 or newer\", required_caps[i]);\n             return -1;\n         }\n     }\n@@ -354,7 +354,6 @@ int kvm_arch_init(MachineState *ms, KVMState *s)\n         return -1;\n     }\n \n-    cap_async_pf = kvm_check_extension(s, KVM_CAP_ASYNC_PF);\n     cap_mem_op = kvm_check_extension(s, KVM_CAP_S390_MEM_OP);\n     cap_mem_op_extension = kvm_check_extension(s, KVM_CAP_S390_MEM_OP_EXTENSION);\n     mem_op_storage_key_support = cap_mem_op_extension > 0;\n@@ -466,7 +465,8 @@ static int can_sync_regs(CPUState *cs, int regs)\n }\n \n #define KVM_SYNC_REQUIRED_REGS (KVM_SYNC_GPRS | KVM_SYNC_ACRS | \\\n-                                KVM_SYNC_CRS | KVM_SYNC_PREFIX)\n+                                KVM_SYNC_CRS | KVM_SYNC_PREFIX | \\\n+                                KVM_SYNC_PFAULT)\n \n int kvm_arch_put_registers(CPUState *cs, KvmPutState level, Error **errp)\n {\n@@ -550,25 +550,10 @@ int kvm_arch_put_registers(CPUState *cs, KvmPutState level, Error **errp)\n     }\n \n     /* pfault parameters */\n-    if (can_sync_regs(cs, KVM_SYNC_PFAULT)) {\n-        cs->kvm_run->s.regs.pft = env->pfault_token;\n-        cs->kvm_run->s.regs.pfs = env->pfault_select;\n-        cs->kvm_run->s.regs.pfc = env->pfault_compare;\n-        cs->kvm_run->kvm_dirty_regs |= KVM_SYNC_PFAULT;\n-    } else if (cap_async_pf) {\n-        r = kvm_set_one_reg(cs, KVM_REG_S390_PFTOKEN, &env->pfault_token);\n-        if (r < 0) {\n-            return r;\n-        }\n-        r = kvm_set_one_reg(cs, KVM_REG_S390_PFCOMPARE, &env->pfault_compare);\n-        if (r < 0) {\n-            return r;\n-        }\n-        r = kvm_set_one_reg(cs, KVM_REG_S390_PFSELECT, &env->pfault_select);\n-        if (r < 0) {\n-            return r;\n-        }\n-    }\n+    cs->kvm_run->s.regs.pft = env->pfault_token;\n+    cs->kvm_run->s.regs.pfs = env->pfault_select;\n+    cs->kvm_run->s.regs.pfc = env->pfault_compare;\n+    cs->kvm_run->kvm_dirty_regs |= KVM_SYNC_PFAULT;\n \n     if (can_sync_regs(cs, KVM_SYNC_GSCB)) {\n         memcpy(cs->kvm_run->s.regs.gscb, env->gscb, 32);\n@@ -673,24 +658,9 @@ int kvm_arch_get_registers(CPUState *cs, Error **errp)\n     }\n \n     /* pfault parameters */\n-    if (can_sync_regs(cs, KVM_SYNC_PFAULT)) {\n-        env->pfault_token = cs->kvm_run->s.regs.pft;\n-        env->pfault_select = cs->kvm_run->s.regs.pfs;\n-        env->pfault_compare = cs->kvm_run->s.regs.pfc;\n-    } else if (cap_async_pf) {\n-        r = kvm_get_one_reg(cs, KVM_REG_S390_PFTOKEN, &env->pfault_token);\n-        if (r < 0) {\n-            return r;\n-        }\n-        r = kvm_get_one_reg(cs, KVM_REG_S390_PFCOMPARE, &env->pfault_compare);\n-        if (r < 0) {\n-            return r;\n-        }\n-        r = kvm_get_one_reg(cs, KVM_REG_S390_PFSELECT, &env->pfault_select);\n-        if (r < 0) {\n-            return r;\n-        }\n-    }\n+    env->pfault_token = cs->kvm_run->s.regs.pft;\n+    env->pfault_select = cs->kvm_run->s.regs.pfs;\n+    env->pfault_compare = cs->kvm_run->s.regs.pfc;\n \n     if (can_sync_regs(cs, KVM_SYNC_DIAG318)) {\n         env->diag318_info = cs->kvm_run->s.regs.diag318;\n",
    "prefixes": [
        "PULL",
        "v2",
        "01/11"
    ]
}