From nobody Fri Apr 19 13:43:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+100927+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100927+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1678358250; cv=none; d=zohomail.com; s=zohoarc; b=GZ63+5k9QMoLAs8/28YLzfTrZ4IBmWgEaa2ulVJ223fe7I/tpD0XOJOy+WZ04Y1qry5s3367aCqFYt+JLJ6wV6BqbmibMuONuQGjiRxILEiyZDMoh8pR5hovr8VCfHWPCGg7q7Uji+2Jt/n9eKuHADxGfarFeBlVWa2ovgTYJog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678358250; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=m3iw/aK9aYhLMpgqK0bhSrofpUYH8EyisFGq5pF1CIM=; b=buIg7h1RSRvYOTr/xs46p/emroNYmiTeyqSzHB/F1lB+CAVYgNrP3LlzzwwrctMjUKe7YVvShcGS4qwPHT1WdjBGA29iLb9yNTh+A0X3BXrqFcFR9+bFezQMB8cblh4q9VMHtyTiIdmuISYwIULb3YPdLOirWhCwJopCRA61hwo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100927+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1678358250588945.3905528872781; Thu, 9 Mar 2023 02:37:30 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2KuBYY1788612xfEjioK2MUj; Thu, 09 Mar 2023 02:37:30 -0800 X-Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mx.groups.io with SMTP id smtpd.web10.10186.1678358249499142792 for ; Thu, 09 Mar 2023 02:37:29 -0800 X-Received: by mail-pj1-f53.google.com with SMTP id y2so1686925pjg.3 for ; Thu, 09 Mar 2023 02:37:29 -0800 (PST) X-Gm-Message-State: 3JM4RDuNZaaYFlCw4PwLdmmYx1787277AA= X-Google-Smtp-Source: AK7set9ykXn0JnEXWTyw4cevlcdlBr2R5FMLMxF+4rOoqeFXceMCoO5QL0VIeUvsqRrNzXASGq0vwQ== X-Received: by 2002:a17:90a:e7c5:b0:229:9aac:abb6 with SMTP id kb5-20020a17090ae7c500b002299aacabb6mr707007pjb.47.1678358248721; Thu, 09 Mar 2023 02:37:28 -0800 (PST) X-Received: from dhaval.. ([171.76.81.12]) by smtp.gmail.com with ESMTPSA id nm19-20020a17090b19d300b002340f58e19bsm1293374pjb.45.2023.03.09.02.37.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 02:37:28 -0800 (PST) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo Subject: [edk2-devel] [PATCH v3 1/2] UefiPayloadPkg: Remove FP Init from UPL entry Date: Thu, 9 Mar 2023 16:07:20 +0530 Message-Id: <20230309103721.1869468-2-dhaval@rivosinc.com> In-Reply-To: <20230309103721.1869468-1-dhaval@rivosinc.com> References: <20230309103721.1869468-1-dhaval@rivosinc.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dhaval@rivosinc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1678358250; bh=6inXDvOiW72EkcAMg9LGhj3b1QquNR7yC23EIjrWz38=; h=Cc:Date:From:Reply-To:Subject:To; b=KCi8bsMUFvULoZu8FqRjdo3ghFtJoEok2of0NocxcipXjnse1f6h37rteVtWC+501jO DGtaLC+zp5CDuk9zP4seYpqB03FaGvvM2p7bFN4bsG70wdSpg9oc0rX8spqqET/Kv+iXz faYruNb5A3BKoHrVPMfDitpuNi7YnwO2joo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1678358251615100005 Content-Type: text/plain; charset="utf-8" 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 Cc: Ray Ni Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Signed-off-by: Dhaval Sharma --- Notes: v3: - Added FP initialization to X64 path as well 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/UefiPaylo= adPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c index c66e56aee15a..9d2bfb2fa654 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c +++ b/UefiPayloadPkg/UefiPayloadEntry/Ia32/DxeLoadFunc.c @@ -268,6 +268,9 @@ HandOffToDxeCore ( UINT32 Index; X64_IDT_TABLE *IdtTableForX64; =20 + // 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 en= abled. // diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c b/Uefi= PayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c index 46ee27c905e9..07f4c1d29686 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c @@ -470,9 +470,6 @@ _ModuleEntryPoint ( PrintHob (mHobList); ); =20 - // Initialize floating point operating environment to be compliant with = UEFI spec. - InitializeFloatingPointUnits (); - // Build HOB based on information from Bootloader Status =3D BuildHobs (BootloaderParameter, &DxeFv); ASSERT_EFI_ERROR (Status); diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c b/UefiPayloa= dPkg/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; =20 + // 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 en= abled. // --=20 2.40.0.rc0.57.g454dfcbddf -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#100927): https://edk2.groups.io/g/devel/message/100927 Mute This Topic: https://groups.io/mt/97493283/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri Apr 19 13:43:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+100928+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100928+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1678358253; cv=none; d=zohomail.com; s=zohoarc; b=njwaiRQ7Du827r6uQBpaTRqOCFo+1pk993Ww7VrtwOs1NOVB2d4K3FIIQhm5mBD+diHvf8Ro0063sfj/Za8Jd3bRLaOrjsMvzAys2nLKPrwbU6agtI/bQYKVhZ2XHkbClqfFCXnaeRxpkzN2CCj6S92gyGssE0R+4/1FuTvCJg4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678358253; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=covccKyQe/+eOAT362434FoTgUZlv0gg8WRAv5w3bNk=; b=VcYDdN7gc/E1d5fv+UHADuN2LhMqjN9jthULvibRQ2ZDDQ37i+ipCvd8arHCQ8ZUixyqnnL+fsuEx1Wf9otRQwTRdAj1RcUmm+D4zTvjnEi40s5I9snokcNWYENCGeGVLucujY1e42BigJzF8S522JHoNSDhXPx/GKjfNFVYsyc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+100928+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 167835825350129.980856443932794; Thu, 9 Mar 2023 02:37:33 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id gdUmYY1788612xweZmzgq6BS; Thu, 09 Mar 2023 02:37:33 -0800 X-Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mx.groups.io with SMTP id smtpd.web11.10128.1678358252291688826 for ; Thu, 09 Mar 2023 02:37:32 -0800 X-Received: by mail-pl1-f182.google.com with SMTP id i10so1482463plr.9 for ; Thu, 09 Mar 2023 02:37:32 -0800 (PST) X-Gm-Message-State: Sxivcjp36IP1m5GCtV65OFrAx1787277AA= X-Google-Smtp-Source: AK7set/Ol88BDhtiR0J7I4c2dAtYomDzCIAqDA/hUYfCNKQH45FFUdHZWTWtJ0mbvNrm0O902tZvuQ== X-Received: by 2002:a17:90a:190f:b0:237:d867:2260 with SMTP id 15-20020a17090a190f00b00237d8672260mr26340167pjg.4.1678358251581; Thu, 09 Mar 2023 02:37:31 -0800 (PST) X-Received: from dhaval.. ([171.76.81.12]) by smtp.gmail.com with ESMTPSA id nm19-20020a17090b19d300b002340f58e19bsm1293374pjb.45.2023.03.09.02.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 02:37:31 -0800 (PST) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo Subject: [edk2-devel] [PATCH v3 2/2] UefiPayloadPkg: Move INT prog outside common flow Date: Thu, 9 Mar 2023 16:07:21 +0530 Message-Id: <20230309103721.1869468-3-dhaval@rivosinc.com> In-Reply-To: <20230309103721.1869468-1-dhaval@rivosinc.com> References: <20230309103721.1869468-1-dhaval@rivosinc.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dhaval@rivosinc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1678358253; bh=slNzK/njgg+GYqDoqSJUoEffpcp96lo6hKNMdLrBYSw=; h=Cc:Date:From:Reply-To:Subject:To; b=cx7qd9oIUOHrmmUKhd5g+gCDS7r0Xf1gK72r2qXyM8vpD9MSibuxGnuo34ZbLpAoZK8 VlHAg36Vro/vwUowJrX3hAhmAcMyWPsfBBaT+Vs8witzLKTCNOfnWmLXFmXUZgaJf0WrL 6G5TuIZoUFDAU1NMiy2AKYPh3IpJYairgbI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1678358255670100001 Content-Type: text/plain; charset="utf-8" 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 Cc: Ray Ni Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Signed-off-by: Dhaval Sharma Reviewed-by: Gua Guo =20 --- 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/UefiPaylo= adPkg/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 (); =20 + // + // 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 en= abled. // diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c b/Uefi= PayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c index 07f4c1d29686..45127689a24b 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c @@ -478,12 +478,6 @@ _ModuleEntryPoint ( Status =3D UniversalLoadDxeCore (DxeFv, &DxeCoreEntryPoint); ASSERT_EFI_ERROR (Status); =20 - // - // Mask off all legacy 8259 interrupt sources - // - IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF); - IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF); - Hob.HandoffInformationTable =3D (EFI_HOB_HANDOFF_INFO_TABLE *)GetFirstHo= b (EFI_HOB_TYPE_HANDOFF); HandOffToDxeCore (DxeCoreEntryPoint, Hob); =20 diff --git a/UefiPayloadPkg/UefiPayloadEntry/X64/DxeLoadFunc.c b/UefiPayloa= dPkg/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 (); =20 + // + // 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 en= abled. // --=20 2.40.0.rc0.57.g454dfcbddf -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#100928): https://edk2.groups.io/g/devel/message/100928 Mute This Topic: https://groups.io/mt/97493284/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-