From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.6304.1647312404336551406 for ; Mon, 14 Mar 2022 19:46:45 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=B+hnOiLs; spf=pass (domain: intel.com, ip: 192.55.52.120, 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=1647312404; x=1678848404; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=H5GXrnvN1uzb/d9vFAmveoq6OfgnZT/I3e1Vy/PhCtw=; b=B+hnOiLsASSVG/Rtl97/3suINpmRJpdvIj+nvAy4z2DFW7aKPRzRo4v2 I8yRrb2Ni5+WZQWDygnaiXKNsf2lFByK4lGcCVhWZssKv7+4ZAogzETa5 mvToos62A3E26JpbVA5P0zUUqJHIA5jjaznDML+dPysmmedUDLfn0o8Vz kR0tomxxPv0ivC3LzCPMfZda6//DcpH+H1kxPPy0XPfKuiCP+v8/xE/mD 29lcvMbJUEzsfxohiUaH2vXY0gXRSizaCSDbhZSIYOyOCrB+evbCAdkNP yf5hzb0sWbjgT77OuxZfYQGdGrzSkpW32sVtBPl0YH7lcKNRVAN8Ut6CW w==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="255026915" X-IronPort-AV: E=Sophos;i="5.90,182,1643702400"; d="scan'208";a="255026915" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2022 19:46:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,182,1643702400"; d="scan'208";a="549448245" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga007.fm.intel.com with ESMTP; 14 Mar 2022 19:46:43 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) 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.21; Mon, 14 Mar 2022 19:46:42 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 14 Mar 2022 19:46:42 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Mon, 14 Mar 2022 19:46:42 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.102) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Mon, 14 Mar 2022 19:46:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uh+VyfCu/dDpXrIhCbSWy3QsGo/jr8CexKY1CjyEt9bFM37bFPOqu39mf0mENiEE1UoXDSj4ebGaN8U7okD3Hl0MWwXkHkjIOOWifn0t0iRGrEfqO3rrROKWIbVLsfgnj0Df0kw6cwyLStCp8+Cx5PPSxZM6afLrWGUTXSc1gsF8rfGneVgH4QDqYKIcVAMheEZQm129x8TQ2B4ulWSSsu5oHuqPuxCf63hBSWxtH01mNviIN5rhCgvdMKZ69ag6SdzylukaYf/rgUZ5hnxMWfQkZZBP4H3i0xjR7Q8hu0yABL5fYUKU9pxQWsPGt8q4IvZ2/CO1LoUUUdh0bX6/xw== 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=WroaAu4UxSiyUTxtrh0qDS7E2Vl3VFwElq29WVaY+2A=; b=a9l1Vo8jne6DTE1GzVmju6V3GFFhNxsyLlz0CWbo199Vh/2XWLVkNRI4jbymAs5p+cKmyk/iWpNr6Rw3vzdBQq5yLme5CQCI+SospNskKO35W992CdY6JUS+xKLpTiXTwQVZyd1fBnDkSvt1N+TG12bxsmZCFcXUKj91Iweu1ye1ofp4ROdXNvTrmbvpQD1/9OJN2jH7wHsOkXu/LOEVbYcN5ZFAwMhV11Azt5fOxi+eGzkSjpT+dkVS9rME6aZDIW9dIAlGEEZ9rHg0SY11DAionIB6hB9i0uv9DrnLbinC+OsrSd0PCsKK8DfM4LS3HSSuMpy7V1tq6FSXq5S+ag== 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 MWHPR1101MB2142.namprd11.prod.outlook.com (2603:10b6:301:56::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Tue, 15 Mar 2022 02:46:40 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::8c4b:e24c:c69f:7809]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::8c4b:e24c:c69f:7809%6]) with mapi id 15.20.5061.028; Tue, 15 Mar 2022 02:46:40 +0000 From: "Chiu, Chasel" To: "Kuo, Ted" , "devel@edk2.groups.io" CC: "Desimone, Nathaniel L" , "Zeng, Star" , "S, Ashraf Ali" Subject: Re: [edk2-devel][PATCH v2] IntelFsp2Pkg: BaseFspDebugLibSerialPort Support for X64 Thread-Topic: [edk2-devel][PATCH v2] IntelFsp2Pkg: BaseFspDebugLibSerialPort Support for X64 Thread-Index: AQHYN0vcD4GW7hVrW06vw4OHCaXe6ay/vwpg Date: Tue, 15 Mar 2022 02:46:39 +0000 Message-ID: References: <36aaf49894b82a5db9f359e08e10057f9ea14922.1647225139.git.ted.kuo@intel.com> In-Reply-To: <36aaf49894b82a5db9f359e08e10057f9ea14922.1647225139.git.ted.kuo@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: 84d5c8e1-66c6-43cf-170f-08da062e081a x-ms-traffictypediagnostic: MWHPR1101MB2142: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: pZaj2+WJT/aB8C6nIxaZ97ouiDoa27aax34KnQvdY766ag/fxX6K2fFNMUAE77p8ISBTCxWBAES5Fvui8hndDCu59iRBEkhfdKUho3dUzO2mcCn8EobIUwyJo0v2bjYbFntT5pC2FhoePXXZ59bQR23uvYOBcoRZlTfnhqxOQ4jw58F9r7LgsuECCaOlSglhVqLA9677QONvoDuG3CV9iqzniQyOT/qPsPX0awS0xgBNJYirjedKzsb3yrf9Rwg2r8MNewFH33EuoyZV1/8kKiqbuMMo18jBWWN7KQ2YllN1LdIMgp9FxyxZiwMr0R2KO1p4+bKYeyZUWhBpkdodEiAMPk91OKVzR19ZFncNQlRquLKfvT8kd6NKhWbFb70l7PlVA9iIpcS84x66M6OR8C3MjKRzCF8bUHdebBkbi9txgsEXNoxLvuzd1oOBn2+zV5TzkjlmVcOETXPxIwCz4qd57JnjDs1JNJqgB2HcDtT/OR4Dmja2Rqg6f+7rw3vTzupDS/2iu9iuIKpE7EaimBz1h8JWhpJVx6qAp3lwbJlWov+DDr5iAmaUrQXtE4RHoeXmywlUqoHzT6A5oujuoZ7SOZX3MLynTZTPSuPA7aizOZ0Z2kRn+iRYYoqCfqca4sekNrGkNF16QQbtTrLYXT5pZsNme9hX6GJvc8+zjzer++ut7hQisZoDoDSGq5Qp19oPk6ZNQLGqx80vTibOrFqm6jUa7bLBsvAwk18a1SG/vbDI+Gzh4YBB/+hxyA0dqGHQuH70fflbFnWuufuLO1y13H1AaETn2FTd4vTMrLiYJBrWKD44t13NbWL1nJST2TJSxXNVAPXzT+FZN5Lc+vD6j8R3hs0RlLBgeKEhkOM= 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)(83380400001)(19627235002)(2906002)(86362001)(55016003)(38070700005)(4326008)(8676002)(52536014)(66446008)(53546011)(107886003)(66476007)(64756008)(7696005)(6506007)(508600001)(8936002)(38100700002)(71200400001)(9686003)(110136005)(122000001)(54906003)(5660300002)(33656002)(186003)(82960400001)(26005)(66556008)(76116006)(66946007)(11716005)(213903007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xbtSpxgI/ixKmZlU+9SosaqJoYsa77wA6XOvjHPq6sA9Ah9cf+Ug4ypgCG6U?= =?us-ascii?Q?d6RruroSQ6yX8o2vwGQDXevLst6MDU5F8ijChT3qZBUJ5q0BKVRD0rvmJBkv?= =?us-ascii?Q?O4jMM5AGX/ClqZikicx71OXo959I8AdRT8eEJXqGi8PJX64NWCi1vdOlOVLN?= =?us-ascii?Q?kezi+8cCq0ziVfsn0p6YncWcOFGSG/IKkk8HzKO/QNDj2tuT9rHdaBy1a8Jp?= =?us-ascii?Q?KLTV2YUiXgKaAW2eCl482LYeTa71UBmYF26Z/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6qWes7H3hXDJ5jrQTbNj/1BAtbWMM+kDff8jJDIhDY1UAhVgNjQn+7?= =?us-ascii?Q?qmG6V4KayHkVVTX19V5pzJlsAqmxh9j1IScmh8i9UnxhyTN5ES8Jfhl1pOAW?= =?us-ascii?Q?D+8PpPPiF5bek3MW38MzbcGXyyhdWILeVk6tPlXBzt7G3E5p+mdHAADZLsht?= =?us-ascii?Q?U0TPT04pDnD9wkelRVp5KRDOK0GXhFYvcoO6PUIpGTSR9/lpoQW5O1dHYudJ?= =?us-ascii?Q?DtFVqaXVmRekrgZZdA+nZFVt0BGR0Hf+oUdxCylioCfPvlQGmtkjusQCgn95?= =?us-ascii?Q?fQMWL1Llj/bFAttkE1TxE3zD+S9DmN+P?= 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: 84d5c8e1-66c6-43cf-170f-08da062e081a X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2022 02:46:39.8974 (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: aIGrX8Wnaj9FyQIBXTo1kOdMyrIxpLJe2/SXTwVPpwCI93JsA50cxDW3RmyFXwyjJpHbR9cW/qfPau7WFVTbtQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1101MB2142 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 Ted for updating patch! Reviewed-by: Chasel Chiu > -----Original Message----- > From: Kuo, Ted > Sent: Monday, March 14, 2022 10:33 AM > To: devel@edk2.groups.io > Cc: Chiu, Chasel ; Desimone, Nathaniel L > ; Zeng, Star ; S, As= hraf > Ali > Subject: [edk2-devel][PATCH v2] IntelFsp2Pkg: BaseFspDebugLibSerialPort > Support for X64 >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3833 > Add BaseFspDebugLibSerialPort Support for X64. >=20 > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Ashraf Ali S > Cc: Ted Kuo > Signed-off-by: Ted Kuo > --- > .../BaseFspDebugLibSerialPort.inf | 5 ++- > .../Library/BaseFspDebugLibSerialPort/DebugLib.c | 39 +++++++++++++---= ------ > .../BaseFspDebugLibSerialPort/X64/FspDebug.nasm | 25 ++++++++++++++ > 3 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 > IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/X64/FspDebug.nasm >=20 > diff --git > a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPor= t.i > nf > b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPor= t.i > nf > index 14b1899e6c..395def57c3 100644 > --- > a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSerialPor= t.i > nf > +++ b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/BaseFspDebugLibSeri > +++ alPort.inf > @@ -16,7 +16,7 @@ > LIBRARY_CLASS =3D DebugLib >=20 > # > -# VALID_ARCHITECTURES =3D IA32 > +# VALID_ARCHITECTURES =3D IA32 X64 > # >=20 > [Sources] > @@ -25,6 +25,9 @@ > [Sources.Ia32] > Ia32/FspDebug.nasm >=20 > +[Sources.X64] > + X64/FspDebug.nasm > + > [Packages] > MdePkg/MdePkg.dec > IntelFsp2Pkg/IntelFsp2Pkg.dec > diff --git a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c > b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c > index c8824cde7f..cb2317bfb2 100644 > --- a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c > +++ b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/DebugLib.c > @@ -33,7 +33,7 @@ VA_LIST mVaListNull; >=20 > @return StackFramePointer stack frame pointer of function call. > **/ > -UINT32 * > +UINTN * > EFIAPI > GetStackFramePointer ( > VOID > @@ -193,13 +193,13 @@ DebugBPrint ( > **/ > VOID > FillHex ( > - UINT32 Value, > + UINTN Value, > CHAR8 *Buffer > ) > { > INTN Idx; >=20 > - for (Idx =3D 7; Idx >=3D 0; Idx--) { > + for (Idx =3D (sizeof (UINTN) * 2) - 1; Idx >=3D 0; Idx--) { > Buffer[Idx] =3D mHexTable[Value & 0x0F]; > Value >>=3D 4; > } > @@ -228,26 +228,35 @@ DebugAssertInternal ( > ) > { > CHAR8 Buffer[MAX_DEBUG_MESSAGE_LENGTH]; > - UINT32 *Frame; > + UINTN *Frame; >=20 > - Frame =3D (UINT32 *)GetStackFramePointer (); > + Frame =3D (UINTN *)GetStackFramePointer (); >=20 > // > // Generate the ASSERT() message in Ascii format > // > - AsciiStrnCpyS ( > - Buffer, > - sizeof (Buffer) / sizeof (CHAR8), > - "-> EBP:0x00000000 EIP:0x00000000\n", > - sizeof (Buffer) / sizeof (CHAR8) - 1 > - ); > + if (sizeof (UINTN) =3D=3D sizeof (UINT32)) { > + AsciiStrnCpyS ( > + Buffer, > + sizeof (Buffer) / sizeof (CHAR8), > + "-> EBP:0x00000000 EIP:0x00000000\n", > + sizeof (Buffer) / sizeof (CHAR8) - 1 > + ); > + } else { > + AsciiStrnCpyS ( > + Buffer, > + sizeof (Buffer) / sizeof (CHAR8), > + "-> RBP:0x0000000000000000 RIP:0x0000000000000000\n", > + sizeof (Buffer) / sizeof (CHAR8) - 1 > + ); > + } > SerialPortWrite ((UINT8 *)"ASSERT DUMP:\n", 13); > while (Frame !=3D NULL) { > - FillHex ((UINT32)Frame, Buffer + 9); > - FillHex (Frame[1], Buffer + 9 + 8 + 8); > + FillHex ((UINTN)Frame, Buffer + 9); > + FillHex (Frame[1], Buffer + 9 + (sizeof (UINTN) * 2) + 8); > SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer)); > - if ((Frame[0] > (UINT32)Frame) && (Frame[0] < (UINT32)Frame + > 0x00100000)) { > - Frame =3D (UINT32 *)Frame[0]; > + if ((Frame[0] > (UINTN)Frame) && (Frame[0] < (UINTN)Frame + 0x001000= 00)) > { > + Frame =3D (UINTN *)Frame[0]; > } else { > Frame =3D NULL; > } > diff --git > a/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/X64/FspDebug.nasm > b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/X64/FspDebug.nasm > new file mode 100644 > index 0000000000..6cf0f0af8b > --- /dev/null > +++ b/IntelFsp2Pkg/Library/BaseFspDebugLibSerialPort/X64/FspDebug.nasm > @@ -0,0 +1,25 @@ > +;---------------------------------------------------------------------- > +-------- > +; > +; Copyright (c) 2022, Intel Corporation. All rights reserved.
; > +SPDX-License-Identifier: BSD-2-Clause-Patent ; ; Abstract: > +; > +; FSP Debug functions > +; > +;---------------------------------------------------------------------- > +-------- > + > + SECTION .text > + > +;---------------------------------------------------------------------- > +-------- > +; UINT32 * > +; EFIAPI > +; GetStackFramePointer ( > +; VOID > +; ); > +;---------------------------------------------------------------------- > +-------- > +global ASM_PFX(GetStackFramePointer) > +ASM_PFX(GetStackFramePointer): > + mov rax, rbp > + ret > + > -- > 2.16.2.windows.1