From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F107D1A76BB for ; Tue, 27 Jan 2026 10:02:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508151; cv=none; b=IjPj31Yw+gwOaK9vep15a9pRe1Q3jbCN52cmizFYk0Yd0pRciiCoKELn8EJMsIIafx/+30FmoVtNQ4TDkPLR1lmMFbYkYE8PhYCeHuyfg4wcFitDgRYXIIuGQAzebYrCRj2YIx/XmONoQt6u8zXM90Yloi1iVhX1MPUbTPYYzo8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769508151; c=relaxed/simple; bh=UAUjazaJVnnYe4bGolsA2R8+JjyTr90JK6JhuBKbCtQ=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=BA0qCMYd0BQ9GnNsM7gZJgUCn0o4maabdMEKAIBfFjRfnHh8bKtVaX/1ZQU5/bZuJYRNV7YRi56C8/icSunLYrCDEVvYLx/EIqW5lzknueWj8cEW/+a/il2Rof+SfTuXD5uKCEcl++jBnujZ2Y1mR9k+ExXGBktgVbz3I8sW0Ls= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=SKHtqr0z; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SKHtqr0z" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1769508147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=8p/EwgBJHrgC+rdDH5Bz2ew9AKemHNoUO4GfNQsSUAY=; b=SKHtqr0zE+/wl449diA96CK60Q4l25lKmZFphtb1vbr+j1OemYpq00JR+jKJjGQBsEow8j HBgHaxHA8nkIuF1ZyvBmgOqLC8qcobfxtupTbpmdZMAHZD/ytJH9HRpENE46JiPVaPLZwr LeofmcUoCDG/DxXBBhzhTdLFydO9RP8= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-381-pMpvwHfDOCevPoToWAfAww-1; Tue, 27 Jan 2026 05:02:23 -0500 X-MC-Unique: pMpvwHfDOCevPoToWAfAww-1 X-Mimecast-MFC-AGG-ID: pMpvwHfDOCevPoToWAfAww_1769508142 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1C02E18005BE; Tue, 27 Jan 2026 10:02:22 +0000 (UTC) Received: from osteffen-thinkpadx1carbongen12.rmtde.csb (unknown [10.44.34.174]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 159301956095; Tue, 27 Jan 2026 10:02:16 +0000 (UTC) From: Oliver Steffen To: qemu-devel@nongnu.org Cc: Ani Sinha , Igor Mammedov , Marcelo Tosatti , Eduardo Habkost , Zhao Liu , Stefano Garzarella , Marcel Apfelbaum , Luigi Leonardi , Joerg Roedel , kvm@vger.kernel.org, Paolo Bonzini , "Michael S. Tsirkin" , Gerd Hoffmann , Richard Henderson , Oliver Steffen Subject: [PATCH v5 0/6] igvm: Supply MADT via IGVM parameter Date: Tue, 27 Jan 2026 11:02:09 +0100 Message-ID: <20260127100215.1073575-1-osteffen@redhat.com> Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 When launching using an IGVM file, supply a copy of the MADT (part of the ACPI tables) via an IGVM parameter (IGVM_VHY_MADT) to the guest, in addition to the regular fw_cfg mechanism. The IGVM parameter can be consumed by Coconut SVSM [1], instead of relying on the fw_cfg interface, which has caused problems before due to unexpected access [2,3]. Using IGVM parameters is the default way for Coconut SVSM; switching over would allow removing specialized code paths for QEMU in Coconut. Coconut SVSM needs to know the SMP configuration, but does not look at any other ACPI data, nor does it interact with the PCI bus settings. Since the MADT is static and not linked with other ACPI tables, it can be supplied stand-alone like this. Generating the MADT twice (IGVM processing and ACPI table building) seems acceptable, since there is no infrastructure to obtain the MADT out of the ACPI table memory area during IGVM processing. In any case OVMF, which runs after SVSM has already been initialized, will continue reading all ACPI tables via fw_cfg and provide fixed up ACPI data to the OS as before. This series makes ACPI table building more generic by making the BIOS linker optional. This allows the MADT to be generated outside of the ACPI build context. A new function (acpi_build_madt_standalone()) is added for that. With that, the IGVM MADT parameter field can be filled with the MADT data during processing of the IGVM file. [1] https://github.com/coconut-svsm/svsm/pull/858 [2] https://gitlab.com/qemu-project/qemu/-/issues/2882 [3] https://github.com/coconut-svsm/svsm/issues/646 v5: - Rebase on latest IGVM rework series from Gerd - Make qigvm_find_parameter_entry() more generic and use everywhere possible; It now takes the index as input, instead of the full parameter struct - Consistently use early returns when looking up parameter entries - Emit a warning message if no parameter area can be found for a given index v4: - Add ACPI table checksum calculation without BIOS linker, used for the standalone MADT. - Don't pass ConfidentialGuestState into the IGVM backend anymore. Not needed, since we already have the full MachineState there now. - Move the NULL check patch out into a new series (to be posted). - Address remaining cleanup comments. v3: - Pass the machine state into IGVM file processing context instead of MADT data - Generate MADT from inside the IGVM backend - Refactor: Extract common code for finding IGVM parameter from IGVM parameter handlers - Add NULL pointer check for igvm_get_buffer() v2: - Provide more context in the message of the main commit - Document the MADT parameter of IgvmCfgClass::process() - Document why no MADT data is provided the process call in sev.c Based-on: <20260126123755.357378-1-kraxel@redhat.com> Signed-off-by: Oliver Steffen Oliver Steffen (6): hw/acpi: Make BIOS linker optional hw/acpi: Add standalone function to build MADT igvm: Add common function for finding parameter entries igvm: Refactor qigvm_parameter_insert igvm: Pass machine state to IGVM file processing igvm: Fill MADT IGVM parameter field backends/igvm-cfg.c | 2 +- backends/igvm.c | 255 +++++++++++++++++++++++--------------- hw/acpi/aml-build.c | 29 ++++- hw/i386/acpi-build.c | 9 ++ hw/i386/acpi-build.h | 2 + include/system/igvm-cfg.h | 3 +- include/system/igvm.h | 5 +- target/i386/sev.c | 3 +- 8 files changed, 197 insertions(+), 111 deletions(-) -- 2.52.0