From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mx.groups.io with SMTP id smtpd.web11.52935.1683788987258677265 for ; Thu, 11 May 2023 00:09:47 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=RTam6vJ3; spf=pass (domain: rivosinc.com, ip: 209.85.210.180, mailfrom: dhaval@rivosinc.com) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6438d95f447so5754833b3a.3 for ; Thu, 11 May 2023 00:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1683788986; x=1686380986; 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=RTam6vJ3xiNTV+//+s3JgvjDPc++gaEYRklWwazKrRgN69NZDo5F36M2uiztFmD2qU vxtCYHvDHhkVGVLPhvoz0NuN9/qIhr1C87xb7QujjuPsj95owX7NNcMKA9GOZohEdpkB NUmvpk0Tqn3jnsiqet3EOwnd7QXSfOBZyQ5TjcF1MoGYuoK/YBMaae2/n9/TiehWQAne UUdlWIvr73teSBxA+801xjK4GvVxSYpi6Z1ceB+TMzYbjC0xeiUu3tvQLb1ftewkWYw6 J7tq8QEgQsPOv84O2T2Jl8qFIF8t8yvuJvArCO0G2hQs+zGFyKF8sRpvIJxpjSloDc7t itdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683788986; x=1686380986; 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=jPKoUZ+6YPhAuzOo+EKvzeeKsAfZSJwa0lvdeLX6sJtttFHzimD9MK0QXjWPMUSVZB bA9ea1gPyTZFe7RhSpHwr7Qq6S8dS0X81pC9RAjfaw6IwZhiDufEWr754+k+LDJzRg/X 5/VAPgHk0neOTzgBobxmr/AHMmmTmxY1eFzW/wG1c8fhY7/qIHMLhZWyUN2vii5EOsae GHLAwEIJsblS6MDT+B/ircmWGpw76801lsnJ1jFs1lRytkkA4My1w1g55yAmnhs6WiJQ ih125nAbGXYUDX4PhhbDLzwK9y/wwm/WaIWZkbn/W2d0datXtAbt94JFOZfgsAntGEFE OUWA== X-Gm-Message-State: AC+VfDzgNsNFthSiWpE9mcn1cM1sTWZJpHhaJalkqs9S6hc/np/vcUhk jppd3vZAga11Cex+WxZpzG+5A6KcUloKt652bpA= X-Google-Smtp-Source: ACHHUZ7jn3LYgms548GZ52f8pQOjLCg1fUhdgsQD3uIPSOFpo6R/jJ4p+pSSLRA6rPIz/V4M6/+V3w== X-Received: by 2002:a05:6a21:8dc5:b0:fc:7650:1064 with SMTP id ti5-20020a056a218dc500b000fc76501064mr20748221pzb.48.1683788986532; Thu, 11 May 2023 00:09:46 -0700 (PDT) Return-Path: Received: from dhaval.. ([2401:4900:16aa:6ec2:1788:6326:c9bd:29bc]) by smtp.gmail.com with ESMTPSA id k13-20020aa792cd000000b0063f1430dd57sm4592947pfa.49.2023.05.11.00.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 May 2023 00:09:46 -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:38:48 +0530 Message-Id: <20230511070855.19329-2-dhaval@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230511070855.19329-1-dhaval@rivosinc.com> References: <20230511070855.19329-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