mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Takao Indoh <indou.takao@jp.fujitsu.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH] x86: Clean up files of Intel Processor Trace
Date: Mon, 03 Aug 2015 12:03:13 +0300	[thread overview]
Message-ID: <874mkg7nhq.fsf@ashishki-desk.ger.corp.intel.com> (raw)
In-Reply-To: <1438589411-6104-1-git-send-email-indou.takao@jp.fujitsu.com>

Takao Indoh <indou.takao@jp.fujitsu.com> writes:

> This patch just cleans up some files of Intel Processor Trace, does not
> change its behavior. Removing unused definition, replace a constant
> value with macro, etc.
>
> Signed-off-by: Takao Indoh <indou.takao@jp.fujitsu.com>
> ---
>  arch/x86/kernel/cpu/intel_pt.h            |   33 +++++-----------------------
>  arch/x86/kernel/cpu/perf_event_intel_pt.c |   14 ++++++------
>  2 files changed, 13 insertions(+), 34 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/intel_pt.h b/arch/x86/kernel/cpu/intel_pt.h
> index 1c338b0..6b48ba8 100644
> --- a/arch/x86/kernel/cpu/intel_pt.h
> +++ b/arch/x86/kernel/cpu/intel_pt.h
> @@ -25,32 +25,11 @@
>   */
>  #define TOPA_PMI_MARGIN 512
>  
> -/*
> - * Table of Physical Addresses bits
> - */
> -enum topa_sz {
> -	TOPA_4K	= 0,
> -	TOPA_8K,
> -	TOPA_16K,
> -	TOPA_32K,
> -	TOPA_64K,
> -	TOPA_128K,
> -	TOPA_256K,
> -	TOPA_512K,
> -	TOPA_1MB,
> -	TOPA_2MB,
> -	TOPA_4MB,
> -	TOPA_8MB,
> -	TOPA_16MB,
> -	TOPA_32MB,
> -	TOPA_64MB,
> -	TOPA_128MB,
> -	TOPA_SZ_END,
> -};
> +#define TOPA_SHIFT PAGE_SHIFT

Even though TOPA_SHIFT happens to be the same as PAGE_SHIFT, it is a
property of a separate hardware block, not mmu. PAGE_SHIFT is 12, but
12 is not always PAGE_SHIFT.

> -static inline unsigned int sizes(enum topa_sz tsz)
> +static inline unsigned int sizes(unsigned int tsz)
>  {
> -	return 1 << (tsz + 12);
> +	return 1 << (tsz + TOPA_SHIFT);
>  };
>  
>  struct topa_entry {
> @@ -66,8 +45,8 @@ struct topa_entry {
>  	u64	rsvd4	: 16;
>  };
>  
> -#define TOPA_SHIFT 12
> -#define PT_CPUID_LEAVES 2
> +#define PT_CPUID_LEAVES		2
> +#define PT_CPUID_REGS_NUM	4 /* number of regsters (eax, ebx, ecx, edx) */
>  
>  enum pt_capabilities {
>  	PT_CAP_max_subleaf = 0,
> @@ -79,7 +58,7 @@ enum pt_capabilities {
>  
>  struct pt_pmu {
>  	struct pmu		pmu;
> -	u32			caps[4 * PT_CPUID_LEAVES];
> +	u32			caps[PT_CPUID_REGS_NUM * PT_CPUID_LEAVES];
>  };
>  
>  /**
> diff --git a/arch/x86/kernel/cpu/perf_event_intel_pt.c b/arch/x86/kernel/cpu/perf_event_intel_pt.c
> index 183de71..1e7d89e 100644
> --- a/arch/x86/kernel/cpu/perf_event_intel_pt.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_pt.c
> @@ -37,9 +37,9 @@ static struct pt_pmu pt_pmu;
>  
>  enum cpuid_regs {
>  	CR_EAX = 0,
> +	CR_EBX,
>  	CR_ECX,
> -	CR_EDX,
> -	CR_EBX
> +	CR_EDX
>  };

This doesn't seem necessary.

Thanks,
--
Alex



  reply	other threads:[~2015-08-03  9:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03  8:10 Takao Indoh
2015-08-03  9:03 ` Alexander Shishkin [this message]
2015-08-03  9:08   ` Peter Zijlstra
2015-08-03  9:44     ` Alexander Shishkin
2015-08-04  1:02       ` Takao Indoh
2015-08-03 11:03     ` Borislav Petkov
2015-08-04  1:09       ` Takao Indoh

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-all 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=874mkg7nhq.fsf@ashishki-desk.ger.corp.intel.com \
    --to=alexander.shishkin@linux.intel.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=hpa@zytor.com \
    --cc=indou.takao@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®