From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=DaSHdJU+; spf=pass (domain: rivosinc.com, ip: 209.85.216.53, mailfrom: dhaval@rivosinc.com) Received: by mail-pj1-f53.google.com with SMTP id y2so1686925pjg.3 for ; Thu, 09 Mar 2023 02:37:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1678358248; 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=1AQJmhBYnL2LM1JO+KZ+58adiUpv28KfoHzowkcifsE=; b=DaSHdJU+lxWll5wCmlfmxvoch9ngpLnH3F4UjKXdtxQoriwaUund4i8qZDtD+hi7uJ o48Sz0r6BbLGrOULDQy2AlqSY+Hrr+a4OXdILoxxYn7Gpf7FvOhiAb31tsBOoszw3vfm QQYve3nQhm3RGKKztxzwphcCAM5mqOydrTVpxdb7XxSWOTR7/ZalX9t0cz2hFefJCYSE gDS/zS9J3eiF+n3OW67JRqBM5oDOp1HNGoujUUTVxAh1UsMTk3jw9wrm1fXE4shOLnk+ r+lBivN4RFo2hZxyUrqVTK/DUAvx02FmFa2s5UZArENoN7i7pTB1rw1mnKpLet747lU4 GeuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678358248; 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=1AQJmhBYnL2LM1JO+KZ+58adiUpv28KfoHzowkcifsE=; b=WxnG8+wg9RqVc4eHGmaatYN8w1/Syym58ShTdh8J4MENr+1K7dszN2CUqx3EUKmQcV H03NRW7747wP9RPdBK0A1hD+D6+G4YTkSdzw1hTh/xp4lF0B2qcBBYiAAU04UCFD/n9E kc08Edp1zQvo94iyxOKDckSPtPMhP4Y3J5CPnCXNf+ZsHDpiuDcSe/bmuki6KVLlZYv5 OUwT1aA+9xkcl2vd6S8hLvz4aB03Hsfr6cKmPbLp78pKYbEXjRvkXrHFbocT7BaY6Dpv EHQ4XzncMKofyzMlzlRO4tySYTfteSFe+sSJMIqUfgIyuUYU/N16NO+WR78fgSV5b2nA u/4A== X-Gm-Message-State: AO0yUKVuUcdvabY3/YC9wUnRKrO/uNZERWfZyA2xEfks9uHuVErVvnw5 cbk/IUWlHI+4x49Ya6EabAk1puxfoe8Zttmb/6fJi4o2 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) Return-Path: 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: [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> X-Mailer: git-send-email 2.40.0.rc0.57.g454dfcbddf In-Reply-To: <20230309103721.1869468-1-dhaval@rivosinc.com> References: <20230309103721.1869468-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 --- 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;=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 46ee27c905e9..07f4c1d29686 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c @@ -470,9 +470,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.40.0.rc0.57.g454dfcbddf