From nobody Wed Feb 11 03:02:11 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+94686+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+94686+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1664823250; cv=none; d=zohomail.com; s=zohoarc; b=VkWOxPnPbTYajw1+PZqLrM78B0VzP6064jnQ2A8A8El/27TqpqVJGt3lrNc+a8BvGXV8rP3E96aDDf2Mr7x5QHnvuxvSTtFoaSelcThMhgt90iR3jj/o7xxxeUV4sEhNC9nClPI+XLvyHGpUezA6XZYSndvmmn14LQrKvb7SQL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664823250; h=Content-Type: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=5BD1HFDE+nGxSp3YaItbQ1XyF9UXdnGEHPbvydiv/vY=; b=UnLuT41QSfxJBMpy6pkB7u/wl3qjsfUSzGqdBKSxtpkJk7up8J1Rmop629Ilz2NcXC115qjlOYPcpzAvnsouCTvPFQIghprGDoBnEDTyowGsXV6JpA0lYOCJLjZ808+9zPChVRxjqgZtDTSsfwry2HTrW1QNp0ctzBSCAJUgl7E= 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+94686+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1664823250942943.8340306032491; Mon, 3 Oct 2022 11:54:10 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id x1v7YY1788612xI6uk4rZ4hL; Mon, 03 Oct 2022 11:54:10 -0700 X-Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) by mx.groups.io with SMTP id smtpd.web09.1512.1664823249905982015 for ; Mon, 03 Oct 2022 11:54:10 -0700 X-Received: by mail-pl1-f201.google.com with SMTP id a5-20020a170902ecc500b0017eea4a394fso3094941plh.20 for ; Mon, 03 Oct 2022 11:54:09 -0700 (PDT) X-Gm-Message-State: 7cAJnSBmUE5zEDgIt84tLhWVx1787277AA= X-Google-Smtp-Source: AMsMyM7GWJv+6owLZyB87neXlUhuu7BeUN/RPG8Z2qz1mfHUvT1sd7i+YOYj+Z3FDd/XNUnZgEMb3sdAAZU4RiFeDg== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a17:90a:aa96:b0:205:bb67:a85f with SMTP id l22-20020a17090aaa9600b00205bb67a85fmr13365383pjq.202.1664823249388; Mon, 03 Oct 2022 11:54:09 -0700 (PDT) Date: Mon, 3 Oct 2022 18:53:51 +0000 In-Reply-To: <20221003185352.3969999-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20221003185352.3969999-1-dionnaglaze@google.com> Message-ID: <20221003185352.3969999-7-dionnaglaze@google.com> Subject: [edk2-devel] [PATCH v6 6/7] OvmfPkg: Implement AcceptAllUnacceptedMemory in CocoDxe From: "Dionna Glaze via groups.io" To: devel@edk2.groups.io Cc: Dionna Glaze , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky , Ard Biesheuvel , "Min M. Xu" , Andrew Fish , "Michael D. Kinney" 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,dionnaglaze@google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1664823250; bh=1qFr/edhNOIbJmLlf0/Y4v8h/0DqErju8NmsQdSOmSE=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=IqrePddrBI+973SeOFerfP3RDyynshnnvqI2ZL09vwWcunM/cc1Br2jMsvs4dmuXJLc 8ZmCriMOUBnH3nG0Md4HvhpRtfKSpgraH5nUG1IEL7B+s1Y9IvF30OyRc/8SM+R4Afvfz Siwh/h0TR29+XgKwAju5sPsARmywOMEkwn8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1664823252805100021 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This protocol implementation disables the accept-all-memory behavior of the ExitBootServicesCallback instance thise driver adds. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Cc: "Min M. Xu" Cc: Andrew Fish Cc: "Michael D. Kinney" Signed-off-by: Dionna Glaze --- OvmfPkg/CocoDxe/CocoDxe.c | 25 ++++++++++++++++++++ OvmfPkg/CocoDxe/CocoDxe.inf | 1 + 2 files changed, 26 insertions(+) diff --git a/OvmfPkg/CocoDxe/CocoDxe.c b/OvmfPkg/CocoDxe/CocoDxe.c index 9e9a405af1..abf2d2b055 100644 --- a/OvmfPkg/CocoDxe/CocoDxe.c +++ b/OvmfPkg/CocoDxe/CocoDxe.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include =20 @@ -113,6 +114,21 @@ STATIC EDKII_EXIT_BOOT_SERVICES_CALLBACK_PROTOCOL mExi= tBootServicesCallbackProco FALSE, }; =20 +STATIC +EFI_STATUS +EFIAPI +DisableAcceptAllUnacceptedMemory ( + IN BZ3987_ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL *This + ) +{ + mExitBootServicesCallbackProcotol.Disabled =3D TRUE; + return EFI_SUCCESS; +} + +STATIC +BZ3987_ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL +mAcceptAllUnacceptedMemoryProtocol =3D {DisableAcceptAllUnacceptedMemory}; + EFI_STATUS EFIAPI CocoDxeEntryPoint ( @@ -140,5 +156,14 @@ CocoDxeEntryPoint ( DEBUG ((DEBUG_ERROR, "Install EdkiiExitBootServicesCallbackProtocol fa= iled.\n")); } =20 + Status =3D gBS->InstallProtocolInterface (&mCocoDxeHandle, + &gBz3987AcceptAllUnacceptedMemoryProtocolGuid, + EFI_NATIVE_INTERFACE, + &mAcceptAllUnacceptedMemoryProtocol + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Install Bz3987AcceptAllUnacceptedMemoryProtocol = failed.\n")); + } + return EFI_SUCCESS; } diff --git a/OvmfPkg/CocoDxe/CocoDxe.inf b/OvmfPkg/CocoDxe/CocoDxe.inf index 3ff2a6fade..96ab3e1c68 100644 --- a/OvmfPkg/CocoDxe/CocoDxe.inf +++ b/OvmfPkg/CocoDxe/CocoDxe.inf @@ -39,5 +39,6 @@ TRUE =20 [Protocols] + gBz3987AcceptAllUnacceptedMemoryProtocolGuid gEdkiiExitBootServicesCallbackProtocolGuid gEfiMemoryAcceptProtocolGuid --=20 2.38.0.rc1.362.ged0d419d3c-goog -=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 (#94686): https://edk2.groups.io/g/devel/message/94686 Mute This Topic: https://groups.io/mt/94098176/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-