Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2195858/?format=api
{ "id": 2195858, "url": "http://patchwork.ozlabs.org/api/patches/2195858/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260212062522.99565-27-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-27-anisinha@redhat.com>", "list_archive_url": null, "date": "2026-02-12T06:25:10", "name": "[v4,26/31] kvm/xen-emu: re-initialize capabilities during confidential guest reset", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "b1b6b0269ab3f1d0687452b0c94e5fa90c229cf7", "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-27-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/2195858/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2195858/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=Gsl7rIn9;\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=KUuCa0Cg;\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 4fBQQ74lJjz1xvb\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 17:29:51 +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 1vqQAr-0000yq-CW; Thu, 12 Feb 2026 01:27:37 -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 1vqQAW-0000Ri-PO\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 01:27:23 -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 1vqQAT-0005M9-Pw\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 01:27:15 -0500", "from mail-pj1-f70.google.com (mail-pj1-f70.google.com\n [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-592-rzUMDyRrMGOsw0DY62gVgA-1; Thu, 12 Feb 2026 01:27:11 -0500", "by mail-pj1-f70.google.com with SMTP id\n 98e67ed59e1d1-3545dbb7ee6so2365795a91.3\n for <qemu-devel@nongnu.org>; Wed, 11 Feb 2026 22:27:11 -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.27.07\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 11 Feb 2026 22:27:10 -0800 (PST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1770877633;\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=Lc7U1GbS1JHxjc6G1Vv9nRCpYH775c/aB7pSkgG/wFs=;\n b=Gsl7rIn9f/mGs/sB6kSZmpZo6b/EMvb1K/nunuUXPu99NZmsLBJEaCfiCgZRrTHD1TxdBE\n axNpfY0/8Byzo+CN7kUZmxN2MNCH134k+ssPJOPtisHzcaNQ/8FAyu3O2+YbdtCibJZ0ek\n y8bA0BzcQvMyihPEDN0tntVqy/LbuVQ=", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1770877631; x=1771482431; 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=Lc7U1GbS1JHxjc6G1Vv9nRCpYH775c/aB7pSkgG/wFs=;\n b=KUuCa0Cg8xI6dXjPJNqzRJ+wDHfQdl+/sq/xImyvydXkD7dOwfDVRmGoULzK4LIk7e\n Rd2GQ7V+KP8IjOWE1PQfdmha+xXKbb1OXlF7Egn05XxkOpxRh5gAau1tIcoVoz3kTw2+\n qFVReuu9bDmaYVXW9wMZeiVkqFgA3nzk6Yq+CQO4iE42VdTzA7s8lQH9rqXtKq97Lppd\n VIwRYgmn2qJ2icdlfethGMNCmYNN1WJSJD1cvsQG1eHOCrZhw/yFpTzFHQEsyMtUR4sm\n QHTVYRXPhJlS25be3bQxSbRYl6WRyfTJRTgzmRD5JkBIgViwFZRaxE6Vk+qtKdDrM+H/\n 2FEQ==" ], "X-MC-Unique": "rzUMDyRrMGOsw0DY62gVgA-1", "X-Mimecast-MFC-AGG-ID": "rzUMDyRrMGOsw0DY62gVgA_1770877631", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770877631; x=1771482431;\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=Lc7U1GbS1JHxjc6G1Vv9nRCpYH775c/aB7pSkgG/wFs=;\n b=fdj4KYXIP1TKSQ8xOBIyBod9KRh5VxrIlovSTfYasQVTXBOglnRIFWyIie/SH9Vwui\n +qPOe3seKLxLcKGxYmyT0k4eYAzJiMWivFjQebDNakYS37ReIy49dhTjgR08KyLKwmfm\n hFNKGIDWVSI0cBsFAhksocFjFkv6txT5xu6APIZt/mpj+1xmh5Ijm/G3BHCQW7KxskUV\n jhoFBAUhI3gWt/vEBuOEw9SbGjELZGejrNrpRbedJATUU1t1IYmUL/GILeuTuSuO35Ko\n JYfVnyaCOm0RYcKQTqeFdMOxO2iJe2dMld392DKbPO7oIJV2X9vxeQavo/uR6Hb4RPP4\n 4Viw==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCVnugi2Fk468IihsGCCRnXJreLaAlozyUb1+kbQgcNK/9IvmtlOQfOOblQ3aKPtOckTQlNdvOg7MPr1@nongnu.org", "X-Gm-Message-State": "AOJu0YzIPgZrWY/3u/bNu6qXe4WZPrQA4EPJHWDfcQHZxeHS21KqCs+Z\n RsEGwnPQmYyZ+PV761PpSdkXEMZbgjGaHjF9OKvnjX+RNEvO/xwYpyuVh0DKs033eMAyYgfqlkA\n l/vFdrYS4OI88HzW9QqpiyKEUbbUp1eD/WZgrb/QN9B0/Qm35mPQoCmf5", "X-Gm-Gg": "AZuq6aI9XRMFQ8ukKdi7Vy25BkqcQ+ZfqqKSrzK30y/uk28qWRLAJPROD9AjljqlW69\n 6u3iQhC9+3UIeo1iqiuULAY9jwF8+TFd7rL/XPB3lWEhX6DcPI8LGz2lWSW3mkUglKtIl+j+r4b\n /8g2Kz1B5WuUaJEhog1FRYES4X5UgFZAWyxXD4sMXb6Gz1yBjt4HB48HxmrOn+2yQsli9k3QRAx\n GLk+8R3gLlHu/CQCqNTPYAq5d5m52OQcVhoarLK/Sf/Q4beP/qPIqzyj4k1GWdlPskgjSZ8v8/d\n HAsW/BgiPjOpGDFkp3A7mPcNcE+iWmv1aNOMMozKmJVeS7ay59ydYU1VhqmxDUA2waCJ9IaZ3T1\n 1HWp76j3PHZsW2FOpCUJklY/sZbG3atVHtd7a/ZZJaaiqYtN0PSFbKiM=", "X-Received": [ "by 2002:a17:90a:d2ce:b0:341:2150:4856 with SMTP id\n 98e67ed59e1d1-35693d5e966mr1153069a91.17.1770877630752;\n Wed, 11 Feb 2026 22:27:10 -0800 (PST)", "by 2002:a17:90a:d2ce:b0:341:2150:4856 with SMTP id\n 98e67ed59e1d1-35693d5e966mr1153054a91.17.1770877630409;\n Wed, 11 Feb 2026 22:27:10 -0800 (PST)" ], "From": "Ani Sinha <anisinha@redhat.com>", "To": "David Woodhouse <dwmw2@infradead.org>, Paul Durrant <paul@xen.org>,\n Paolo Bonzini <pbonzini@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>", "Cc": "kraxel@redhat.com, Ani Sinha <anisinha@redhat.com>, kvm@vger.kernel.org,\n qemu-devel@nongnu.org", "Subject": "[PATCH v4 26/31] kvm/xen-emu: re-initialize capabilities during\n confidential guest reset", "Date": "Thu, 12 Feb 2026 11:55:10 +0530", "Message-ID": "<20260212062522.99565-27-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.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.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_H2=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": "On confidential guests KVM virtual machine file descriptor changes as a\npart of the guest reset process. Xen capabilities needs to be re-initialized in\nKVM against the new file descriptor.\n\nSigned-off-by: Ani Sinha <anisinha@redhat.com>\n---\n target/i386/kvm/xen-emu.c | 50 +++++++++++++++++++++++++++++++++++++--\n 1 file changed, 48 insertions(+), 2 deletions(-)", "diff": "diff --git a/target/i386/kvm/xen-emu.c b/target/i386/kvm/xen-emu.c\nindex 52de019834..69527145eb 100644\n--- a/target/i386/kvm/xen-emu.c\n+++ b/target/i386/kvm/xen-emu.c\n@@ -44,9 +44,12 @@\n \n #include \"xen-compat.h\"\n \n+NotifierWithReturn xen_vmfd_change_notifier;\n+static bool hyperv_enabled;\n static void xen_vcpu_singleshot_timer_event(void *opaque);\n static void xen_vcpu_periodic_timer_event(void *opaque);\n static int vcpuop_stop_singleshot_timer(CPUState *cs);\n+static int do_initialize_xen_caps(KVMState *s, uint32_t hypercall_msr);\n \n #ifdef TARGET_X86_64\n #define hypercall_compat32(longmode) (!(longmode))\n@@ -54,6 +57,30 @@ static int vcpuop_stop_singleshot_timer(CPUState *cs);\n #define hypercall_compat32(longmode) (false)\n #endif\n \n+static int xen_handle_vmfd_change(NotifierWithReturn *n,\n+ void *data, Error** errp)\n+{\n+ int ret;\n+\n+ /* we are not interested in pre vmfd change notification */\n+ if (((VmfdChangeNotifier *)data)->pre) {\n+ return 0;\n+ }\n+\n+ ret = do_initialize_xen_caps(kvm_state, XEN_HYPERCALL_MSR);\n+ if (ret < 0) {\n+ return ret;\n+ }\n+\n+ if (hyperv_enabled) {\n+ ret = do_initialize_xen_caps(kvm_state, XEN_HYPERCALL_MSR_HYPERV);\n+ if (ret < 0) {\n+ return ret;\n+ }\n+ }\n+ return 0;\n+}\n+\n static bool kvm_gva_to_gpa(CPUState *cs, uint64_t gva, uint64_t *gpa,\n size_t *len, bool is_write)\n {\n@@ -111,15 +138,16 @@ static inline int kvm_copy_to_gva(CPUState *cs, uint64_t gva, void *buf,\n return kvm_gva_rw(cs, gva, buf, sz, true);\n }\n \n-int kvm_xen_init(KVMState *s, uint32_t hypercall_msr)\n+static int do_initialize_xen_caps(KVMState *s, uint32_t hypercall_msr)\n {\n+ int xen_caps, ret;\n const int required_caps = KVM_XEN_HVM_CONFIG_HYPERCALL_MSR |\n KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL | KVM_XEN_HVM_CONFIG_SHARED_INFO;\n+\n struct kvm_xen_hvm_config cfg = {\n .msr = hypercall_msr,\n .flags = KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL,\n };\n- int xen_caps, ret;\n \n xen_caps = kvm_check_extension(s, KVM_CAP_XEN_HVM);\n if (required_caps & ~xen_caps) {\n@@ -143,6 +171,21 @@ int kvm_xen_init(KVMState *s, uint32_t hypercall_msr)\n strerror(-ret));\n return ret;\n }\n+ return xen_caps;\n+}\n+\n+int kvm_xen_init(KVMState *s, uint32_t hypercall_msr)\n+{\n+ int xen_caps;\n+\n+ xen_caps = do_initialize_xen_caps(s, hypercall_msr);\n+ if (xen_caps < 0) {\n+ return xen_caps;\n+ }\n+\n+ if (!hyperv_enabled && (hypercall_msr == XEN_HYPERCALL_MSR_HYPERV)) {\n+ hyperv_enabled = true;\n+ }\n \n /* If called a second time, don't repeat the rest of the setup. */\n if (s->xen_caps) {\n@@ -185,6 +228,9 @@ int kvm_xen_init(KVMState *s, uint32_t hypercall_msr)\n xen_primary_console_reset();\n xen_xenstore_reset();\n \n+ xen_vmfd_change_notifier.notify = xen_handle_vmfd_change;\n+ kvm_vmfd_add_change_notifier(&xen_vmfd_change_notifier);\n+\n return 0;\n }\n \n", "prefixes": [ "v4", "26/31" ] }