public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Lu, James" <james.lu@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"dhaval@rivosinc.com" <dhaval@rivosinc.com>
Cc: "Dong, Guo" <guo.dong@intel.com>, "Ni, Ray" <ray.ni@intel.com>,
	"Rhodes, Sean" <sean@starlabs.systems>,
	"Guo, Gua" <gua.guo@intel.com>
Subject: Re: [edk2-devel] [PATCH v4 2/2] UefiPayloadPkg: Move INT prog outside common flow
Date: Mon, 1 May 2023 01:19:28 +0000	[thread overview]
Message-ID: <CH3PR11MB78191FF26C24EC824AEE3515886E9@CH3PR11MB7819.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20230315121913.119025-3-dhaval@rivosinc.com>

Reviewed-by: James Lu <james.lu@intel.com>


Thanks,
James

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Dhaval Sharma
Sent: Wednesday, March 15, 2023 8:19 PM
To: devel@edk2.groups.io
Cc: Dong, Guo <guo.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Rhodes, Sean <sean@starlabs.systems>; Lu, James <james.lu@intel.com>; Guo, Gua <gua.guo@intel.com>
Subject: [edk2-devel] [PATCH v4 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@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@intel.com>
---

Notes:
    v3:
    - Added legacy INT intialization to X64 path as well
    v4:
    - Updated reviewed-by tag

 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







  reply	other threads:[~2023-05-01  1:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-15 12:19 [PATCH v4 0/2] Upl remove arch spec initialization Dhaval Sharma
2023-03-15 12:19 ` [PATCH v4 1/2] UefiPayloadPkg: Remove FP Init from UPL entry Dhaval Sharma
2023-05-01  1:19   ` [edk2-devel] " Lu, James
2023-03-15 12:19 ` [PATCH v4 2/2] UefiPayloadPkg: Move INT prog outside common flow Dhaval Sharma
2023-05-01  1:19   ` Lu, James [this message]
2023-03-26 17:12 ` [edk2-devel] [PATCH v4 0/2] Upl remove arch spec initialization Dhaval Sharma

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=CH3PR11MB78191FF26C24EC824AEE3515886E9@CH3PR11MB7819.namprd11.prod.outlook.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