Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2195846/?format=api
{ "id": 2195846, "url": "http://patchwork.ozlabs.org/api/patches/2195846/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260212062522.99565-11-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-11-anisinha@redhat.com>", "list_archive_url": null, "date": "2026-02-12T06:24:54", "name": "[v4,10/31] hw/i386: refactor x86_bios_rom_init for reuse in confidential guest reset", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "489546df6b65da471ac870213e35fa3626c5739c", "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-11-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/2195846/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2195846/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=eEpcAihm;\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=pN1hHD+G;\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 4fBQP35gZrz1xwL\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 17:28:55 +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 1vqQ9b-0007mQ-Ug; Thu, 12 Feb 2026 01:26: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 1vqQ9V-0007iu-NS\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 01:26:14 -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 1vqQ9U-0005F5-6c\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 01:26:13 -0500", "from mail-pl1-f200.google.com (mail-pl1-f200.google.com\n [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-575-J74VAOXYN0SG7A_8_mZs9g-1; Thu, 12 Feb 2026 01:26:08 -0500", "by mail-pl1-f200.google.com with SMTP id\n d9443c01a7336-2aad3380076so9723005ad.1\n for <qemu-devel@nongnu.org>; Wed, 11 Feb 2026 22:26:07 -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.26.03\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 11 Feb 2026 22:26:06 -0800 (PST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1770877571;\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=f3dHz72pMGOzBjOAKTFnNPZbVkxnwyGphMFnDiAHDeY=;\n b=eEpcAihmvQn9vsatnPAL6WiQDB5jCZA1JT+hcBsjh0DCLV+HSrHnv4OzjEBwNfB1eLUkez\n 3SR9Sm3ePrSSXHahlSq5Q0a04TJk86aqiMJtT58vQRVBdJeug2D/HdpiDfAb3wgW7vLIwT\n M77EpEAU2UVVYXh2YQb0DNRq6Q/sBIE=", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1770877567; x=1771482367; 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=f3dHz72pMGOzBjOAKTFnNPZbVkxnwyGphMFnDiAHDeY=;\n b=pN1hHD+GGixSSXlb7ldv3gDUFrjxbO8df96AfJu6bgHlXxen6/72vIj2RvR0a+JuGN\n irs7ULS397LvDOL7Bvsbam+ldXVf9Pl8iQHjQRqOX5i4+qZw9n+O53wn82ZZRxzKo8/a\n 9L2uudHT31P8L0plA/vszol50+nhm8FM2nPAtjyd6Lh8RSS3IdgEx/ZnAI4faEiccQxV\n 19l540wTm2ZzFflal4+iqEDIR5YoTagruFNqU51Oo30g5/U9DzjUQyNhUhVC1cJWx37M\n h3kR6gEft6wkGDnSqJyTo/zDWt4wNADRe6L9N7Dd3M/DVS6K14WfoNO4J5KVFiB9ekFK\n ZOsA==" ], "X-MC-Unique": "J74VAOXYN0SG7A_8_mZs9g-1", "X-Mimecast-MFC-AGG-ID": "J74VAOXYN0SG7A_8_mZs9g_1770877567", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770877567; x=1771482367;\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=f3dHz72pMGOzBjOAKTFnNPZbVkxnwyGphMFnDiAHDeY=;\n b=Y8xmWT/D2mtgN6sevfnj//v5FDONl/rlFi2pckjcm9ldH5yIuRyFQKkGGN0psyaic+\n fvvYl82Vtpe4QCU8SPsowVEptdceD+zkD8ibPtZIqlpuN//B9Pqa2zZYGMcQVhZtgc5r\n ue2s223JGM7DFLFbDWaMxQ6g69GcqV3BS/1oybafZTkt+akJFLNdgUcPAwuOsJcZt3Xn\n 5cSKiUmJy2zHLgkwpOA09xlbyta6qRaw0gpM8TDU/SKHXU/blZffTDuuk9DAFEKwzqVT\n 2apHFgDvxo95VYuPdLgtdEAqofLFXBxFCOENDnVWMHNE6d4d0RKHlCR0JkzQYRu/EsE3\n beYQ==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCVMwjvSpepAVat7KJLDv9SbH2wOZNE77ZwxZYpNq57jP8brrB/UKz+JhSbMKX2v0Gc/EhIWBPpb5Xob@nongnu.org", "X-Gm-Message-State": "AOJu0YzateeEFxm8+eLKL9RVB5h3htuqOyaHpd/Qz22D1Y66gXZXM4ia\n MvB9wL7zRRTKx10T+7Pf5OzFY1pPL/TiWt7QMiMGfKhRJy5i1BNBJK3gFC1d2iUd1Vqju4zbNL3\n XBqdW/aeN6qLifMBudvbwLKQMPMYRrDVoOTDmEuTrcm1GVBbcodwRjBNU", "X-Gm-Gg": "AZuq6aLBIuzU+CrIcjE1/2DOwyZ5SOQOGCYXX8bbQ5bonIKDM1AbNX4YLiddxf691OI\n PXmb8L05aZlcosLehJoep9HMHd6IRbMJHqH8tomPp9OWKDQljpVpNf8ljq8qqCev4OO7L4pLoiq\n P/IgdFXXxYlf4im4fD/pppxUMkNJ5tXtEkQEzmoghLNrjIvYJ4YlU1paN+x97vsLOIiaexT2kud\n EJEc8xGYw40csFvwQVX38MThr71CjjI60RBY8Du+Q6xMBqOw2w27VmRod3qevs9seClgP/dfR2O\n 9WTqqVimUR3iYe+eYrSYNCAu2H0V9h1aDHB6SzDF4K86+7eBk7tjA+g0FnNjNVhFNQVC6PcswiO\n 1bwPXjRMakJp8pGuJxlkw30dWbvfzpBnYy+BjMSXJHJf4gWuNQRo/I8A=", "X-Received": [ "by 2002:a17:90b:3a83:b0:340:b501:7b83 with SMTP id\n 98e67ed59e1d1-35692ca72fdmr1269136a91.10.1770877566933;\n Wed, 11 Feb 2026 22:26:06 -0800 (PST)", "by 2002:a17:90b:3a83:b0:340:b501:7b83 with SMTP id\n 98e67ed59e1d1-35692ca72fdmr1269119a91.10.1770877566499;\n Wed, 11 Feb 2026 22:26:06 -0800 (PST)" ], "From": "Ani Sinha <anisinha@redhat.com>", "To": "Paolo Bonzini <pbonzini@redhat.com>,\n Richard Henderson <richard.henderson@linaro.org>,\n Eduardo Habkost <eduardo@habkost.net>,\n \"Michael S. Tsirkin\" <mst@redhat.com>,\n Marcel Apfelbaum <marcel.apfelbaum@gmail.com>", "Cc": "kraxel@redhat.com, Ani Sinha <anisinha@redhat.com>, qemu-devel@nongnu.org", "Subject": "[PATCH v4 10/31] hw/i386: refactor x86_bios_rom_init for reuse in\n confidential guest reset", "Date": "Thu, 12 Feb 2026 11:54:54 +0530", "Message-ID": "<20260212062522.99565-11-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": "For confidential guests, bios image must be reinitialized upon reset. This\nis because bios memory is encrypted and hence once the old confidential\nkvm context is destroyed, it cannot be decrypted. It needs to be reinitilized.\nIn order to do that, this change refactors x86_bios_rom_init() code so that\nparts of it can be called during confidential guest reset.\n\nSigned-off-by: Ani Sinha <anisinha@redhat.com>\n---\n hw/i386/x86-common.c | 50 ++++++++++++++++++++++++++++++++------------\n 1 file changed, 37 insertions(+), 13 deletions(-)", "diff": "diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c\nindex c1c9224039..18f2e2cfb9 100644\n--- a/hw/i386/x86-common.c\n+++ b/hw/i386/x86-common.c\n@@ -1024,17 +1024,11 @@ void x86_isa_bios_init(MemoryRegion *isa_bios, MemoryRegion *isa_memory,\n memory_region_set_readonly(isa_bios, read_only);\n }\n \n-void x86_bios_rom_init(X86MachineState *x86ms, const char *default_firmware,\n- MemoryRegion *rom_memory, bool isapc_ram_fw)\n+static int get_bios_size(X86MachineState *x86ms,\n+ const char *bios_name, char *filename)\n {\n- const char *bios_name;\n- char *filename;\n int bios_size;\n- ssize_t ret;\n \n- /* BIOS load */\n- bios_name = MACHINE(x86ms)->firmware ?: default_firmware;\n- filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);\n if (filename) {\n bios_size = get_image_size(filename, NULL);\n } else {\n@@ -1044,6 +1038,21 @@ void x86_bios_rom_init(X86MachineState *x86ms, const char *default_firmware,\n (bios_size % 65536) != 0) {\n goto bios_error;\n }\n+\n+ return bios_size;\n+\n+ bios_error:\n+ fprintf(stderr, \"qemu: could not load PC BIOS '%s'\\n\", bios_name);\n+ exit(1);\n+}\n+\n+static void load_bios_from_file(X86MachineState *x86ms, const char *bios_name,\n+ char *filename, int bios_size,\n+ bool isapc_ram_fw)\n+{\n+ ssize_t ret;\n+\n+ /* BIOS load */\n if (machine_require_guest_memfd(MACHINE(x86ms))) {\n memory_region_init_ram_guest_memfd(&x86ms->bios, NULL, \"pc.bios\",\n bios_size, &error_fatal);\n@@ -1072,7 +1081,26 @@ void x86_bios_rom_init(X86MachineState *x86ms, const char *default_firmware,\n goto bios_error;\n }\n }\n- g_free(filename);\n+\n+ return;\n+\n+ bios_error:\n+ fprintf(stderr, \"qemu: could not load PC BIOS '%s'\\n\", bios_name);\n+ exit(1);\n+}\n+\n+void x86_bios_rom_init(X86MachineState *x86ms, const char *default_firmware,\n+ MemoryRegion *rom_memory, bool isapc_ram_fw)\n+{\n+ int bios_size;\n+ const char *bios_name;\n+ g_autofree char *filename;\n+\n+ bios_name = MACHINE(x86ms)->firmware ?: default_firmware;\n+ filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);\n+\n+ bios_size = get_bios_size(x86ms, bios_name, filename);\n+ load_bios_from_file(x86ms, bios_name, filename, bios_size, isapc_ram_fw);\n \n if (!machine_require_guest_memfd(MACHINE(x86ms))) {\n /* map the last 128KB of the BIOS in ISA space */\n@@ -1085,8 +1113,4 @@ void x86_bios_rom_init(X86MachineState *x86ms, const char *default_firmware,\n (uint32_t)(-bios_size),\n &x86ms->bios);\n return;\n-\n-bios_error:\n- fprintf(stderr, \"qemu: could not load PC BIOS '%s'\\n\", bios_name);\n- exit(1);\n }\n", "prefixes": [ "v4", "10/31" ] }