Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2197701/?format=api
{ "id": 2197701, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2197701/?format=api", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.0/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": "" }, "msgid": "<20260218114233.266178-4-anisinha@redhat.com>", "date": "2026-02-18T11:41:56", "name": "[v5,03/34] hw/accel: add a per-accelerator callback to change VM accelerator handle", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "280df5547dec273a95f17e2731be9388d3c951d1", "submitter": { "id": 86030, "url": "http://patchwork.ozlabs.org/api/1.0/people/86030/?format=api", "name": "Ani Sinha", "email": "anisinha@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260218114233.266178-4-anisinha@redhat.com/mbox/", "series": [ { "id": 492541, "url": "http://patchwork.ozlabs.org/api/1.0/series/492541/?format=api", "date": "2026-02-18T11:41:56", "name": "Introduce support for confidential guest reset (x86)", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/492541/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2197701/checks/", "tags": {}, "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=ctz+YeRq;\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=olME3GTA;\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 4fGF5Y0N6Qz1xwr\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 18 Feb 2026 22:43:43 +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 1vsfxf-0003D9-Bu; Wed, 18 Feb 2026 06:43:19 -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 1vsfxU-00037M-U7\n for qemu-devel@nongnu.org; Wed, 18 Feb 2026 06:43:10 -0500", "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 <anisinha@redhat.com>)\n id 1vsfxL-0007mY-T4\n for qemu-devel@nongnu.org; Wed, 18 Feb 2026 06:43:01 -0500", "from mail-pl1-f197.google.com (mail-pl1-f197.google.com\n [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-412-SXFvyQPSODugeHa5r82fiA-1; Wed, 18 Feb 2026 06:42:56 -0500", "by mail-pl1-f197.google.com with SMTP id\n d9443c01a7336-2aadeb3dee4so311566045ad.2\n for <qemu-devel@nongnu.org>; Wed, 18 Feb 2026 03:42:56 -0800 (PST)", "from rhel9-box.lan ([117.99.83.54])\n by smtp.googlemail.com with ESMTPSA id\n d9443c01a7336-2ad1aaeab38sm127803425ad.82.2026.02.18.03.42.52\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 18 Feb 2026 03:42:55 -0800 (PST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1771414978;\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=ILLZe/318SI2fwBccfO7VLFYXHx8OHK07juZHL2pnss=;\n b=ctz+YeRqqnGkx5QWnaOOt35xDpSVHsoakdEgUCbmbGL8Pun8Ntbiup/WU8Ekv7SrO8jJuy\n RsanmjIn8BbkICwn0Cfyq6xkHzX8Uje8NLaYQVTc4+BfGVC3VM6G6HabJOpNLLpixByyPh\n ZQ1L7s3KSe0MZhYbEqUq35UijpMYV5U=", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1771414976; x=1772019776; 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=ILLZe/318SI2fwBccfO7VLFYXHx8OHK07juZHL2pnss=;\n b=olME3GTATuHySEZmGUz5Tl8bOjKT+T79OiEiauHoQnj874vINIoE9qzvFSfyVQn+sD\n qLi7FbgMbLdIh8vU/kxfp7jiqZqVL/j0YPKKarf+0YovNd7pNsA5j8pMauVtlA2TZsBC\n yE/GVS1CdmPNOVwhnbppVXKBbc57dAOSpy8y5yvFHEqgRZS8z5Wh7vYIPD0tH68Pmljp\n F+pBcMGyaczq7A7Istms36iygYFgzqH1KZusOIKtfxHyr4dEwXgd7utYWIeLG4mjHBGp\n IuCsinYd451ISoKoXw7VrGpNlGHpTQCJI6Q172u32KHFAtHHVP9vD/9P0AX5TyaqUhMZ\n HNEA==" ], "X-MC-Unique": "SXFvyQPSODugeHa5r82fiA-1", "X-Mimecast-MFC-AGG-ID": "SXFvyQPSODugeHa5r82fiA_1771414976", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771414976; x=1772019776;\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=ILLZe/318SI2fwBccfO7VLFYXHx8OHK07juZHL2pnss=;\n b=Yso2k6wOwMrTMPMQpO8rWG7Xr6dv2yhO3wcKXb8lR6EB+pmok7XZTQsaF8ELCaW5Cr\n ecLGPk5HT+1t9pO9EmT999LRHlZgfKm4V6BxEpj3MxMXyb4WXDlXwshG7stT1w7hUfNl\n D8YJvLtnLfaqsT/VOOu9iZMCdW+fuEhD1M1wqyG5ZqZ7VNIa+u7SJ55qFUDC1HSOdyhz\n AjY1nJLT8gViURVNbhMAgIWTCUglPxw8xdQHKsvTiNMzKcghV6ns+CDZV7oAnXnB3qOh\n ZE/z5puHCmnbtOtlS23BQbQqtPslcT9O9A2Ugk31HqlPQSqlQ5EMxgi/+M1BCRgY4673\n TTSg==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCWqZms6iwRZffCVSPsHLeq1W6VV84ggBS8K28TqOsAOiZM9azlOvAHn2y2dZb3ctEwQfAenAi8PdBQI@nongnu.org", "X-Gm-Message-State": "AOJu0Yx5JB/i5e+a7JGj1kTqG6Nev3u+gzzoP3Uc7fYnbMq0MgTt7J6s\n 721WpMSweJ4Xg07Csl1YW6on2Jku040i4MfTXlV92nMT31leUoQX1dx1vTDCpQ+l+GM4vqsI0y7\n mzkSraOQWGS+lJEZRpfJogqUB1z+Cz7yArfXyaV7qwmDTKHvj8MkbTNTD", "X-Gm-Gg": "AZuq6aK9xJhB9yrMYYqTKpo7JT5ys0D4jQl0r9FWWkCMLZrBnGAMGWddKvMdRJ2WSde\n 0XwVj237XSufavN49eG5tZaPJuGgFSM1QIuGIRwW3kj76FFNtQbBMsy5bNlEPiPC+/I94vTYV6Q\n khvgrofax5Ag2/htni8CqfrQg6NXSvuzj97FlPtS/iPiTCZ0O5NY8T+v3bvhyxK8Oc1ufRtT9+d\n gQNAXRuX7w5lnU+8wAYlFL5cyxWrT+reOWNbowWsyvoGfXPzt8niCvZeO7w04A0CtYYP6H/Km0E\n eTbQ7Ct0NMh2J0v+K2q96ANOXpKZVOT1T8TkaAwxFHqEetMn2BQt8yTUBIf47Mvj/E3HzVtqF03\n rW1qIcGO9jzAyFOlXGiEtBCwoO2INkE9CUCDIeyigM9RhNtb8rheA", "X-Received": [ "by 2002:a17:902:c94b:b0:2aa:cfee:a47b with SMTP id\n d9443c01a7336-2ab4d09c4famr209209435ad.54.1771414975855;\n Wed, 18 Feb 2026 03:42:55 -0800 (PST)", "by 2002:a17:902:c94b:b0:2aa:cfee:a47b with SMTP id\n d9443c01a7336-2ab4d09c4famr209209245ad.54.1771414975453;\n Wed, 18 Feb 2026 03:42:55 -0800 (PST)" ], "From": "Ani Sinha <anisinha@redhat.com>", "To": "Richard Henderson <richard.henderson@linaro.org>,\n Paolo Bonzini <pbonzini@redhat.com>,\n =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>", "Cc": "Ani Sinha <anisinha@redhat.com>, kraxel@redhat.com, qemu-devel@nongnu.org", "Subject": "[PATCH v5 03/34] hw/accel: add a per-accelerator callback to change\n VM accelerator handle", "Date": "Wed, 18 Feb 2026 17:11:56 +0530", "Message-ID": "<20260218114233.266178-4-anisinha@redhat.com>", "X-Mailer": "git-send-email 2.42.0", "In-Reply-To": "<20260218114233.266178-1-anisinha@redhat.com>", "References": "<20260218114233.266178-1-anisinha@redhat.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=170.10.133.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.043,\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": "When a confidential virtual machine is reset, a new guest context in the\naccelerator must be generated post reset. Therefore, the old accelerator guest\nfile handle must be closed and a new one created. To this end, a per-accelerator\ncallback, \"rebuild_guest\" is introduced that would get called when a confidential\nguest is reset. Subsequent patches will introduce specific implementation of\nthis callback for KVM accelerator.\n\nSigned-off-by: Ani Sinha <anisinha@redhat.com>\n---\n include/accel/accel-ops.h | 2 ++\n system/runstate.c | 38 +++++++++++++++++++++++++++++++++++++-\n 2 files changed, 39 insertions(+), 1 deletion(-)", "diff": "diff --git a/include/accel/accel-ops.h b/include/accel/accel-ops.h\nindex 23a8c246e1..f46492e3fe 100644\n--- a/include/accel/accel-ops.h\n+++ b/include/accel/accel-ops.h\n@@ -23,6 +23,8 @@ struct AccelClass {\n AccelOpsClass *ops;\n \n int (*init_machine)(AccelState *as, MachineState *ms);\n+ /* used mainly by confidential guests to rebuild guest state upon reset */\n+ int (*rebuild_guest)(MachineState *ms);\n bool (*cpu_common_realize)(CPUState *cpu, Error **errp);\n void (*cpu_common_unrealize)(CPUState *cpu);\n /* get_stats: Append statistics to @buf */\ndiff --git a/system/runstate.c b/system/runstate.c\nindex 13f32bed8c..e7b50e6a3b 100644\n--- a/system/runstate.c\n+++ b/system/runstate.c\n@@ -42,6 +42,7 @@\n #include \"qapi/qapi-commands-run-state.h\"\n #include \"qapi/qapi-events-run-state.h\"\n #include \"qemu/accel.h\"\n+#include \"accel/accel-ops.h\"\n #include \"qemu/error-report.h\"\n #include \"qemu/job.h\"\n #include \"qemu/log.h\"\n@@ -509,6 +510,9 @@ void qemu_system_reset(ShutdownCause reason)\n {\n MachineClass *mc;\n ResetType type;\n+ AccelClass *ac = ACCEL_GET_CLASS(current_accel());\n+ bool guest_state_rebuilt = false;\n+ int ret;\n \n mc = current_machine ? MACHINE_GET_CLASS(current_machine) : NULL;\n \n@@ -521,6 +525,29 @@ void qemu_system_reset(ShutdownCause reason)\n default:\n type = RESET_TYPE_COLD;\n }\n+\n+ if (!cpus_are_resettable() &&\n+ (reason == SHUTDOWN_CAUSE_GUEST_RESET ||\n+ reason == SHUTDOWN_CAUSE_HOST_QMP_SYSTEM_RESET)) {\n+ if (ac->rebuild_guest) {\n+ ret = ac->rebuild_guest(current_machine);\n+ if (ret < 0) {\n+ error_report(\"unable to rebuild guest: %s(%d)\",\n+ strerror(-ret), ret);\n+ vm_stop(RUN_STATE_INTERNAL_ERROR);\n+ } else {\n+ info_report(\"virtual machine state has been rebuilt with new \"\n+ \"guest file handle.\");\n+ guest_state_rebuilt = true;\n+ }\n+ } else if (!cpus_are_resettable()) {\n+ error_report(\"accelerator does not support reset!\");\n+ } else {\n+ error_report(\"accelerator does not support rebuilding guest state,\"\n+ \" proceeding with normal reset!\");\n+ }\n+ }\n+\n if (mc && mc->reset) {\n mc->reset(current_machine, type);\n } else {\n@@ -543,7 +570,16 @@ void qemu_system_reset(ShutdownCause reason)\n * it does _more_ than cpu_synchronize_all_post_reset().\n */\n if (cpus_are_resettable()) {\n- cpu_synchronize_all_post_reset();\n+ if (guest_state_rebuilt) {\n+ /*\n+ * If guest state has been rebuilt, then we\n+ * need to sync full cpu state for non confidential guests post\n+ * reset.\n+ */\n+ cpu_synchronize_all_post_init();\n+ } else {\n+ cpu_synchronize_all_post_reset();\n+ }\n }\n \n vm_set_suspended(false);\n", "prefixes": [ "v5", "03/34" ] }