From: "Dhaval Sharma" <dhaval@rivosinc.com>
To: devel@edk2.groups.io
Cc: Guo Dong <guo.dong@intel.com>, Ray Ni <ray.ni@intel.com>,
Sean Rhodes <sean@starlabs.systems>,
James Lu <james.lu@intel.com>, Gua Guo <gua.guo@intel.com>
Subject: [PATCH v1 1/8] UefiPayloadPkg: Remove FP Init from UPL entry
Date: Thu, 11 May 2023 12:42:19 +0530 [thread overview]
Message-ID: <20230511071226.19726-2-dhaval@rivosinc.com> (raw)
In-Reply-To: <20230511071226.19726-1-dhaval@rivosinc.com>
According to UPL spec BL should initialize FP init meaning UPL
does not need to initialize it. Besides this is arch specific init
and needs to be moved out of UPL common flow. In order to not break
current BL implementations, for now just moving the init to later
point of time but for both x32 and x64 eventually this should be
removed once BL impelement this logic.
Test: Verified booting UEFI shell on coreboot on qemu.
Cc: Guo Dong <guo.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Sean Rhodes <sean@starlabs.systems>
Cc: James Lu <james.lu@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
Reviewed-by: Gua Guo <gua.guo@...>
Reviewed-by: James Lu <james.lu@...>
---
Notes:
v3:
- Added FP initialization to X64 path as well
v4:
- Updated reviewed-by tag
UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c | 3 +++
UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 3 ---
UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c | 3 +++
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
index 61a9f01ec9e7..921a38555e21 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
@@ -268,6 +268,9 @@ HandOffToDxeCore (
UINT32 Index;
X64_IDT_TABLE *IdtTableForX64;
+ // Initialize floating point operating environment to be compliant with UEFI spec.
+ InitializeFloatingPointUnits ();
+
//
// Clear page 0 and mark it as allocated if NULL pointer detection is enabled.
//
diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
index f8939efe70db..8aff00142971 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
@@ -473,9 +473,6 @@ _ModuleEntryPoint (
PrintHob (mHobList);
);
- // Initialize floating point operating environment to be compliant with UEFI spec.
- InitializeFloatingPointUnits ();
-
// Build HOB based on information from Bootloader
Status = BuildHobs (BootloaderParameter, &DxeFv);
ASSERT_EFI_ERROR (Status);
diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
index 346e3feb0459..84a6112ce64a 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
@@ -40,6 +40,9 @@ HandOffToDxeCore (
VOID *GhcbBase;
UINTN GhcbSize;
+ // Initialize floating point operating environment to be compliant with UEFI spec.
+ InitializeFloatingPointUnits ();
+
//
// Clear page 0 and mark it as allocated if NULL pointer detection is enabled.
//
--
2.34.1
next prev parent reply other threads:[~2023-05-11 7:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 7:12 DRAFT: [PATCH v1 0/8] RiscV64 Support In UPL Dhaval Sharma
2023-05-11 7:12 ` Dhaval Sharma [this message]
2023-05-11 7:12 ` [PATCH v1 2/8] UefiPayloadPkg: Move INT prog outside common flow Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 3/8] UefiPayloadPkg: Basic Infra To Enable RV64 UPL Support Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 4/8] UefiPayloadPkg: Update input params as per latest UPL spec Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 5/8] UefiPayloadPkg: Hook to parse IN params as per " Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 6/8] UefiPayloadPkg: Add FirmwareContext for RV64 Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 7/8] UefiPayloadPkg: Find DxeFV and create required FV HOB Dhaval Sharma
2023-05-11 7:12 ` [PATCH v1 8/8] UefiPayloadPkg: Add RV64 driver to boot to UEFI Shell Dhaval Sharma
-- strict thread matches above, loose matches on Subject: below --
2023-05-11 7:08 DRAFT: [PATCH v1 0/8] RiscV64 Support In UPL Dhaval Sharma
2023-05-11 7:08 ` [PATCH v1 1/8] UefiPayloadPkg: Remove FP Init from UPL entry Dhaval Sharma
2023-05-11 9:19 ` Guo, Gua
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230511071226.19726-2-dhaval@rivosinc.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox