From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6C7A821E47D57 for ; Wed, 23 Aug 2017 20:30:07 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2017 20:32:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,419,1498546800"; d="scan'208";a="1209731234" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 23 Aug 2017 20:32:40 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 20:32:40 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 23 Aug 2017 20:32:40 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.183]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.117]) with mapi id 14.03.0319.002; Thu, 24 Aug 2017 11:32:38 +0800 From: "Dong, Eric" To: "Dong, Eric" , "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" Thread-Topic: [Patch v2 1/2] UefiCpuPkg/ArchitecturalMsr.h: Add RTIT TOPA table entry definition. Thread-Index: AQHTHGnOI/i3sYMD9kyUAQ5qEhkhOqKS086AgAAFT1A= Date: Thu, 24 Aug 2017 03:32:37 +0000 Message-ID: References: <1503026917-13296-1-git-send-email-eric.dong@intel.com> <1503026917-13296-2-git-send-email-eric.dong@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch v2 1/2] UefiCpuPkg/ArchitecturalMsr.h: Add RTIT TOPA table entry definition. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Aug 2017 03:30:07 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Mike, I found the attach pic can't show up. Append the content directly from sdm. -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Dong= , Eric Sent: Thursday, August 24, 2017 11:22 AM To: Kinney, Michael D ; edk2-devel@lists.01.org Cc: Ni, Ruiyu Subject: Re: [edk2] [Patch v2 1/2] UefiCpuPkg/ArchitecturalMsr.h: Add RTIT = TOPA table entry definition. Mike, Add my comments below. -----Original Message----- From: Kinney, Michael D Sent: Thursday, August 24, 2017 7:45 AM To: Dong, Eric ; edk2-devel@lists.01.org; Kinney, Mich= ael D Cc: Ni, Ruiyu Subject: RE: [Patch v2 1/2] UefiCpuPkg/ArchitecturalMsr.h: Add RTIT TOPA ta= ble entry definition. Hi Eric, I see that the legal values for the Size field of RTIT_TOPA_TABLE_ENTRY are= documented in the SDM. I think we should add the enum for PROC_TRACE_MEM_SIZE into ArchitecturalMs= r.h next to RTIT_TOPA_TABLE_ENTRY. Maybe rename it to RTIT_TOPA_MEMORY_SIZE with enum names that start with "R= titTopaMemorySize". [[Eric]] agree, update in the new patch. The Copyright date in ArchitecturalMsr.h also needs to be updated. [[Eric]] agree, update in the new patch. The #define for MAX_TOPA_ENTRY_COUNT need a comment block that describes wh= at it is and why it has a value of 2. I see 2 entries are needed because the list of entries must be terminated by an e= ntry with the END bit set to 1, so 2 entries are required to use a single v= alid entry. [[Eric]] agree, update in the new patch. ProcTrace.c: Please update programming of MSR_IA32_RTIT_OUTPUT_BASE to use = the named bit fields from the structure. ProcTrace.c: Please update programming of MSR_IA32_RTIT_OUTPUT_MASK_PTRS to= use the named bit fields from the structure. [[Eric]] I think current code is easy to write but it may touch the reserve= bits. Agree to change to use the bit fields. Update in the new patches. ProcTrace.c: I am confused by the programming MSR_IA32_RTIT_OUTPUT_MASK_PTR= S to 0x7f. That sets a Reserved field to all 1s. [[Eric]] Copy from the sdm, default value is all 1. Write to it is ignored.= So I think the original code is same as set the others bits all 0. I have = update code to directly set other bits to 0. Please check the new patch. [cid:image001.jpg@01D31CCB.2A4EEA30] [[Eric]] Found the attached pic can't show, copy the context like below: Table 35-9. IA32_RTIT_OUTPUT_MASK_PTRS MSR Position Bit Name At Reset B= it Description 6:0 LowerMask 7FH = Forced to 1, writes are ignored ProcTrace.c: I see a mix of setting TopaEntryPtr using both bit fields and = the Uint64 field. Can we change to use only the bit fields. [[Eric]] same reason as before, use Uint64 is easy to write but may touch t= he reserved bits. Update code to use bit fields. Do we really need to set the address field in entry #1? Isn't setting END = to 1 enough? [[Eric]] Copy below from sdm. This code point to the current table for a ci= rcular case. [cid:image002.jpg@01D31CCB.2A4EEA30] [[Eric]] Found the attached pic can't show, copy the context like below: 35.2.6.2 Table of Physical Addresses (ToPA) When IA32_RTIT_CTL.ToPA is set and IA32_RTIT_CTL.FabricEn is clear, the ToP= A output mechanism is utilized. The ToPA mechanism uses a linked list of tables; see Figure 35-1 for an illustr= ative example. Each entry in the table contains some attribute bits, a pointer to an output region, and the size o= f the region. The last entry in the table may hold a pointer to the next table. This pointer can either point to the = top of the current table (for circular array) or to the base of another table. The table size is not fixed, since the lin= k to the next table can exist at any entry. Thanks, Mike > -----Original Message----- > From: Dong, Eric > Sent: Thursday, August 17, 2017 8:29 PM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D >; Ni, Ruiyu > > > Subject: [Patch v2 1/2] UefiCpuPkg/ArchitecturalMsr.h: Add RTIT TOPA > table entry definition. > > Add RTIT TOPA table entry definition to architecturalMsr.h file. > > Cc: Michael Kinney > > Cc: Ruiyu Ni > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Eric Dong = > > --- > UefiCpuPkg/Include/Register/ArchitecturalMsr.h | 55 > ++++++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > > diff --git a/UefiCpuPkg/Include/Register/ArchitecturalMsr.h > b/UefiCpuPkg/Include/Register/ArchitecturalMsr.h > index 4f9c103..40c4383 100644 > --- a/UefiCpuPkg/Include/Register/ArchitecturalMsr.h > +++ b/UefiCpuPkg/Include/Register/ArchitecturalMsr.h > @@ -4534,6 +4534,61 @@ typedef union { > UINT64 Uint64; > } MSR_IA32_RTIT_OUTPUT_MASK_PTRS_REGISTER; > > +/** > + Format of ToPA table entries. > +**/ > +typedef union { > + /// > + /// Individual bit fields > + /// > + struct { > + /// > + /// [Bit 0] END. See Section 35.2.6.2, "Table of Physical > Addresses (ToPA)". > + /// > + UINT32 END:1; > + UINT32 Reserved1:1; > + /// > + /// [Bit 2] INT. See Section 35.2.6.2, "Table of Physical > Addresses (ToPA)". > + /// > + UINT32 INT:1; > + UINT32 Reserved2:1; > + /// > + /// [Bit 4] STOP. See Section 35.2.6.2, "Table of Physical > Addresses (ToPA)". > + /// > + UINT32 STOP:1; > + UINT32 Reserved3:1; > + /// > + /// [Bit 6:9] Indicates the size of the associated output > region. See Section > + /// 35.2.6.2, "Table of Physical Addresses (ToPA)". > + /// > + UINT32 Size:4; > + UINT32 Reserved4:2; > + /// > + /// [Bit 12:31] Output Region Base Physical Address low part. > + /// [Bit 12:31] Output Region Base Physical Address [12:63] > value to match. > + /// ATTENTION: The size of the address field is determined by > the processor's > + /// physical-address width (MAXPHYADDR) in bits, as reported > in > + /// CPUID.80000008H:EAX[7:0]. the above part of address > reserved. > + /// True address field is [12:MAXPHYADDR-1], [MAXPHYADDR:63] > is reserved part. > + /// Detail see Section 35.2.6.2, "Table of Physical Addresses > (ToPA)". > + /// > + UINT32 Base:20; > + /// > + /// [Bit 32:63] Output Region Base Physical Address high > part. > + /// [Bit 32:63] Output Region Base Physical Address [12:63] > value to match. > + /// ATTENTION: The size of the address field is determined by > the processor's > + /// physical-address width (MAXPHYADDR) in bits, as reported > in > + /// CPUID.80000008H:EAX[7:0]. the above part of address > reserved. > + /// True address field is [12:MAXPHYADDR-1], [MAXPHYADDR:63] > is reserved part. > + /// Detail see Section 35.2.6.2, "Table of Physical Addresses > (ToPA)". > + /// > + UINT32 BaseHi:32; > + } Bits; > + /// > + /// All bit fields as a 64-bit value > + /// > + UINT64 Uint64; > +} RTIT_TOPA_TABLE_ENTRY; > > /** > Trace Control Register (R/W). If (CPUID.(EAX=3D07H, ECX=3D0):EBX[25] = =3D > 1). > -- > 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel