From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web10.54322.1594028629858634529 for ; Mon, 06 Jul 2020 02:43:50 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YJs3mfmH; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594028629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=f0N3HWaF5opN2UphRkxpIyQSEulxz5MhnF+LurNWzok=; b=YJs3mfmHuRKWX2aCTOGQfiDTLa0kSD9d6L8ugEVWWhsTUQHuneVT4xVEENGe/y37RXvd3K hg9e/fkEpftOCQk4R2J4Ct8OZW7KsRYm3EDH0d+eMeqvNHE/jII5N1AKMiOy7H/3q2BW5m +wgG3wuIV3qxnowVVs2LekUPIwROGUo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-162-1n9pIStFNlmh9iApAPq2ug-1; Mon, 06 Jul 2020 05:43:41 -0400 X-MC-Unique: 1n9pIStFNlmh9iApAPq2ug-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ECF3DEC1A0; Mon, 6 Jul 2020 09:43:39 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-114-194.ams2.redhat.com [10.36.114.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id A85BD5C3F8; Mon, 6 Jul 2020 09:43:38 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH] IntelFsp2Pkg/FspSecCore: Use UefiCpuLib. To: devel@edk2.groups.io, chasel.chiu@intel.com, "Dong, Eric" Cc: "Desimone, Nathaniel L" , "Zeng, Star" References: <20200627015132.2652-1-eric.dong@intel.com> From: "Laszlo Ersek" Message-ID: <1dfd54d4-c301-04b1-fb29-4112a5f9bed5@redhat.com> Date: Mon, 6 Jul 2020 11:43:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 06/29/20 02:44, Chiu, Chasel wrote: > > Reviewed-by: Chasel Chiu This was merged as commit 0060e0a694f3f249c3ec081b0e61287c36f64ebb. Laszlo >> -----Original Message----- >> From: Dong, Eric >> Sent: Saturday, June 27, 2020 9:52 AM >> To: devel@edk2.groups.io >> Cc: Chiu, Chasel ; Desimone, Nathaniel L >> ; Zeng, Star >> Subject: [PATCH] IntelFsp2Pkg/FspSecCore: Use UefiCpuLib. >> >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2825 >> >> UefiCpuLib has API InitializeFloatingPointUnits. >> Remove internal copy of InitializeFloatingPointUnits in FspSecCoreM, use >> UefiCpuLib API. >> >> This change also avoid later potential conflict when use UefiCpuLib for >> FspSecCoreM module. >> >> Signed-off-by: Eric Dong >> Cc: Chasel Chiu >> Cc: Nate DeSimone >> Cc: Star Zeng >> --- >> IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf | 3 +- >> IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf | 1 - >> .../FspSecCore/Ia32/InitializeFpu.nasm | 72 ------------------- >> IntelFsp2Pkg/FspSecCore/SecMain.h | 15 +--- >> IntelFsp2Pkg/IntelFsp2Pkg.dsc | 1 + >> 5 files changed, 4 insertions(+), 88 deletions(-) delete mode 100644 >> IntelFsp2Pkg/FspSecCore/Ia32/InitializeFpu.nasm >> >> diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf >> b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf >> index 25f2a109ab..61b7ddca4c 100644 >> --- a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf >> +++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf >> @@ -29,7 +29,6 @@ >> >> [Sources.IA32] >> Ia32/Stack.nasm >> - Ia32/InitializeFpu.nasm >> Ia32/FspApiEntryM.nasm >> Ia32/FspApiEntryCommon.nasm >> Ia32/FspHelper.nasm >> @@ -41,6 +40,7 @@ >> [Packages] >> MdePkg/MdePkg.dec >> IntelFsp2Pkg/IntelFsp2Pkg.dec >> + UefiCpuPkg/UefiCpuPkg.dec >> >> [LibraryClasses] >> BaseMemoryLib >> @@ -51,6 +51,7 @@ >> FspSwitchStackLib >> FspCommonLib >> FspSecPlatformLib >> + UefiCpuLib >> >> [Pcd] >> gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase ## >> CONSUMES >> diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf >> b/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf >> index 971b311e42..664bde5678 100644 >> --- a/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf >> +++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreT.inf >> @@ -25,7 +25,6 @@ >> >> [Sources.IA32] >> Ia32/Stack.nasm >> - Ia32/InitializeFpu.nasm >> Ia32/FspApiEntryT.nasm >> Ia32/FspHelper.nasm >> >> diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/InitializeFpu.nasm >> b/IntelFsp2Pkg/FspSecCore/Ia32/InitializeFpu.nasm >> deleted file mode 100644 >> index ebc91c41e4..0000000000 >> --- a/IntelFsp2Pkg/FspSecCore/Ia32/InitializeFpu.nasm >> +++ /dev/null >> @@ -1,72 +0,0 @@ >> -;------------------------------------------------------------------------------ >> -; >> -; Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved.
-; >> SPDX-License-Identifier: BSD-2-Clause-Patent -; -; Abstract: >> -; >> -;------------------------------------------------------------------------------ >> - >> - >> -SECTION .data >> -; >> -; Float control word initial value: >> -; all exceptions masked, double-precision, round-to-nearest -; >> -ASM_PFX(mFpuControlWord): >> - dw 0x027F >> -; >> -; Multimedia-extensions control word: >> -; all exceptions masked, round-to-nearest, flush to zero for masked >> underflow -; >> -ASM_PFX(mMmxControlWord): >> - dd 0x01F80 >> - >> -SECTION .text >> - >> -; >> -; Initializes floating point units for requirement of UEFI specification. >> -; >> -; This function initializes floating-point control word to 0x027F (all >> exceptions -; masked,double-precision, round-to-nearest) and >> multimedia-extensions control word -; (if supported) to 0x1F80 (all >> exceptions masked, round-to-nearest, flush to zero -; for masked underflow). >> -; >> - >> -global ASM_PFX(InitializeFloatingPointUnits) >> -ASM_PFX(InitializeFloatingPointUnits): >> - >> - >> - push ebx >> - >> - ; >> - ; Initialize floating point units >> - ; >> - finit >> - fldcw [ASM_PFX(mFpuControlWord)] >> - >> - ; >> - ; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to test >> - ; whether the processor supports SSE instruction. >> - ; >> - mov eax, 1 >> - cpuid >> - bt edx, 25 >> - jnc Done >> - >> - ; >> - ; Set OSFXSR bit 9 in CR4 >> - ; >> - mov eax, cr4 >> - or eax, BIT9 >> - mov cr4, eax >> - >> - ; >> - ; The processor should support SSE instruction and we can use >> - ; ldmxcsr instruction >> - ; >> - ldmxcsr [ASM_PFX(mMmxControlWord)] >> -Done: >> - pop ebx >> - >> - ret >> diff --git a/IntelFsp2Pkg/FspSecCore/SecMain.h >> b/IntelFsp2Pkg/FspSecCore/SecMain.h >> index af7f387960..f6333b0ffb 100644 >> --- a/IntelFsp2Pkg/FspSecCore/SecMain.h >> +++ b/IntelFsp2Pkg/FspSecCore/SecMain.h >> @@ -21,6 +21,7 @@ >> #include >> #include >> #include >> +#include >> #include >> >> typedef VOID (*PEI_CORE_ENTRY) ( \ >> @@ -80,20 +81,6 @@ SecTemporaryRamSupport ( >> IN UINTN CopySize >> ); >> >> -/** >> - Initializes floating point units for requirement of UEFI specification. >> - >> - This function initializes floating-point control word to 0x027F (all >> exceptions >> - masked,double-precision, round-to-nearest) and multimedia-extensions >> control word >> - (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush >> to zero >> - for masked underflow). >> - >> -**/ >> -VOID >> -EFIAPI >> -InitializeFloatingPointUnits ( >> - VOID >> - ); >> >> /** >> >> diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dsc b/IntelFsp2Pkg/IntelFsp2Pkg.dsc >> index 26cd3da43c..309411630d 100644 >> --- a/IntelFsp2Pkg/IntelFsp2Pkg.dsc >> +++ b/IntelFsp2Pkg/IntelFsp2Pkg.dsc >> @@ -25,6 +25,7 @@ >> PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf >> IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf >> >> UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDeco >> mpressLib.inf >> + UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf >> >> >> ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRe >> portStatusCodeLibNull.inf >> >> PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformance >> LibNull.inf >> -- >> 2.21.0.windows.1 > > > >