mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, vince@deater.net,
	eranian@google.com, Arnaldo Carvalho de Melo <acme@infradead.org>
Subject: Re: [PATCH] perf/x86/intel/pt: Use boot_cpu_has() because it's there
Date: Wed, 6 Apr 2016 18:57:38 +0200	[thread overview]
Message-ID: <20160406165738.GK12070@pd.tnic> (raw)
In-Reply-To: <1459953307-14372-1-git-send-email-alexander.shishkin@linux.intel.com>

On Wed, Apr 06, 2016 at 05:35:07PM +0300, Alexander Shishkin wrote:
> At the moment, initialization path is using test_cpu_cap(&boot_cpu_data),
> to detect PT, which is just open coding boot_cpu_has(). Use the latter
> instead.
> 
> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> ---
>  arch/x86/events/intel/pt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c
> index 32b613e863..7c7f09a8fe 100644
> --- a/arch/x86/events/intel/pt.c
> +++ b/arch/x86/events/intel/pt.c
> @@ -1159,7 +1159,7 @@ static __init int pt_init(void)
>  
>  	BUILD_BUG_ON(sizeof(struct topa) > PAGE_SIZE);
>  
> -	if (!test_cpu_cap(&boot_cpu_data, X86_FEATURE_INTEL_PT))
> +	if (!boot_cpu_has(X86_FEATURE_INTEL_PT))
>  		return -ENODEV;
>  
>  	get_online_cpus();
> -- 

Acked-by: Borislav Petkov <bp@suse.de>

Btw, there's another wonderful gem in the tree:

arch/x86/kernel/cpu/cyrix.c:201:        if (test_cpu_cap(c, 1*32+24)) {

Jeez, and a naked number at that which is not even a define in
arch/x86/include/asm/cpufeatures.h

Ah, I need to look at the whole thing:

        /* Cyrix used bit 24 in extended (AMD) CPUID for Cyrix MMX extensions */
        if (test_cpu_cap(c, 1*32+24)) {
                clear_cpu_cap(c, 1*32+24);
                set_cpu_cap(c, X86_FEATURE_CXMMX);
        }

So it is actually a correction for "smart" hw.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

  reply	other threads:[~2016-04-06 16:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 14:35 Alexander Shishkin
2016-04-06 16:57 ` Borislav Petkov [this message]
2016-04-13 11:34 ` [tip:perf/core] " tip-bot for Alexander Shishkin

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=20160406165738.GK12070@pd.tnic \
    --to=bp@alien8.de \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@infradead.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=vince@deater.net \
    /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®