From nobody Thu Apr 25 16:07:30 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+101526+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+101526+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1679444066; cv=none; d=zohomail.com; s=zohoarc; b=Y9QwBnOoRHLiHDBoSqLL4gMVJAbyPqmgYElXT8nCaijf0sSusehOot07edo9xpk+l8svdOl2nrNTHcb2Dz/ncHMzSx2R2TxCct4aftMpcU7k0HOiugkxTkkD62DvoSQ3jOgmu/Hr3Zyj49MW3E53dSsorjvG3Sov5/wSuSJFehA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1679444066; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=V6B5sZZz34bw/HGsNMDhxgAy8xGlwer2hHVnMYnlsSA=; b=WAU4Xg5xJCoholUh0buTLZqACgQ+Irgzp9XSpaMd7e3bHB51oeTd6oYlstVAbN1i+c7WkHKOxZ59CVHWTx8CIGo2x6ZtFnRWd0uUzF3QCnuux91eZPZOyW3W7rL/+hTpmyILnOTpBGQHC4+xwyI7LwxTKwE5XCSqNmARm6cWK+k= 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+101526+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 167944406632560.34031022340457; Tue, 21 Mar 2023 17:14:26 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id wSIqYY1788612xX3WW4d2cZP; Tue, 21 Mar 2023 17:14:26 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.31182.1679444065094139741 for ; Tue, 21 Mar 2023 17:14:25 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="403974442" X-IronPort-AV: E=Sophos;i="5.98,280,1673942400"; d="scan'208";a="403974442" X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 17:14:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10656"; a="750845789" X-IronPort-AV: E=Sophos;i="5.98,280,1673942400"; d="scan'208";a="750845789" X-Received: from cchiu4-mobl.gar.corp.intel.com ([10.212.161.114]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Mar 2023 17:14:23 -0700 From: "Chiu, Chasel" To: devel@edk2.groups.io Cc: Chasel Chiu , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH v3] IntelFsp2Pkg: Fix NASM X64 build warnings. Date: Tue, 21 Mar 2023 17:14:12 -0700 Message-Id: <20230322001412.549-1-chasel.chiu@intel.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,chasel.chiu@intel.com X-Gm-Message-State: NLPFWedTP8j2qSXK0yce5EKqx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1679444066; bh=CYvfM27EQSle+2fbvGhmD8rhHXLmyqrGT8W/0rFTHEc=; h=Cc:Date:From:Reply-To:Subject:To; b=aen59jYDrWE/o9kriIcnDh1ZVcdl08KjNJyOnc6tUAauU4uwPOyf2VnVlQHwGd6BoTT adxnfn30YdwpprzYX7MSBa12gbfuPD0lt1DkpouwVa93OYrCOiOnfhWQJbIU3LYA/BiFv Pg1WFPCEB91KMBsCmpHgBATFRYRyMkHLysY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1679444068198100002 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4377 Fix below warnings generated by NASM X64 build: /X64/FspHelper.iii:26: warning: signed dword value exceeds bounds /X64/FspHelper.iii:35: warning: signed dword value exceeds bounds /X64/FspApiEntryT.iii:320: warning: dword data exceeds bounds Also replaced "cmp reg, 0" with "test reg, reg" per optimization suggestion. Cc: Nate DeSimone Cc: Star Zeng Signed-off-by: Chasel Chiu Reviewed-by: Nate DeSimone --- IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm | 18 +++++++++--------- IntelFsp2Pkg/FspSecCore/X64/FspHelper.nasm | 2 -- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm b/IntelFsp2Pkg/F= spSecCore/X64/FspApiEntryT.nasm index cdebe90fab..b32fa32a89 100644 --- a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm +++ b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm @@ -135,9 +135,9 @@ ASM_PFX(LoadMicrocodeDefault): ; LOAD_RBP =20 - cmp rsp, 0 + test rsp, rsp jz ParamError - cmp rcx, 0 + test rcx, rcx jz ParamError mov rsp, rcx =20 @@ -151,13 +151,13 @@ ASM_PFX(LoadMicrocodeDefault): =20 ; UPD structure is compliant with FSP spec 2.4 mov rax, qword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeSize] - cmp rax, 0 + test rax, rax jz Exit2 cmp rax, 0800h jl ParamError =20 mov rsi, qword [rsp + LoadMicrocodeParamsFsp24.MicrocodeCodeAddr] - cmp rsi, 0 + test rsi, rsi jnz CheckMainHeader =20 ParamError: @@ -315,9 +315,9 @@ Done: mov ecx, MSR_IA32_BIOS_SIGN_ID rdmsr ; Get current microcode signature xor eax, eax - cmp edx, 0 + test edx, edx jnz Exit2 - mov eax, 0800000000000000Eh + mov rax, 0800000000000000Eh =20 Exit2: jmp rbp @@ -464,7 +464,7 @@ ParamValid: ; Sec Platform Init ; CALL_YMM ASM_PFX(SecPlatformInit) - cmp eax, 0 + test rax, rax jnz TempRamInitExit =20 ; Load microcode @@ -476,12 +476,12 @@ ParamValid: ; Call Sec CAR Init LOAD_RCX CALL_YMM ASM_PFX(SecCarInit) - cmp rax, 0 + test rax, rax jnz TempRamInitExit =20 LOAD_RCX CALL_YMM ASM_PFX(EstablishStackFsp) - cmp rax, 0 + test rax, rax jnz TempRamInitExit =20 LOAD_UCODE_STATUS rax ; Restore microcode status if no CAR i= nit error from SLOT 0 in YMM9 (upper 128bits). diff --git a/IntelFsp2Pkg/FspSecCore/X64/FspHelper.nasm b/IntelFsp2Pkg/FspS= ecCore/X64/FspHelper.nasm index 71624a3aad..32a60270b8 100644 --- a/IntelFsp2Pkg/FspSecCore/X64/FspHelper.nasm +++ b/IntelFsp2Pkg/FspSecCore/X64/FspHelper.nasm @@ -23,7 +23,6 @@ ASM_PFX(AsmGetFspInfoHeader): global ASM_PFX(FspInfoHeaderRelativeOff) ASM_PFX(FspInfoHeaderRelativeOff): DD 0x12345678 ; This value must be patched by the buil= d script - and rax, 0xffffffff ret =20 global ASM_PFX(AsmGetFspInfoHeaderNoStack) @@ -32,5 +31,4 @@ ASM_PFX(AsmGetFspInfoHeaderNoStack): lea rcx, [ASM_PFX(FspInfoHeaderRelativeOff)] mov ecx, [rcx] sub rax, rcx - and rax, 0xffffffff jmp rdi --=20 2.35.0.windows.1 -=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 (#101526): https://edk2.groups.io/g/devel/message/101526 Mute This Topic: https://groups.io/mt/97768328/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-