mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
To: <tglx@linutronix.de>, <mingo@redhat.com>, <hpa@zytor.com>,
	<tony.luck@intel.com>, <bp@alien8.de>, <x86@kernel.org>
Cc: <ashok.raj@intel.com>, <linux-kernel@vger.kernel.org>,
	<linux-edac@vger.kernel.org>, <peterz@infradead.org>,
	<luto@kernel.org>, <dvlasenk@redhat.com>,
	<ross.zwisler@linux.intel.com>, <peter.p.waskiewicz.jr@intel.com>,
	<dirk.j.brandewie@intel.com>, Wan Zongshun <Vincent.Wan@amd.com>,
	Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Subject: [PATCH 2/2] x86/cpufeature: Add CLZERO feature
Date: Fri, 23 Oct 2015 06:18:33 -0500	[thread overview]
Message-ID: <1445599113-8792-3-git-send-email-Aravind.Gopalakrishnan@amd.com> (raw)
In-Reply-To: <1445599113-8792-1-git-send-email-Aravind.Gopalakrishnan@amd.com>

CLZERO instruction introduced in AMD Fam17h processors
zero's out a 64 byte cache line specified in RAX.

Add the bit here to allow /proc/cpuinfo to list the feature

Signed-off-by: Wan Zongshun <Vincent.Wan@amd.com>
Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 arch/x86/include/asm/cpufeature.h | 5 ++++-
 arch/x86/kernel/cpu/common.c      | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 9727b3b..82d7c25 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -12,7 +12,7 @@
 #include <asm/disabled-features.h>
 #endif
 
-#define NCAPINTS	13	/* N 32-bit words worth of info */
+#define NCAPINTS	14	/* N 32-bit words worth of info */
 #define NBUGINTS	1	/* N 32-bit bug flags */
 
 /*
@@ -255,6 +255,9 @@
 /* Intel-defined CPU QoS Sub-leaf, CPUID level 0x0000000F:1 (edx), word 12 */
 #define X86_FEATURE_CQM_OCCUP_LLC (12*32+ 0) /* LLC occupancy monitoring if 1 */
 
+/* AMD extended feature extension, CPUID level 0x80000008 (ebx), word 13 */
+#define X86_FEATURE_CLZERO	(13*32+0) /* CLZERO instruction */
+
 /*
  * BUG word(s)
  */
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index de22ea7..4ddd780 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -670,6 +670,7 @@ void get_cpu_cap(struct cpuinfo_x86 *c)
 
 		c->x86_virt_bits = (eax >> 8) & 0xff;
 		c->x86_phys_bits = eax & 0xff;
+		c->x86_capability[13] = cpuid_ebx(0x80000008);
 	}
 #ifdef CONFIG_X86_32
 	else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36))
-- 
2.6.1


  parent reply	other threads:[~2015-10-23 16:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 11:18 [PATCH 0/2] Add new features introduced in AMD Fam17h Aravind Gopalakrishnan
2015-10-23 11:18 ` [PATCH 1/2] x86/mcheck: Add Scalable MCA cpuid bit Aravind Gopalakrishnan
2015-10-23 11:18 ` Aravind Gopalakrishnan [this message]
2015-10-25 10:37   ` [PATCH 2/2] x86/cpufeature: Add CLZERO feature Borislav Petkov
2015-10-26 15:12     ` Aravind Gopalakrishnan
2015-10-26 20:22       ` Borislav Petkov
2015-10-26 21:01         ` [RFC PATCH] x86/cpu: Move sparsely used bit leafs into scattered features (was: Re: [PATCH 2/2] x86/cpufeature: Add CLZERO feature) Borislav Petkov
2015-10-27  2:56           ` Andy Lutomirski
2015-10-27  3:22             ` Borislav Petkov
2015-10-26 22:50         ` [PATCH 2/2] x86/cpufeature: Add CLZERO feature Aravind Gopalakrishnan
2015-10-27  1:09           ` Borislav Petkov
2015-10-27 15:32             ` Aravind Gopalakrishnan
2015-10-27 16:48             ` Aravind Gopalakrishnan
2015-10-27 22:45               ` Borislav Petkov
2015-10-26 15:13     ` Aravind Gopalakrishnan

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=1445599113-8792-3-git-send-email-Aravind.Gopalakrishnan@amd.com \
    --to=aravind.gopalakrishnan@amd.com \
    --cc=Vincent.Wan@amd.com \
    --cc=ashok.raj@intel.com \
    --cc=bp@alien8.de \
    --cc=dirk.j.brandewie@intel.com \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=peterz@infradead.org \
    --cc=ross.zwisler@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --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®