From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web08.5878.1652431020116537295 for ; Fri, 13 May 2022 01:37:00 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NQ7V2OcN; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: chasel.chiu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652431020; x=1683967020; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=2EQeg0n0fOHy4RNNFVhf6jUrOFijZiB4jaRVUFygpA0=; b=NQ7V2OcNWj6U7G6veTzB+k2t+hEeTjBweRXl3xVj7IGWZ7WWRXQ1qG3V BesCqygpVigsocvq0oiPXGPcszJGmMegqVD3heDncmJNaJm2TCnI1/y0Q Ki+zT+95D/hesWNL7W7oB33Kl4EVWXEwTY4EahGKIDnQpiIer4IkaXmYl bCYOT1wzgsyusD0/UaDaryNzrWjYly8Umz8yppgxL31764yZOz/KOmfN6 Dm7a2dGcKEHQiFGjvHRz0XcoGaglJYcziv6JpMv0w36C3EyVKaqCSr3jl wPqm8WQ7167flZCUyNnWUMLLVZsOtkUCI6lrfJkjYnKy3t54z7GlTrHww w==; X-IronPort-AV: E=McAfee;i="6400,9594,10345"; a="356680757" X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="356680757" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 01:36:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,221,1647327600"; d="scan'208";a="712310401" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga001.fm.intel.com with ESMTP; 13 May 2022 01:36:57 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 13 May 2022 01:36:57 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Fri, 13 May 2022 01:36:57 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.109) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Fri, 13 May 2022 01:36:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dmx2BCM3YfI5O5/YKznTc2RouI8gUpKFrcd1HbCz1gUw6KiNkRSlap8TrhrTSrtKEoC3XhLL3VA5NZm8pkoihR+BeZSZyFcR5tBExKtTwuo86UeuVXS/vIwMi51Lx73RZJmY9QSkfT7kaptw57TNhsWxrjYFRRJ2EBZkdC9hBrEy7YJ0rlG71W28f8T6D0hc8ovgU7FAWhGEOAZjP70hIZNFzlE16gpSfIQRh2z00TNt6FdpmNFRmCwLaCSWJOpYIxiGBb8QW9yo6bGc5LDiPCTdl1LvhWGZIcItkDWIU/j7dTKB/wVsqw3gL0Y71ixb75b9sXYDn+cJG4+KVS0aRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=m6zgVVlZuxsPD+cpYzln5j7eyxbjSl/s4w3goJZvVqM=; b=ixTP8PACpvuVSn5uma2vNSQn8RNyg/jCCypVI0OCqIczAkj6JEanMLnLaqQY5MdN335E9v8/9H8ybgBwun1q5Fv3ZqW4AGywkfqCf/oSTB2ftVHCgwlqWxQuKSg2B/R9plpfuQk7DYsG2paGRmmc5X/8O7Fek+JCrohUMdCJaVPtIVMxX3pBtXA5FriggN4S7MoI/reyzcI465IXcnRWcfNhBPFt8yu+p4sAphXxhx2Kt0tddcT/FklbX3zqSh7Jd13a20QteeNpZsS37oQyTvk0kesaqdIJ6RNXc9mRL+83ASAsy+e+v5M2ZTHDlD9ZU5TIhFoWiUvkJvYyv0QxYg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by BYAPR11MB3608.namprd11.prod.outlook.com (2603:10b6:a03:b1::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13; Fri, 13 May 2022 08:36:54 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::c076:6436:db8e:ee22]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::c076:6436:db8e:ee22%8]) with mapi id 15.20.5250.014; Fri, 13 May 2022 08:36:54 +0000 From: "Chiu, Chasel" To: "devel@edk2.groups.io" , "Duggapu, Chinni B" Subject: Re: [edk2-devel] [PATCH v2] FSP_TEMP_RAM_INIT API call must follow X64 Calling Convention Thread-Topic: [edk2-devel] [PATCH v2] FSP_TEMP_RAM_INIT API call must follow X64 Calling Convention Thread-Index: AQHYZeB6hOJa+zfW6Uu+RkcvgDH83a0cd3WQ Date: Fri, 13 May 2022 08:36:54 +0000 Message-ID: References: <269758c0ceee3f742ab7d178112229be447d30d9.1652346714.git.chinni.b.duggapu@intel.com> In-Reply-To: <269758c0ceee3f742ab7d178112229be447d30d9.1652346714.git.chinni.b.duggapu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5db4b0ce-2424-4c9e-6e30-08da34bbbc3a x-ms-traffictypediagnostic: BYAPR11MB3608:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MmjYZl2y+T25zZjhZcUErO5/C3HmkOtQye0qxvZUuKYdaZew85rNC8UKkK0IoQ8UDOYRWCSvy52qK+5tVLN4YFR/nT2yaDAiYo5YJzZskJvc0y/1r/9X98Ay2JWlN0dw3nbDhpH/WLj6OVLLNb53RkrofKcIdupNEosKe+ulFs4u2COoOZ4M47dvvp3KhtRaKee1PxmQ0BShars0DRtQee/+OayYPLZL0ukF8ekegOBhhh/fXqI+h7/S/iN5XlqDcqcaxhgiKsP9bs/J/Hyt8DftGvyjZiFjzBjToiaxLHOuiUtKbVlMH1wy4ZvgGOA4kOiACcwk0CX3H81O4fktU1vXDBuns6qIeoeb0ygAaJW+hTa7y61CYj515BqW7RT2rsUKLq54ANt7hLq6lDY/SA/uqF68aIHG2TI2qNYHi1Zhe37/SwjA/JAigthb/qDFUJ9Z2VPgRbNQChAsCv9NWUxepLehSBX4+ayAxJd0LCbey08sRVbZWzE/Lod/i7j1P4XXA8VRu0kwFBX32uj5d8thlR+o0zpzvGuyM050Hkvf2fMg1QScG6s9sb9OxNU+ssf4sshO7+VlwslDY4NFvB0qTLJHRbvD3t6lWGgJwepffI6Li6FIQyFgVmyUZnqLwz3tnIR+DZD8oc7/6ozjyTTQSfLpo4mB75LKt1l1ajetbje1Bxz4znT/1l1q6xVgQzKYf0uIVNRL1bTW24byWiYcRnp02a1eNeFgIVKQcGbvg5S50dLMLx/VohehsR6fLquNkXKUwVO5ieqPMhrdG2DziKIYccvCdne7MSJTPBgNAS/+JTdNjtXaFogSPsSdqN/Dtr9aJ5e1DxO+0FKdm1DW6JoIWRrXaKVM7RueP7o= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5483.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(316002)(71200400001)(19627235002)(83380400001)(186003)(33656002)(76116006)(66476007)(66446008)(66556008)(64756008)(8676002)(66946007)(55016003)(26005)(2906002)(7696005)(9686003)(6636002)(38070700005)(8936002)(52536014)(82960400001)(38100700002)(122000001)(53546011)(86362001)(966005)(5660300002)(110136005)(6506007)(508600001)(11716005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?A/UIVmJMMbN2CR70Ax2yk1O6DzB/AsosBjsIDzuiG+ZXGrUtFfbfU/ogYkNJ?= =?us-ascii?Q?NJvzs69CU4ZlosjT5DNCbdX3YeQlwnGZe3/q7u4/4Yhs74lm7sPhccSpQR9o?= =?us-ascii?Q?hutqBrSw+S7+5b07y0tYrE8PO5pRzZzasY93WrMgksEwB0jCervr2PJTEMVh?= =?us-ascii?Q?Ouj5tSsSXq9aN/cdaR6JMQKbRU4DIl4GuY2aCiOiXk8dGtld2zVg1GQWJ2xm?= =?us-ascii?Q?tubKBcBUGS9HjAbW+gfyDyhxiZFQ8RWL8h3bve3xGYRmbRbpgKGH1q0qVV4Z?= =?us-ascii?Q?96Ks81aiEc2NQC/ORk0t0dN0pUHRXhApPmuQHCY8FSG3uwmxkhZsB4u9nbH8?= =?us-ascii?Q?wMYDmRWAXA5BAEdX+9Cl0cPTJntYYsYed9Uyjd6KWBC7i5aqZlbfqZIXpniP?= =?us-ascii?Q?mJivInuvVG6iyuic4ZJhXrZQkxWjT1XklrxpaKD2/PC8M12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t3zQyQ1MAuuC5rhz96jZmy7FADcCduLIV3OEmZOkUiPd70tkZtd?= =?us-ascii?Q?tvEKmOeSK0ycYAfckAdacl22H6zoRRuRI1e2Gxz2DwMSKy1VSVYEnimHh/Lb?= =?us-ascii?Q?DmhZLCU5V+bdI7yYTpiPeGt0UfCAyzfP8GOaykSeHRjLRAvijP+Lq7e9nrO3?= =?us-ascii?Q?K1WmlK/190vPU1i4tz6CJhRa2sJHyz7UGBLQ5ZBiln82Bzr+JmVajZvndIVe?= =?us-ascii?Q?GmXzB+JW28XuDYZcrkRNIfR78UAf0dDMSPABiE4lN8SLw50OhBtRfMB1tO9C?= =?us-ascii?Q?0Uwi+jnl7tYrQ7tYnIKLskZVmYVPImVApKhVk7BQmpTb/0x7qjpdOBdKQBFG?= =?us-ascii?Q?JlLcJ3Z8eA9ni9uvjwqOkTs39vD2v+GrHBkFTEqt1j/WhHXr7zRh38dDYE1b?= =?us-ascii?Q?4hUMewmapA=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5db4b0ce-2424-4c9e-6e30-08da34bbbc3a X-MS-Exchange-CrossTenant-originalarrivaltime: 13 May 2022 08:36:54.7196 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UnkBNcL/9Py+/q28axrsgO6VM781/yEMOXp/ww3Dpv/PI0EJj77fHS3JhkFG2BiAk+CGR75S2xZp2b8d2pEjXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3608 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Chinni! Just few comments below inline, please help to check. Would you also help to update commit message format and include Bugzilla li= nk for reference? Thanks, Chasel > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of > cbduggap > Sent: Thursday, May 12, 2022 5:13 PM > To: devel@edk2.groups.io > Subject: [edk2-devel] [PATCH v2] FSP_TEMP_RAM_INIT API call must follow > X64 Calling Convention >=20 > This API accept one parameter using RCX and this is consumed in mutiple > sub functions. > Signed-off-by: cbduggap > --- > IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm | 21 ++++++++------ > .../Include/SaveRestoreSseAvxNasm.inc | 28 +++++++++++++++++++ > 2 files changed, 40 insertions(+), 9 deletions(-) >=20 > diff --git a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm > b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm > index a9f5f28ed7..cddc41125e 100644 > --- a/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm > +++ b/IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm > @@ -130,10 +130,9 @@ ASM_PFX(LoadMicrocodeDefault): > cmp rsp, 0 jz ParamError- mov eax, dword [rsp + 8] = ; > Parameter pointer- cmp eax, 0+ cmp ecx, 0 jz ParamError-= mov Do you have corresponding change for IntelFsp2WrapperPkg\Library\SecFspWrap= perPlatformSecLibSample\X64\SecEntry.nasm to pass parameters by RCX? Please help to update comments for LoadMicrocodeDefault as it still mention= ing below old implementation: ; Inputs: ; rsp -> LoadMicrocodeParams pointer > esp, eax+ mov esp, ecx ; skip loading Microcode if the > MicrocodeCodeSize is zero ; and report error if size is less than 2k@@= - > 321,8 +320,7 @@ ASM_PFX(EstablishStackFsp): > ; ; Save parameter pointer in rdx ;- mov rdx, qword [rsp + = 8]-+ mov > rdx, rcx ; ; Enable FSP STACK ;@@ -420,7 +418,10 @@ > ASM_PFX(TempRamInitApi): > ; ENABLE_SSE ENABLE_AVX-+ ;+ ; Save Input Parameter in YMM10+ ;= + > SAVE_RCX ; ; Save RBP, RBX, RSI, RDI and RSP in YMM7, YMM8 and > YMM6 ;@@ -442,9 +443,8 @@ ASM_PFX(TempRamInitApi): > ; ; Check Parameter ;- mov rax, qword [rsp + 8]- cmp = rax, 0- > mov rax, 08000000000000002h+ cmp rcx, 0+ mov rcx, > 08000000000000002h jz TempRamInitExit ;@@ -456,17 +456,20 > @@ ASM_PFX(TempRamInitApi): > ; Load microcode LOAD_RSP+ LOAD_RCX CALL_YMM Since we have following X64 calling convention to pass parameter by RCX, I = think we do not need LOAD_RSP anymore. Please help to check if we still need it. > ASM_PFX(LoadMicrocodeDefault) SAVE_UCODE_STATUS rax ; Save > microcode return status in SLOT 0 in YMM9 (upper 128bits). ; @note If > return value rax is not 0, microcode did not load, but continue and attem= pt > to boot. ; Call Sec CAR Init LOAD_RSP+ LOAD_RCX CALL_YMM > ASM_PFX(SecCarInit) cmp rax, 0 jnz TempRamInitExit > LOAD_RSP+ LOAD_RCX CALL_YMM ASM_PFX(EstablishStackFsp) cmp > rax, 0 jnz TempRamInitExitdiff --git > a/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc > b/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc > index e8bd91669d..38c807a311 100644 > --- a/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc > +++ b/IntelFsp2Pkg/Include/SaveRestoreSseAvxNasm.inc > @@ -177,6 +177,30 @@ > LXMMN xmm5, %1, 1 %endmacro +;+; Upper half of > YMM10 to save/restore RCX+;+;+; Save RCX to YMM10[128:191]+; > Modified: XMM5 and YMM10+;++%macro SAVE_RCX 0+ LYMMN > ymm10, xmm5, 1+ SXMMN xmm5, 0, rcx+ SYMMN ymm10= , > 1, xmm5+ %endmacro++;+; Restore RCX from YMM10[128:191]+; > Modified: XMM5 and RCX+;++%macro LOAD_RCX 0+ LYMMN > ymm10, xmm5, 1+ movq rcx, xmm5+ %endmacro+ ; ; > YMM7[128:191] for calling stack ; arg 1:Entry@@ -231,6 +255,7 @@ > NextAddress: > ; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] =3D 1) to > test ; whether the processor supports SSE instruction. = ;+ > mov r10, rcx mov rax, 1 cpuid = bt rdx, 25@@ - > 241,6 +266,7 @@ NextAddress: > ; bt ecx, 19 jnc SseError+ = mov rcx, > r10 ; ; Set OSFXSR bit (bit #9) & OSXMMEXCPT bit= (bit > #10)@@ -258,6 +284,7 @@ NextAddress: > %endmacro %macro ENABLE_AVX 0+ mov r10, rc= x > mov eax, 1 cpuid and ecx, 10000000h@@ -28= 0,5 +307,6 > @@ EnableAvx: > xgetbv ; result in edx:eax or = eax, 00000006h ; Set > XCR0 bit #1 and bit #2 to enable SSE state and AVX state xset= bv+ > mov rcx, r10 %endmacro -- > 2.36.0.windows.1 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#89694): > https://edk2.groups.io/g/devel/message/89694 > Mute This Topic: https://groups.io/mt/91054270/1777047 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [chasel.chiu@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D >=20