From nobody Sat Apr 27 03:26:39 2024 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+85437+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+85437+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1641786918; cv=none; d=zohomail.com; s=zohoarc; b=DEDl4Y6c504+PU0q2PE8XYZVwl2ieNzgYBu97EEbl+CyP5aSCvuOtwD3pp21mxXMM9BP+42+eesnm+5bc1te2NGr0dy0VKJ9ibRpPJVnrJYfUPNQWiOAQq94FGa310ze8v4LOVXlO8XzzaPhiZ5dhNyCTIXczfeiWWwcklBJM+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1641786918; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=D1ru4ya9b4vxmgepSBJ4gw/crB/aQWSKTQvs9aviSoU=; b=UabTc7MkLjt2RipIT6IEcuYxKJ/bKYB7PXtwqmk7jA3AThyMa99mwAjEIMMAU9O4MOBoc83JAWE0JIR+R+Qt0JOg3rYIhLWipVLcu72GPtA9iA+wq/a2Wj4g5ez5TQCTxWhwpaBtxdh9/Sey2HPAWBPuSGY1kWLZ6r/pqR3XN2Y= 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+85437+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 1641786918744419.02909091794186; Sun, 9 Jan 2022 19:55:18 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3F6SYY1788612xCNtIGDGM67; Sun, 09 Jan 2022 19:55:18 -0800 X-Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web08.11563.1641584224830185774 for ; Fri, 07 Jan 2022 11:37:05 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10220"; a="303673726" X-IronPort-AV: E=Sophos;i="5.88,270,1635231600"; d="scan'208";a="303673726" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2022 11:37:03 -0800 X-IronPort-AV: E=Sophos;i="5.88,270,1635231600"; d="scan'208";a="513912145" X-Received: from sfe-showell1x.amr.corp.intel.com ([10.54.22.121]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2022 11:37:03 -0800 From: Stacy Howell To: devel@edk2.groups.io Cc: Stacy Howell , Dandan Bi , Liming Gao Subject: [edk2-devel] [PATCH] MdeModulePkg\CoreDxe: Allow DXE Drivers to use untested memory Date: Fri, 7 Jan 2022 14:36:12 -0500 Message-Id: <20220107193612.1350-1-stacy.howell@intel.com> 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,stacy.howell@intel.com X-Gm-Message-State: BrWr6Ry2DaNx9l6MnjPfRYrgx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1641786918; bh=xNN2klHkj+3wKzmCi4joUkfS99f3IwWXSQb7PSzAkog=; h=Cc:Date:From:Reply-To:Subject:To; b=frp1o5HZF7EdllSwTgX6YEA9KGGb23HCr1H7k4jzyD2gDeBn2mhwCr/78xPMDz5NTUH O4sCF/NlZ+UEjswS0qi41duxUqEijYcngNbOgcVLvuwQo6v1kRGyPX5P9Qml1oRIjMti4 Fop02U1pZSAVX06r/fwu+FhAV/B7oj1dj/c= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1641786920521100003 Content-Type: text/plain; charset="utf-8" REF: https://https://bugzilla.tianocore.org/show_bug.cgi?id=3D3795 CC: Dandan Bi CC: Liming Gao Updated CoreInternalAllocatePages() to call PromoteMemoryResource() and re-attempt the allocation if unable to convert the specified memory range Signed-off-by: Stacy Howell --- MdeModulePkg/Core/Dxe/Mem/Page.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/P= age.c index 47d4c5d92e..cc0b90ac0d 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -1417,6 +1417,20 @@ CoreInternalAllocatePages ( Status =3D CoreConvertPages (Start, NumberOfPages, MemoryType); } =20 + if (EFI_ERROR (Status)) { + // + // If requested memory region is unavailable it may be untested memory + // Attempt to promote memory resources, then re-attempt the allocation + // + if (PromoteMemoryResource ()) { + if (NeedGuard) { + Status =3D CoreConvertPagesWithGuard (Start, NumberOfPages, Memory= Type); + } else { + Status =3D CoreConvertPages (Start, NumberOfPages, MemoryType); + } + } + } + Done: CoreReleaseMemoryLock (); =20 --=20 2.32.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 (#85437): https://edk2.groups.io/g/devel/message/85437 Mute This Topic: https://groups.io/mt/88316787/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-