From nobody Tue Feb 10 01:34:37 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1526998156019887.1784847654609; Tue, 22 May 2018 07:09:16 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id CBE35203BBB81; Tue, 22 May 2018 07:09:10 -0700 (PDT) Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 310C1203BA517 for ; Tue, 22 May 2018 07:09:09 -0700 (PDT) Received: by mail-wr0-x243.google.com with SMTP id i12-v6so7289949wrc.4 for ; Tue, 22 May 2018 07:09:09 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:3995:5470:200:1aff:fe1b:b328]) by smtp.gmail.com with ESMTPSA id r6-v6sm17755545wrg.73.2018.05.22.07.09.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 07:09:07 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::243; helo=mail-wr0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qTkV/oPWWertT8HQ/H30NgTe8FFSj3CzCejtUi6pTds=; b=A7JxjQFszCvmLGll3UHVW+RU5LJx9zHfOXjD8hfNV91ysQffQyp+mfOTSS4wvjh1mn 2NOSWpjOnDXSst4dVU6Be7kQqQWX8phrbrzB0JMGVDroqDyWUHL/uhtY4S2rFnFeixsV xom0WNAALTZ2YvCdUACExPWDGYa5nmIyaYfag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qTkV/oPWWertT8HQ/H30NgTe8FFSj3CzCejtUi6pTds=; b=cb+tCZXK+0Gp6/ntmor++pGCa4Dn8rNG/wemoHraPaHRKt7WSw8W1Jzthm6HvEg8HT kDjGQvq1YrX1fauQjVATzsfNR6Hawo9TZYWBoXYHq03UJhcarW9HvQCVsLyjqCysDClQ rGGCjkxcteETCoCoeNlKvYydIFeO3+ky+NJ4s/Z0g7tk9RRIEVsHky4CfSuMkAVQuPqs MGh7RQ4lIQpD6FTOeK3K8vs91uaMrI2Qfdbng3gYgF3gnoTRehykoodJ0eqD6J8Yyjto Yi1UE8GzZGpOOxo1XiQ18Y4geyBILhIEDfKMCZD4yZvjmxRvTOZz9iwccbbTtV7/9uS2 QtVg== X-Gm-Message-State: ALKqPwdiUwbniNC3HJp84HpOHd0c1I7+XJqw7U3QrOsX1MRwQ66S5tyn x5peUIZKW+9bIPFtV03nZqDMn0hFrgw= X-Google-Smtp-Source: AB8JxZoiwg5U4Y90KH1r9FFtwNc31JIIkEim5g4wuOe6Fa1lcwxI0rbKf/l9iGsGnXVb+9f14JJ7ZA== X-Received: by 2002:adf:9301:: with SMTP id 1-v6mr5015571wro.175.1526998147587; Tue, 22 May 2018 07:09:07 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Tue, 22 May 2018 16:08:49 +0200 Message-Id: <20180522140850.30369-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180522140850.30369-1-ard.biesheuvel@linaro.org> References: <20180522140850.30369-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 5/6] MdeModulePkg/DxeCorePerformanceLib: use EfiAllocatePeiAccessiblePages X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Dong , Ard Biesheuvel , Liming Gao , Dandan Bi , Leif Lindholm , Michael D Kinney , Laszlo Ersek , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Replace the call to and implementation of the function FpdtAllocateReservedMemoryBelow4G() with a call to EfiAllocatePeiAccessiblePages, which boils down to the same on X64, but does not crash non-X64 systems that lack memory below 4 GB. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c | 45 ++= ------------------ 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceL= ib.c b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c index 71d624fc9ce9..301ea4c32a78 100644 --- a/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c +++ b/MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.c @@ -165,46 +165,6 @@ IsKnownID ( } } =20 -/** - Allocate EfiReservedMemoryType below 4G memory address. - - This function allocates EfiReservedMemoryType below 4G memory address. - - @param[in] Size Size of memory to allocate. - - @return Allocated address for output. - -**/ -VOID * -FpdtAllocateReservedMemoryBelow4G ( - IN UINTN Size - ) -{ - UINTN Pages; - EFI_PHYSICAL_ADDRESS Address; - EFI_STATUS Status; - VOID *Buffer; - - Buffer =3D NULL; - Pages =3D EFI_SIZE_TO_PAGES (Size); - Address =3D 0xffffffff; - - Status =3D gBS->AllocatePages ( - AllocateMaxAddress, - EfiReservedMemoryType, - Pages, - &Address - ); - ASSERT_EFI_ERROR (Status); - - if (!EFI_ERROR (Status)) { - Buffer =3D (VOID *) (UINTN) Address; - ZeroMem (Buffer, Size); - } - - return Buffer; -} - /** Allocate buffer for Boot Performance table. =20 @@ -348,7 +308,10 @@ AllocateBootPerformanceTable ( // // Fail to allocate at specified address, continue to allocate at any = address. // - mAcpiBootPerformanceTable =3D (BOOT_PERFORMANCE_TABLE *) FpdtAllocateR= eservedMemoryBelow4G (BootPerformanceDataSize); + mAcpiBootPerformanceTable =3D (BOOT_PERFORMANCE_TABLE *) EfiAllocatePe= iAccessiblePages ( + EfiReservedMe= moryType, + EFI_SIZE_TO_P= AGES (BootPerformanceDataSize) + ); } DEBUG ((DEBUG_INFO, "DxeCorePerformanceLib: ACPI Boot Performance Table = address =3D 0x%x\n", mAcpiBootPerformanceTable)); =20 --=20 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel