From nobody Sun Feb 8 19:38:17 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+108867+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+108867+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1695171489; cv=none; d=zohomail.com; s=zohoarc; b=O0Bkvz4HTt2OdM8htuuwpBGpNbpbZ6H7WKO2BBKGcyJ7Z2MDHhwORRLpZLnQ5i5zL6VqK35wl5fIrZNcAYctoCGCkrXDiE2G/2/U/kJqqzsH6YOPrZ12m5a85KsuBafvJ15DtB94EPXwGSi5FhUxBf+52CNf9FjD0VpcmErLGEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1695171489; 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=kvRFHIdJ95N8JHedL+bbrpAt2hT6BXYeo6AYLxTu8Qo=; b=dDAFTwP0RkWT7/5rgDFyDmpMFxQW2kTPnbYDxyraL+Z7wD0lFGpmI1S1sUljjw0dVRMcV6bFgt8IZXTQXP8WFG9A+g5UP8vbkJknydZyb/Bnelg7kzo231pGA24MB5+JQeP1+MFwpnKxg4+GYcSjd6JewCrT3s71AZS18Dl52s4= 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+108867+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 1695171489421663.9463322044224; Tue, 19 Sep 2023 17:58:09 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=4n05ureXT95ICprA7McyZ9hVOsM/gWT6nbz4Vy918TI=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1695171489; v=1; b=jSXnvcnsK6i1Hhfb1+mjSgnKxD4kzAWUWuh4bB3XqOmOq+lT36IsCa1YRSxUq+eutJOdPPCt CZ3Ein3pAcNEcp+It7ITAqVMDiYrEceViGSqHMPgq/nCLYDc4Mrh+b4VLdpOZd6RXwCY2srWkB1 hKAe72rjR5aEn+UcC7W4UzkM= X-Received: by 127.0.0.2 with SMTP id jVPEYY1788612xZmSz1ICsge; Tue, 19 Sep 2023 17:58:09 -0700 X-Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mx.groups.io with SMTP id smtpd.web10.26778.1695171488202460673 for ; Tue, 19 Sep 2023 17:58:08 -0700 X-Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1c453379020so27759025ad.1 for ; Tue, 19 Sep 2023 17:58:08 -0700 (PDT) X-Gm-Message-State: Y3yqA60YEws3XU8nw1hMUoOpx1787277AA= X-Google-Smtp-Source: AGHT+IGzP5Qy55J8OH5LipncvLQddN6te4OGxipZ3AdklX97rziDR6ze6rMtZlOQ0ylli38+EWPYpQ== X-Received: by 2002:a17:902:f551:b0:1c3:f023:9823 with SMTP id h17-20020a170902f55100b001c3f0239823mr1106857plf.6.1695171487514; Tue, 19 Sep 2023 17:58:07 -0700 (PDT) X-Received: from localhost.localdomain ([50.46.253.1]) by smtp.gmail.com with ESMTPSA id 13-20020a170902c24d00b001bb988ac243sm10563576plg.297.2023.09.19.17.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 17:58:07 -0700 (PDT) From: "Taylor Beebe" To: devel@edk2.groups.io Cc: Jian J Wang , Liming Gao , Dandan Bi Subject: [edk2-devel] [PATCH v4 05/28] MdeModulePkg: Copy PEI PCD Database Into New Buffer Date: Tue, 19 Sep 2023 17:57:28 -0700 Message-ID: <20230920005752.2041-6-taylor.d.beebe@gmail.com> In-Reply-To: <20230920005752.2041-1-taylor.d.beebe@gmail.com> References: <20230920005752.2041-1-taylor.d.beebe@gmail.com> MIME-Version: 1.0 Precedence: Bulk 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,taylor.d.beebe@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1695171491252100022 Content-Type: text/plain; charset="utf-8" HOB memory should not be written to in DXE phase. This patch copies the PCD database from PEI into a new buffer so updates to dynamic PCDs don't write to HOB memory. Signed-off-by: Taylor Beebe Cc: Jian J Wang Cc: Liming Gao Cc: Dandan Bi --- MdeModulePkg/Universal/PCD/Dxe/Service.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Univer= sal/PCD/Dxe/Service.c index 1ae06a639c43..0feb11142545 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -885,15 +885,17 @@ BuildPcdDxeDataBase ( // be NULL. If it is NULL, we just copy over the DXE Default // Value to PCD Database. // - PeiDatabase =3D (PEI_PCD_DATABASE *)GET_GUID_HOB_DATA (GuidHob); + PeiDatabase =3D AllocateCopyPool ((UINTN)GET_GUID_HOB_DATA_SIZE (GuidH= ob), GET_GUID_HOB_DATA (GuidHob)); + ASSERT (PeiDatabase !=3D NULL); =20 // // Get next one that stores full PEI data // GuidHob =3D GetNextGuidHob (&gPcdDataBaseHobGuid, GET_NEXT_HOB (GuidHo= b)); if (GuidHob !=3D NULL) { - mPeiPcdDbBinary =3D (PEI_PCD_DATABASE *)GET_GUID_HOB_DATA (GuidHob); mPeiPcdDbSize =3D (UINTN)GET_GUID_HOB_DATA_SIZE (GuidHob); + mPeiPcdDbBinary =3D (PEI_PCD_DATABASE *)AllocateCopyPool (mPeiPcdDbS= ize, GET_GUID_HOB_DATA (GuidHob)); + ASSERT (mPeiPcdDbBinary !=3D NULL); } =20 // --=20 2.42.0.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 (#108867): https://edk2.groups.io/g/devel/message/108867 Mute This Topic: https://groups.io/mt/101469942/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-