[edk2-devel] [PATCH v3 2/2] UefiPayloadPkg: Move INT prog outside common flow

Guo, Gua gua.guo at intel.com
Thu Mar 9 11:48:18 UTC 2023


Reviewed-by: Gua Guo <gua.guo at intel.com> 

-----Original Message-----
From: Dhaval Sharma <dhaval at rivosinc.com> 
Sent: Thursday, March 9, 2023 6:37 PM
To: devel at edk2.groups.io
Cc: Dong, Guo <guo.dong at intel.com>; Ni, Ray <ray.ni at intel.com>; Sean Rhodes <sean at starlabs.systems>; Lu, James <james.lu at intel.com>; Guo, Gua <gua.guo at intel.com>
Subject: [PATCH v3 2/2] UefiPayloadPkg: Move INT prog outside common flow

8259 is very arch specific programming. It needs to be moved out to the respective arch flow. Added in both x64 and x32 paths

Test: Able to boot UEFI shell with Coreboot Tianocore payload on
x86 qemu

Cc: Guo Dong <guo.dong at intel.com>
Cc: Ray Ni <ray.ni at intel.com>
Cc: Sean Rhodes <sean at starlabs.systems>
Cc: James Lu <james.lu at intel.com>
Cc: Gua Guo <gua.guo at intel.com>

Signed-off-by: Dhaval Sharma <dhaval at rivosinc.com>
---

Notes:
    v3:
    - Added legacy INT intialization to X64 path as well

 UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c      | 6 ++++++
 UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 6 ------
 UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c       | 6 ++++++
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
index 9d2bfb2fa654..d41e5024b4a1 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c
@@ -271,6 +271,12 @@ HandOffToDxeCore (
   // Initialize floating point operating environment to be compliant with UEFI spec.   InitializeFloatingPointUnits (); +  //+  // Mask off all legacy 8259 interrupt sources+  //+  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);+  IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);+   //   // 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 07f4c1d29686..45127689a24b 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c
@@ -478,12 +478,6 @@ _ModuleEntryPoint (
   Status = UniversalLoadDxeCore (DxeFv, &DxeCoreEntryPoint);   ASSERT_EFI_ERROR (Status); -  //-  // Mask off all legacy 8259 interrupt sources-  //-  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);-  IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);-   Hob.HandoffInformationTable = (EFI_HOB_HANDOFF_INFO_TABLE *)GetFirstHob (EFI_HOB_TYPE_HANDOFF);   HandOffToDxeCore (DxeCoreEntryPoint, Hob); diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
index 84a6112ce64a..1dfb7459e85a 100644
--- a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
+++ b/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c
@@ -43,6 +43,12 @@ HandOffToDxeCore (
   // Initialize floating point operating environment to be compliant with UEFI spec.   InitializeFloatingPointUnits (); +  //+  // Mask off all legacy 8259 interrupt sources+  //+  IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF);+  IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF);+   //   // Clear page 0 and mark it as allocated if NULL pointer detection is enabled.   //-- 
2.40.0.rc0.57.g454dfcbddf



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100944): https://edk2.groups.io/g/devel/message/100944
Mute This Topic: https://groups.io/mt/97493284/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list