get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2195851,
    "url": "http://patchwork.ozlabs.org/api/patches/2195851/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260212062522.99565-3-anisinha@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": "<20260212062522.99565-3-anisinha@redhat.com>",
    "list_archive_url": null,
    "date": "2026-02-12T06:24:46",
    "name": "[v4,02/31] accel/kvm: add confidential class member to indicate guest rebuild capability",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "6cc3c73b3383ec37e1462f0c879b086e2734dd43",
    "submitter": {
        "id": 86030,
        "url": "http://patchwork.ozlabs.org/api/people/86030/?format=api",
        "name": "Ani Sinha",
        "email": "anisinha@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260212062522.99565-3-anisinha@redhat.com/mbox/",
    "series": [
        {
            "id": 491935,
            "url": "http://patchwork.ozlabs.org/api/series/491935/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=491935",
            "date": "2026-02-12T06:24:45",
            "name": "Introduce support for confidential guest reset (x86)",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/491935/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2195851/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2195851/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=NVDNfbdG;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=nrGTHCl5;\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=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from lists.gnu.org (lists.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 4fBQPX2qVmz1xvb\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 17:29:20 +1100 (AEDT)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vqQ97-0007ZF-He; Thu, 12 Feb 2026 01:25:49 -0500",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <anisinha@redhat.com>)\n id 1vqQ96-0007Z7-9O\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 01:25:48 -0500",
            "from us-smtp-delivery-124.mimecast.com ([170.10.129.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <anisinha@redhat.com>)\n id 1vqQ94-0005C8-Mb\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 01:25:48 -0500",
            "from mail-pg1-f198.google.com (mail-pg1-f198.google.com\n [209.85.215.198]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-217-ckoYampSPv-OEOiFmxXdag-1; Thu, 12 Feb 2026 01:25:43 -0500",
            "by mail-pg1-f198.google.com with SMTP id\n 41be03b00d2f7-c6e1d32a128so896464a12.3\n for <qemu-devel@nongnu.org>; Wed, 11 Feb 2026 22:25:43 -0800 (PST)",
            "from rhel9-box.lan ([122.164.27.113])\n by smtp.googlemail.com with ESMTPSA id\n 98e67ed59e1d1-3567e7d95d8sm4894122a91.2.2026.02.11.22.25.38\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 11 Feb 2026 22:25:41 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1770877545;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=/1VlHtYGbkfW+qN/OA1sAKbbnZvFUDWI/CtmetDJXqY=;\n b=NVDNfbdGLv5n4A228J1bftSZ8vpsOE8Q9XxQ2FFHeJsRozMrNycA4M2SXD27l2RcP9E7EG\n P5XpINdOF6I2rumFLP4CPU3y8e1Z9FcSZQL7LMSSBUScP8c7UNnn7sylpeXBlVKcKKIcYs\n McULGWZ0BhfQCBSqwwZ3bjZUQQdp57o=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1770877542; x=1771482342; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=/1VlHtYGbkfW+qN/OA1sAKbbnZvFUDWI/CtmetDJXqY=;\n b=nrGTHCl5a5CY/EgpNNEVuiQGeFo9N3S34c4EoYIbC/B1oYac2fIrxS8uEd3ZjP590s\n ZTMbh8eCU3zoYBy5jrGv+/QmwdC5fd/LGjZc6ufaFXpiG1lGkYJfmLysyE9zruMh39sX\n rXY+ofsofnuMfAGsp4rkS9YGx4c3CKUcxEQKcKaAs5yq2RdEOjkLo/vxTELEi3Eq56Y0\n IALGsxhlqN+lMraucQVrKXC1OHaVzZ8MpbC9tWvBAioM100Kxxy2+NyBf3/eDuZijduP\n HrlTYcbk30SRSC2CTGhmvYtZdmJCeIkgsshLyBegYzyV1g770eRb9e+0oaEizEarcvwC\n l85Q=="
        ],
        "X-MC-Unique": "ckoYampSPv-OEOiFmxXdag-1",
        "X-Mimecast-MFC-AGG-ID": "ckoYampSPv-OEOiFmxXdag_1770877542",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770877542; x=1771482342;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=/1VlHtYGbkfW+qN/OA1sAKbbnZvFUDWI/CtmetDJXqY=;\n b=uUgmvHv06sFqugdLaQDw+cQky7DjaUc2JfMfQUVGMGpp83+Ect5dF3flGl09b0lL0x\n KeotMlaUfgpnUlutX/5sI40WTgnFLXnUM2hhU3gI9MlJyIMp6MfwRl4Rhf0308Zzcscm\n 1Ce2or9HM7BZujah4GsWVYR4r/wqieXm0v3kOj4xquuaAv7cxYqJxFj2R1dkMmNnGVDl\n cjSr1UF4kJql2TiesQrqUNrg7pLoq++PqqvktcDEWSElynu0I8lz3ERp6jSRXyTMDR1d\n Mla6lGB44BpijLmuJoAS+47WutKbbJgnVdjneK+n4Ov+KWOo9ZOTG0H+VwbXguqIJnui\n oD9A==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCV/73iEZMkqNGKIs2D1T1geBMwrim9gAnkMhf47U2W9nz+CyPiT5IkGBGiDI8Sst3WOEuFFrjoWzgoJ@nongnu.org",
        "X-Gm-Message-State": "AOJu0Ywxqc5x6cz7YYEH3XOVLBkgaG6JjCp24w4Mei94lHA/4EOuYsnc\n mcQvSEHZr8iabi9CMgM5UF/Vfg6gY8NTLtzwNY3AJ27mFF2enoXGtEvKe84oIXxoVS0ovPkB/qb\n AlzXUGv0MAWXxh4U6n/Qo55vfYrdvNhIyH5PffnmVVee+M0J9Zk7mjhio",
        "X-Gm-Gg": "AZuq6aItHlybRipDK69x5saI3OlyS5y3X1PhmmbqmQtl0nMs94fS25OGPhxRJzxlbhY\n dXbceXIY/9hsw4kTgKtboe8IcjrFpl1cX0QBzJw5MY9F1AzXGWyU6ubQF3zDYqKuHb1+X2JUV8t\n A7pg76ZYbXnPUVKyxSQGeW/Tyj/5hK8STg+lW6PKRiDJSLHl1Z9ApgFIHXlDlXRcdKY5CtFygp9\n LY8np5EQG8EnVEzz0bouf1gQxHXGWqVgW4/xAWbuCeLEfhdORatytWFQaeECRmYZtNzxKyQHZJg\n op3WbzP7MpoJK6YPV6+SiJjz9IPeGSsrwjBig9XSFlTpQA2DK7ETHgMEWgXSeMdSCGI8ZUaebmY\n aUBjRmaTtp6Npio8X/LR7BdFZCyj+PuDVT4Vm9pcA59H7vaUVmR8DUfA=",
        "X-Received": [
            "by 2002:a05:6a21:3b49:b0:35e:e604:f78b with SMTP id\n adf61e73a8af0-3944845c420mr1507972637.3.1770877542143;\n Wed, 11 Feb 2026 22:25:42 -0800 (PST)",
            "by 2002:a05:6a21:3b49:b0:35e:e604:f78b with SMTP id\n adf61e73a8af0-3944845c420mr1507949637.3.1770877541761;\n Wed, 11 Feb 2026 22:25:41 -0800 (PST)"
        ],
        "From": "Ani Sinha <anisinha@redhat.com>",
        "To": "Paolo Bonzini <pbonzini@redhat.com>,\n Marcelo Tosatti <mtosatti@redhat.com>,\n Zhao Liu <zhao1.liu@intel.com>",
        "Cc": "kraxel@redhat.com, Ani Sinha <anisinha@redhat.com>, qemu-devel@nongnu.org,\n kvm@vger.kernel.org",
        "Subject": "[PATCH v4 02/31] accel/kvm: add confidential class member to indicate\n guest rebuild capability",
        "Date": "Thu, 12 Feb 2026 11:54:46 +0530",
        "Message-ID": "<20260212062522.99565-3-anisinha@redhat.com>",
        "X-Mailer": "git-send-email 2.42.0",
        "In-Reply-To": "<20260212062522.99565-1-anisinha@redhat.com>",
        "References": "<20260212062522.99565-1-anisinha@redhat.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=170.10.129.124;\n envelope-from=anisinha@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 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=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": "As a part of the confidential guest reset process, the existing encrypted guest\nstate must be made mutable since it would be discarded after reset. A new\nencrypted and locked guest state must be established after the reset. To this\nend, a new boolean member per confidential guest support class\n(eg, tdx or sev-snp) is added that will indicate whether its possible to\nrebuild guest state:\n\nbool can_rebuild_guest_state;\n\nThis is true if rebuilding guest state is possible, false otherwise.\nA KVM based confidential guest reset is only possible when\nthe existing state is locked but its possible to rebuild guest state.\nOtherwise, the guest is not resettable.\n\nSigned-off-by: Ani Sinha <anisinha@redhat.com>\n---\n include/system/confidential-guest-support.h | 20 ++++++++++++++++++++\n system/runstate.c                           |  6 +++---\n target/i386/kvm/tdx.c                       |  1 +\n target/i386/sev.c                           |  1 +\n 4 files changed, 25 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/include/system/confidential-guest-support.h b/include/system/confidential-guest-support.h\nindex 0cc8b26e64..5dca717308 100644\n--- a/include/system/confidential-guest-support.h\n+++ b/include/system/confidential-guest-support.h\n@@ -152,6 +152,11 @@ typedef struct ConfidentialGuestSupportClass {\n      */\n     int (*get_mem_map_entry)(int index, ConfidentialGuestMemoryMapEntry *entry,\n                              Error **errp);\n+\n+    /*\n+     * is it possible to rebuild the guest state?\n+     */\n+    bool can_rebuild_guest_state;\n } ConfidentialGuestSupportClass;\n \n static inline int confidential_guest_kvm_init(ConfidentialGuestSupport *cgs,\n@@ -167,6 +172,21 @@ static inline int confidential_guest_kvm_init(ConfidentialGuestSupport *cgs,\n     return 0;\n }\n \n+static inline bool\n+confidential_guest_can_rebuild_state(ConfidentialGuestSupport *cgs)\n+{\n+    ConfidentialGuestSupportClass *klass;\n+\n+    if (!cgs) {\n+        /* non-confidential guests */\n+        return true;\n+    }\n+\n+    klass = CONFIDENTIAL_GUEST_SUPPORT_GET_CLASS(cgs);\n+    return klass->can_rebuild_guest_state;\n+\n+}\n+\n static inline int confidential_guest_kvm_reset(ConfidentialGuestSupport *cgs,\n                                                Error **errp)\n {\ndiff --git a/system/runstate.c b/system/runstate.c\nindex ed2db56480..5d58260ed5 100644\n--- a/system/runstate.c\n+++ b/system/runstate.c\n@@ -57,6 +57,7 @@\n #include \"system/reset.h\"\n #include \"system/runstate.h\"\n #include \"system/runstate-action.h\"\n+#include \"system/confidential-guest-support.h\"\n #include \"system/system.h\"\n #include \"system/tpm.h\"\n #include \"trace.h\"\n@@ -543,8 +544,6 @@ void qemu_system_reset(ShutdownCause reason)\n      */\n     if (cpus_are_resettable()) {\n         cpu_synchronize_all_post_reset();\n-    } else {\n-        assert(runstate_check(RUN_STATE_PRELAUNCH));\n     }\n \n     vm_set_suspended(false);\n@@ -693,7 +692,8 @@ void qemu_system_reset_request(ShutdownCause reason)\n     if (reboot_action == REBOOT_ACTION_SHUTDOWN &&\n         reason != SHUTDOWN_CAUSE_SUBSYSTEM_RESET) {\n         shutdown_requested = reason;\n-    } else if (!cpus_are_resettable()) {\n+    } else if (!cpus_are_resettable() &&\n+               !confidential_guest_can_rebuild_state(current_machine->cgs)) {\n         error_report(\"cpus are not resettable, terminating\");\n         shutdown_requested = reason;\n     } else {\ndiff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c\nindex 0161985768..a3e81e1c0c 100644\n--- a/target/i386/kvm/tdx.c\n+++ b/target/i386/kvm/tdx.c\n@@ -1543,6 +1543,7 @@ static void tdx_guest_class_init(ObjectClass *oc, const void *data)\n     X86ConfidentialGuestClass *x86_klass = X86_CONFIDENTIAL_GUEST_CLASS(oc);\n \n     klass->kvm_init = tdx_kvm_init;\n+    klass->can_rebuild_guest_state = true;\n     x86_klass->kvm_type = tdx_kvm_type;\n     x86_klass->cpu_instance_init = tdx_cpu_instance_init;\n     x86_klass->adjust_cpuid_features = tdx_adjust_cpuid_features;\ndiff --git a/target/i386/sev.c b/target/i386/sev.c\nindex acdcb9c4e6..66e38ca32e 100644\n--- a/target/i386/sev.c\n+++ b/target/i386/sev.c\n@@ -2760,6 +2760,7 @@ sev_common_instance_init(Object *obj)\n     cgs->set_guest_state = cgs_set_guest_state;\n     cgs->get_mem_map_entry = cgs_get_mem_map_entry;\n     cgs->set_guest_policy = cgs_set_guest_policy;\n+    cgs->can_rebuild_guest_state = true;\n \n     QTAILQ_INIT(&sev_common->launch_vmsa);\n }\n",
    "prefixes": [
        "v4",
        "02/31"
    ]
}