public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Kinney, Michael D" <michael.d.kinney@intel.com>
To: "Dong, Eric" <eric.dong@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "Ni, Ruiyu" <ruiyu.ni@intel.com>
Subject: Re: [Patch v2 1/2] UefiCpuPkg/ArchitecturalMsr.h: Add RTIT TOPA table entry definition.
Date: Wed, 23 Aug 2017 23:44:45 +0000	[thread overview]
Message-ID: <E92EE9817A31E24EB0585FDF735412F5A7D84DD9@ORSMSX113.amr.corp.intel.com> (raw)
In-Reply-To: <1503026917-13296-2-git-send-email-eric.dong@intel.com>

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 ArchitecturalMsr.h next to RTIT_TOPA_TABLE_ENTRY.
Maybe rename it to RTIT_TOPA_MEMORY_SIZE with enum names
that start with "RtitTopaMemorySize".

The Copyright date in ArchitecturalMsr.h also needs to 
be updated.

The #define for MAX_TOPA_ENTRY_COUNT need a comment block
that describes what 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 entry with the END bit set to 1, so 2 entries are required
to use a single valid entry.

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.

ProcTrace.c: I am confused by the programming
MSR_IA32_RTIT_OUTPUT_MASK_PTRS to 0x7f.  That sets a Reserved
field to all 1s.

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.  Do we really need to set the address field 
in entry #1?  Isn't setting END to 1 enough?

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 <michael.d.kinney@intel.com>; Ni, Ruiyu
> <ruiyu.ni@intel.com>
> 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 <michael.d.kinney@intel.com>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Eric Dong <eric.dong@intel.com>
> ---
>  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=07H,
> ECX=0):EBX[25] = 1).
> --
> 2.7.0.windows.1



  reply	other threads:[~2017-08-23 23:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18  3:28 [Patch v2 0/2] Add new definition for TOPA table entry Eric Dong
2017-08-18  3:28 ` [Patch v2 1/2] UefiCpuPkg/ArchitecturalMsr.h: Add RTIT TOPA table entry definition Eric Dong
2017-08-23 23:44   ` Kinney, Michael D [this message]
2017-08-24  3:21     ` Dong, Eric
2017-08-24  3:32       ` Dong, Eric
2017-08-18  3:28 ` [Patch v2 2/2] UefiCpuPkg/CpuCommonFeaturesLib: Use MSR data structure when change MSR value Eric Dong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E92EE9817A31E24EB0585FDF735412F5A7D84DD9@ORSMSX113.amr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox