From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.80177.1682432037175796871 for ; Tue, 25 Apr 2023 07:13:57 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=NsllxHHO; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: ray.ni@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682432037; x=1713968037; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=K6lb5asbhP1MKmun/8F85gAjWEFosJjJAuWe3lQlTeI=; b=NsllxHHOarBGw5xukp9HqrcsiVFAxLR5+Qj0Sb6TfBW04FDHNzCJ4aFv TQ8e39KOwNFh3wYb04i1074CrYKr3aZpnoayjZmo6r6cwuBtb3jryDBpa eU+AbJOm5aYChVW6CGoXOQ1rF3GaY3s0D8qgMzBSfmohTljHYp1+mXjAQ FVkBSWitumawohU594OZAQwby2DrBlL69U9UyQd8LTBQyGMdtEX3OAbxd Y7YLyRDp1GE+gNLdGeLXf57YBgtZMqEC/p4c15FA9PYFrzSwQY2Lq/wW7 qNQC6RiSsjVs1qnpR2XcxrWTRXqg9puFfSDggpmMl3WaoFAwI8Chg2uNE g==; X-IronPort-AV: E=McAfee;i="6600,9927,10691"; a="326378779" X-IronPort-AV: E=Sophos;i="5.99,225,1677571200"; d="scan'208";a="326378779" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Apr 2023 07:13:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10691"; a="724045411" X-IronPort-AV: E=Sophos;i="5.99,225,1677571200"; d="scan'208";a="724045411" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga008.jf.intel.com with ESMTP; 25 Apr 2023 07:13:56 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.23; Tue, 25 Apr 2023 07:13:55 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.23; Tue, 25 Apr 2023 07:13:55 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.2507.23 via Frontend Transport; Tue, 25 Apr 2023 07:13:55 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) 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.2507.23; Tue, 25 Apr 2023 07:13:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MCmUUfghaaI3QIqmOgaj3QYmb/LYrm0sRL81RQPjWXM8GTcBTpWSR7Qp/jd0ldo/CMQ781qMQZwtTaae0OxpttX4ENGGaKJ8HYf+4eaQhAxoIs8srlR+UZXjbpeVMTOiOEyEi02uHBLSqyWID7a32vqGwbL9ee1VcX+3HBKcPFEQjbwV9kPSF0HJ1/nfudZq+Dum8J1whtzwKXAjPm+FcLICZt1tWhGRW7hIOTNSoJGBkbDcjGK8I6PqP13wLxRpvHwJCSMXQUmzGNX4irBsqYzMTFr/W7whNu5b6gLJ5Qwg8ytw0ZR4ZySS4OFRAskSIVtw3cY80sV5iaxVYp3Yvg== 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=W7vAFRsp5ZjNX67l6JFMZhCb3syqb71aklDrQCznkwQ=; b=oXtnKc5envi4FQtbLJj52w52R9cis0rqs44s1QjIT1PEW7EkQ/zUZADgejQIWi1CYH3f5Xa1jUzAftF7FVR5qRITFOR/k/rEkhJH7sAQ+kVxM/L9wIPkaWnlTG8eeJigIXnHmDZPZJoRTqllUmUu3a4NHnMnHe9E08l7t8vuJm6nuxF9r3cvuyg2CuV2Yv5QP0H7ozHxGhltxnafGT6++2zBHjLZmns9QCazxFJFj76A8HozHgJNLgid8IwO6uWTxRxbS86enFuginJNiKIGKWzBRV3pyNoPCctL2rm7VaojFChFtS4m3fTuGb4FhS29cPWCkywLEZVaQCwkrT0o5A== 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 MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by CH0PR11MB8141.namprd11.prod.outlook.com (2603:10b6:610:18a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.33; Tue, 25 Apr 2023 14:13:53 +0000 Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::892b:b8e6:bab7:635d]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::892b:b8e6:bab7:635d%5]) with mapi id 15.20.6319.033; Tue, 25 Apr 2023 14:13:53 +0000 From: "Ni, Ray" To: "Tan, Dun" , "devel@edk2.groups.io" CC: "Dong, Eric" , "Kumar, Rahul R" , Gerd Hoffmann , "Chen, Xiao X" Subject: Re: [Patch V2 2/2] UefiCpuPkg: Update PT code to support enable collect performance Thread-Topic: [Patch V2 2/2] UefiCpuPkg: Update PT code to support enable collect performance Thread-Index: AQHZd1UmkPYMzXleZUuUmCBHimyTQ688EKDg Date: Tue, 25 Apr 2023 14:13:53 +0000 Message-ID: References: <20230425090524.3027-1-dun.tan@intel.com> <20230425090524.3027-3-dun.tan@intel.com> In-Reply-To: <20230425090524.3027-3-dun.tan@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|CH0PR11MB8141:EE_ x-ms-office365-filtering-correlation-id: db982aaf-4b45-4c87-e627-08db45974cc7 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oTz9AYOKT3vcUz46rMbZB05q1laxq69HGpOP0KQ47T7H7p7Igo91MMJxeW3dyzaVlfSCvWrxEXppXRU4BgbLbLpHiu/DPHdEvVKI13NCh+D3cRQXXnR5ugAkj0MhB834REoBQNbiVuVNi3QbWerCqJNZdkaKSYrRfpT/2TbSwHKlItyQ0lFYaIEP0wloUNLenaBcPQmpP4zrBKayF609CUWlIH3rhwGvXgd5vANZdor+ACZo15bAUjF/PvQAW/akJ1m1uoJSrVBe/LhaBivprLXjRsv5v20CtVAXdJm9ofJelaJeGWayP5WyQuaDaYVp54Z/ScxEo6ifXYBeLbRExQwMX5Zbn5576MIEabLmNPndfIxcEeGCFCpKUpKBGu8/IKHKMv8QoAppVTZILMPrws+TSkMhbkXbdP4+ApDQ32LyaM3GhGMs9g4aILBG/5/FBLCU2I8LWLcxyr3cN5Yv4+vrLWK0grl3c2DGaPvMGeZ+XStS0cFpcdZ1WJ9i0uFUVqJDn/f8I3VAfPBZr2Ifsnml33nUTnV0VzR6XIU8OqF28VAVr/KHF8gM4a6K9QfnlbsqlFa30dxl/+yWl7ZbZ6/wxbir3F0S7807K6ONKSA8spoff3gT7rYdE6a2AqZP x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN6PR11MB8244.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(376002)(346002)(39860400002)(136003)(396003)(451199021)(478600001)(110136005)(54906003)(86362001)(107886003)(186003)(26005)(9686003)(6506007)(55016003)(33656002)(71200400001)(4326008)(64756008)(66556008)(316002)(82960400001)(66446008)(66476007)(66946007)(83380400001)(76116006)(2906002)(38100700002)(15650500001)(8676002)(122000001)(41300700001)(38070700005)(7696005)(5660300002)(8936002)(52536014);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Pj9pI4Ap2x5ft4aWS8iyXxCHLSk+zrkJbB5Rq5A5udYZkE7gLYxpeoMsnMiS?= =?us-ascii?Q?pj93+6vLZxoxJxEaM0ZaipdwqgDdRjJ5cP3i9GhydH0BVM5eU+TIepISJNSO?= =?us-ascii?Q?wavXS5Ep7MZHgAqPPrCNSGyjxzTd5x7JKEXrJd8o+BnV2UhWUAdZTDw04Ubj?= =?us-ascii?Q?SAVf8YTlr97B0cjPDSLm2aWhqJGZwbP9vLWUiwjQnEe2Hcr1iwxw/AdfMRC7?= =?us-ascii?Q?nbPSU/jcXjY/SiIlk4bp9uAfTO5/4R+54IT7ul9W+FKZ52kGPQQ516o6zcJD?= =?us-ascii?Q?1xp5D2QZc/gdNWSSlsFgQm2hxjGfqhju3HNOxNmuU5phgJuuYQ9+d1KDQMWP?= =?us-ascii?Q?aJ1GPwzq7hmTrKBqd7H7OrqaPrH19pyLDPiZwkMr158orSJP6EdVgqRAmGKC?= =?us-ascii?Q?QmtF7gYQOG7oVLP4PJQxyBUOlIA15vDSMgpBxzn//kbCcN/J8V3Kb5/Rfkmo?= =?us-ascii?Q?UW0L6SIWn/UoaB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f?= =?us-ascii?Q?E0ohVnxf0EhRCk116yguRUI5lMVE8Uxzj03bWWge/S1UmqTiTckh+V6WO1Bd?= =?us-ascii?Q?l5kLSad9KDhQ8Rcnj39MI4Yfc+biayQejN+fVVuUwFumZKQA8dD5DY9wvRjH?= =?us-ascii?Q?8pkBpnNIxerYwwo1aaynaJOAyT91JN+IQiLe6JMMbqIKMaoWAy0EGqhih387?= =?us-ascii?Q?FYx4nMFDHYaIoxxjHH2+UHmjQ1RMNMwXxpMtb5Ej?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: db982aaf-4b45-4c87-e627-08db45974cc7 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2023 14:13:53.3263 (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: jh2593NRPGnzqVjVr4b/w5Nd2BsTHmeWORFz28rs7WQiqfb62f++P68ofQ2cSNSrPyMZoPyjWzQOvvIiJtu/Xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB8141 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > @@ -112,6 +115,7 @@ ProcTraceSupport ( > PROC_TRACE_DATA *ProcTraceData; > CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX Ebx; > CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_ECX Ecx; > + CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_EBX MainLeafEbx; 1. can you update the "Ecx" to "ProcTraceEcx", and "MainLeafEbx" to "ProcTr= aceEbx"? >=20 > // > // Check if ProcTraceMemorySize option is enabled (0xFF means disable = by > user) > @@ -141,6 +145,12 @@ ProcTraceSupport ( > ProcTraceData->ProcessorData[ProcessorNumber].RtitCtrl.Uint64 = =3D > AsmReadMsr64 (MSR_IA32_RTIT_CTL); > ProcTraceData->ProcessorData[ProcessorNumber].RtitOutputBase.Uint64 > =3D AsmReadMsr64 (MSR_IA32_RTIT_OUTPUT_BASE); > ProcTraceData- > >ProcessorData[ProcessorNumber].RtitOutputMaskPtrs.Uint64 =3D > AsmReadMsr64 (MSR_IA32_RTIT_OUTPUT_MASK_PTRS); > + > + if (ProcTraceData->EnablePerformanceCollecting) { > + AsmCpuidEx (CPUID_INTEL_PROCESSOR_TRACE, > CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF, NULL, &MainLeafEbx.Uint32, > NULL, NULL); 2. There is an existing Cpuid call earlier. Can you get the "EBX" value in = the existing Cpuid call? And you don't even need to check "EnablePerformanceCollect= ing" here for the capability detection.