From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mx.groups.io with SMTP id smtpd.web10.53274.1683789160805337823 for ; Thu, 11 May 2023 00:12:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=rlHYfAuQ; spf=pass (domain: rivosinc.com, ip: 209.85.214.171, mailfrom: dhaval@rivosinc.com) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1aaf91ae451so77448195ad.1 for ; Thu, 11 May 2023 00:12:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1683789160; x=1686381160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vPjOyISSKJJIqB6NDo1d5wnyyOzG0UL8MY1t8gNAIP4=; b=rlHYfAuQxHfDk7nacB31BzL1D6h7EMTonKcK029QuhqkT2g/Nas59lLO6DqEwrE7i0 gtqA70c604TWp+LpnKffqI02AnGcoHVTW1Bi9D4lbmQC8eudZVxHzSC8qeeSMda/JT1i 1M29Oo0Q7OrTKxcPXwjNKGVzTzhJ8kuY4QcO1IWaajy+TzgJXvAFAAKaRiOnHrj4RzfF fLWfMvng5ovTv6kUtarI71uJ/M4gOXtSXWl4/Zm/foYuVT6kWF6vHbqfZpP0oQWGC2RY eWsFO4czkbOJaPJabFT8Z35UJlBBRYg0dMkw/Z0oHBW+PoDTc2MwMooH1wLIUKjrM8M7 c2nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683789160; x=1686381160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vPjOyISSKJJIqB6NDo1d5wnyyOzG0UL8MY1t8gNAIP4=; b=i7cPL+59aDC928Sd+d4k3fyotonMwqquq4T5M20PxYZs16nQg3SNwrYvTnUDt+8vgK 3EOqZvK0YcX5EaAThDoJ5onCPnctWfNOEzMtcYnbZ6qr31Yf+gIrAFLJQ9XG2Tb+ZQbO tNDtCFA3mSHhneTW6W5YMWDZCL7prFy5d9KX4jnXK3BdUDwwIWcMTdPOiKzcgZ22DQAb /CIuQ6450pnvPVrWeHTCtJCS9UMQIrahuOwvTI0Mz+RAF9bOCROPyj3e25PDW1/i3bzj iaLG3L573EuONmnaS6LwWRpqORV/4I0mAiUf4cHcbPJldhSf37lDcq1DeufP331Q5hMG 7W2g== X-Gm-Message-State: AC+VfDx7h6CnIRh7LS6WcshgJ6FnU3zzhQpahxeqP+A4OK4GHZ5jlfa7 GArdP1YmkJS8dKHmVjOKDphlJgIug3aTZK3TAao= X-Google-Smtp-Source: ACHHUZ54hgU7BAI47BUMyinDUQDpj43KWjrs0idSl8A89yX9xfyY+mqUqUgBYaWCyoL7xapq7XhpJg== X-Received: by 2002:a17:902:d68b:b0:1ab:7fb:aac1 with SMTP id v11-20020a170902d68b00b001ab07fbaac1mr20824817ply.24.1683789160102; Thu, 11 May 2023 00:12:40 -0700 (PDT) Return-Path: Received: from dhaval.. ([42.106.13.180]) by smtp.gmail.com with ESMTPSA id w20-20020a1709029a9400b001a9884c02e3sm5111214plp.10.2023.05.11.00.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 00:12:39 -0700 (PDT) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Guo Dong , Ray Ni , Sean Rhodes , James Lu , Gua Guo Subject: [PATCH v1 1/8] UefiPayloadPkg: Remove FP Init from UPL entry Date: Thu, 11 May 2023 12:42:19 +0530 Message-Id: <20230511071226.19726-2-dhaval@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230511071226.19726-1-dhaval@rivosinc.com> References: <20230511071226.19726-1-dhaval@rivosinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 Reviewed-by: Gua Guo Reviewed-by: 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/UefiPaylo= adPkg/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;=0D X64_IDT_TABLE *IdtTableForX64;=0D =0D + // Initialize floating point operating environment to be compliant with = UEFI spec.=0D + InitializeFloatingPointUnits ();=0D +=0D //=0D // Clear page 0 and mark it as allocated if NULL pointer detection is en= abled.=0D //=0D diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c b/Uefi= PayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c index f8939efe70db..8aff00142971 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c @@ -473,9 +473,6 @@ _ModuleEntryPoint ( PrintHob (mHobList);=0D );=0D =0D - // Initialize floating point operating environment to be compliant with = UEFI spec.=0D - InitializeFloatingPointUnits ();=0D -=0D // Build HOB based on information from Bootloader=0D Status =3D BuildHobs (BootloaderParameter, &DxeFv);=0D ASSERT_EFI_ERROR (Status);=0D 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;=0D UINTN GhcbSize;=0D =0D + // Initialize floating point operating environment to be compliant with = UEFI spec.=0D + InitializeFloatingPointUnits ();=0D +=0D //=0D // Clear page 0 and mark it as allocated if NULL pointer detection is en= abled.=0D //=0D --=20 2.34.1