From nobody Sat Feb 7 04:47:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+81495+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81495+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1633405270; cv=none; d=zohomail.com; s=zohoarc; b=FIOw4KW3eZTlAX73ujm5PU7jNXcQrGjpWv9NR0rmFDu3+Z++2oITHzzIeatvJnd1TW6vLJA5ap9kpetHtKskH7SN4zntwdGRMz68icVPXErG3Fxohmigwuw65zmqAZr/MjcNMcRqG6+mCD0/r5uBNHFeYfjcQ+0TL0pCnQZZ3yc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1633405270; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=cyfcjzSKX9iBlvxsj9CZ/SZjUnWiHxxJz4hAkiZN088=; b=TPSjN5ZelCAjq+KB5atHQBcEVr4Ye/RuCK1uSTUPzHb1y9W8fyuaJwHDFaimUuRRqQkq/RkoexlpHYHAfhHRWVx90h4aFyj90YXl2JdnMOFmfkWjyeXWxykYwuCqaoS1iwVPCC9RTmaFI2Q11IwpMmPmTj9kdsGR4Rv70QgdQfA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+81495+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1633405270227442.564528753437; Mon, 4 Oct 2021 20:41:10 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id pbDOYY1788612xP3yBvrvdam; Mon, 04 Oct 2021 20:41:09 -0700 X-Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.20673.1633405264221469310 for ; Mon, 04 Oct 2021 20:41:06 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10127"; a="225958244" X-IronPort-AV: E=Sophos;i="5.85,347,1624345200"; d="scan'208";a="225958244" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 20:40:58 -0700 X-IronPort-AV: E=Sophos;i="5.85,347,1624345200"; d="scan'208";a="487828786" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.239]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Oct 2021 20:40:56 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [edk2-devel] [PATCH V2 23/28] OvmfPkg: Update AcpiPlatformDxe to alter MADT table Date: Tue, 5 Oct 2021 11:39:34 +0800 Message-Id: <3c7bf0653e02c333fb25009df61c9ef40b2c7625.1633401643.git.min.m.xu@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,min.m.xu@intel.com X-Gm-Message-State: RD5aUMGChiQ7zckhrjj5tQt9x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1633405269; bh=yWagvEtjty0ypDH5D8kIHFMvQWuMA9gS5Jh0lQSfnYs=; h=Cc:Date:From:Reply-To:Subject:To; b=hPkpwTcGe0x9MGQjagBcCDNdy2YY3lHsOo/0rUfIa/Ruu7ECTQooAUfuVgejIANzZFz ITVtdoF41/ZFl0pBwiDzDytKYSxHlRzShRTyu9OM7qDoQHi06TnfGBMMy8z0L70D/zCBO HW9u60EnGh9qdHsdnlGJfsPMfqrMtyLe3wI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1633405271017100037 Content-Type: text/plain; charset="utf-8" RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3429 In TDX the guest firmware is designed to publish a multiprocessor-wakeup structure to let the guest-bootstrap processor wake up guest-application processors with a mailbox. The mailbox is memory that the guest firmware can reserve so each guest virtual processor can have the guest OS send a message to them. The address of the mailbox is recorded in the MADT table. See [ACPI]. To maintain the simplicity of the AcpiPlatformDxe, the MADT ACPI table will be altered in another driver (TdxDxe) by installing a protocol to notify that the ACPI table provided by Qemu is ready. Then in TdxDxe a notification functioin will be called to alter the MADT table to recorded the mailbox address. The protocol is gQemuAcpiTableNotifyProtocolGuid. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Signed-off-by: Min Xu --- OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c | 12 +++++++- .../QemuFwCfgAcpiPlatformDxe.inf | 1 + .../Include/Protocol/QemuAcpiTableNotify.h | 29 +++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 OvmfPkg/Include/Protocol/QemuAcpiTableNotify.h diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/AcpiPlatform= Dxe/QemuFwCfgAcpi.c index df800b149275..e8a9aff089e8 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c @@ -19,7 +19,10 @@ #include // QemuFwCfgS3Enabled() #include // gBS =20 +#include #include "AcpiPlatform.h" +EFI_HANDLE mQemuAcpiHandle =3D NULL; +QEMU_ACPI_TABLE_NOTIFY_PROTOCOL mAcpiNotifyProtocol; =20 // // The user structure for the ordered collection that will track the fw_cfg @@ -1129,7 +1132,14 @@ UninstallAcpiTables: AcpiProtocol->UninstallAcpiTable (AcpiProtocol, InstalledKey[Install= ed]); } } else { - DEBUG ((DEBUG_INFO, "%a: installed %d tables\n", __FUNCTION__, Install= ed)); + // + // Install a protocol to notify that the ACPI table provided by Qemu= is + // ready. + // + gBS->InstallProtocolInterface (&mQemuAcpiHandle, + &gQemuAcpiTableNotifyProtocolGuid, + EFI_NATIVE_INTERFACE, + &mAcpiNotifyProtocol); } =20 for (SeenPointerEntry =3D OrderedCollectionMin (SeenPointers); diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf b/OvmfPkg= /AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf index dac25d1505be..6ffce2db5f99 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf @@ -48,6 +48,7 @@ [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiPciIoProtocolGuid # PROTOCOL SOMETIMES_CONSU= MED + gQemuAcpiTableNotifyProtocolGuid # PROTOCOL PRODUCES =20 [Guids] gRootBridgesConnectedEventGroupGuid diff --git a/OvmfPkg/Include/Protocol/QemuAcpiTableNotify.h b/OvmfPkg/Inclu= de/Protocol/QemuAcpiTableNotify.h new file mode 100644 index 000000000000..8549ea9ec374 --- /dev/null +++ b/OvmfPkg/Include/Protocol/QemuAcpiTableNotify.h @@ -0,0 +1,29 @@ +/** @file + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef QEMU_ACPI_TABLE_NOTIFY_H_ +#define QEMU_ACPI_TABLE_NOTIFY_H_ + + +#define QEMU_ACPI_TABLE_NOTIFY_GUID \ + { 0x928939b2, 0x4235, 0x462f, { 0x95, 0x80, 0xf6, 0xa2, 0xb2, 0xc2, 0x1a= , 0x4f } }; + + +/// +/// Forward declaration +/// +typedef struct _QEMU_ACPI_TABLE_NOTIFY_PROTOCOL QEMU_ACPI_TABLE_NOTIFY_PRO= TOCOL; + +/// +/// Protocol structure +/// +struct _QEMU_ACPI_TABLE_NOTIFY_PROTOCOL { + UINT8 Notify; +}; + +extern EFI_GUID gQemuAcpiTableNotifyProtocolGuid; + +#endif --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81495): https://edk2.groups.io/g/devel/message/81495 Mute This Topic: https://groups.io/mt/86085764/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-