public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] x86, cpuid: Unbreak CPB CPUID feature
@ 2010-09-20 14:05 Borislav Petkov
  2010-09-20 15:10 ` H. Peter Anvin
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2010-09-20 14:05 UTC (permalink / raw)
  To: H. Peter Anvin, Ingo Molnar, Thomas Gleixner; +Cc: LKML, x86

5958f1d5d722df7a9e5d129676614a8e5219bacd added mistakenly the CPB bit to
the common scattered CPUID features. Move it to AMD-only code where it
belongs.

Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
 arch/x86/kernel/cpu/amd.c       |    5 +++++
 arch/x86/kernel/cpu/scattered.c |    1 -
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index ba5f62f..7c7b798 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -565,6 +565,11 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
 		}
 	}
 #endif
+
+	if (c->extended_cpuid_level >= 0x80000007) {
+		if (cpuid_edx(0x80000007) & BIT(9))
+			set_cpu_cap(c, X86_FEATURE_CPB);
+	}
 }
 
 #ifdef CONFIG_X86_32
diff --git a/arch/x86/kernel/cpu/scattered.c b/arch/x86/kernel/cpu/scattered.c
index 34b4dad..fd5654a 100644
--- a/arch/x86/kernel/cpu/scattered.c
+++ b/arch/x86/kernel/cpu/scattered.c
@@ -38,7 +38,6 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
 		{ X86_FEATURE_APERFMPERF,	CR_ECX, 0, 0x00000006, 0 },
 		{ X86_FEATURE_EPB,		CR_ECX, 3, 0x00000006, 0 },
 		{ X86_FEATURE_XSAVEOPT,		CR_EAX,	0, 0x0000000d, 1 },
-		{ X86_FEATURE_CPB,		CR_EDX, 9, 0x80000007, 0 },
 		{ X86_FEATURE_NPT,		CR_EDX, 0, 0x8000000a, 0 },
 		{ X86_FEATURE_LBRV,		CR_EDX, 1, 0x8000000a, 0 },
 		{ X86_FEATURE_SVML,		CR_EDX, 2, 0x8000000a, 0 },
-- 
1.7.1


-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] x86, cpuid: Unbreak CPB CPUID feature
  2010-09-20 14:05 [PATCH 1/2] x86, cpuid: Unbreak CPB CPUID feature Borislav Petkov
@ 2010-09-20 15:10 ` H. Peter Anvin
  2010-09-20 15:20   ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: H. Peter Anvin @ 2010-09-20 15:10 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Ingo Molnar, Thomas Gleixner, LKML, x86

On 09/20/2010 07:05 AM, Borislav Petkov wrote:
> 5958f1d5d722df7a9e5d129676614a8e5219bacd added mistakenly the CPB bit to
> the common scattered CPUID features. Move it to AMD-only code where it
> belongs.

I already asked for more information about this.  This patch, without a
further description, makes absolutely no sense, and is furthermore
implemented poorly -- I really don't want more ad hoc code if it can be
avoided.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] x86, cpuid: Unbreak CPB CPUID feature
  2010-09-20 15:10 ` H. Peter Anvin
@ 2010-09-20 15:20   ` Borislav Petkov
  2010-09-20 15:25     ` H. Peter Anvin
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2010-09-20 15:20 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Ingo Molnar, Thomas Gleixner, LKML, x86

From: "H. Peter Anvin" <hpa@zytor.com>
Date: Mon, Sep 20, 2010 at 11:10:49AM -0400

> On 09/20/2010 07:05 AM, Borislav Petkov wrote:
> > 5958f1d5d722df7a9e5d129676614a8e5219bacd added mistakenly the CPB bit to
> > the common scattered CPUID features. Move it to AMD-only code where it
> > belongs.
> 
> I already asked for more information about this.

?? When? I prepped this one a couple of hours ago... Am I missing something?

> This patch, without a further description, makes absolutely no sense,
> and is furthermore implemented poorly -- I really don't want more ad
> hoc code if it can be avoided.

Well, I use the feature bit in powernow-k8.c. We don't need to advertize
it in /proc/cpuinfo per se if that's what you prefer?

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
General Managers: Alberto Bozzo, Andrew Bowd
Registration: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] x86, cpuid: Unbreak CPB CPUID feature
  2010-09-20 15:20   ` Borislav Petkov
@ 2010-09-20 15:25     ` H. Peter Anvin
  0 siblings, 0 replies; 4+ messages in thread
From: H. Peter Anvin @ 2010-09-20 15:25 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Ingo Molnar, Thomas Gleixner, LKML, x86

On 09/20/2010 08:20 AM, Borislav Petkov wrote:
> From: "H. Peter Anvin" <hpa@zytor.com>
> Date: Mon, Sep 20, 2010 at 11:10:49AM -0400
> 
>> On 09/20/2010 07:05 AM, Borislav Petkov wrote:
>>> 5958f1d5d722df7a9e5d129676614a8e5219bacd added mistakenly the CPB bit to
>>> the common scattered CPUID features. Move it to AMD-only code where it
>>> belongs.
>>
>> I already asked for more information about this.
> 
> ?? When? I prepped this one a couple of hours ago... Am I missing something?
> 

Looks like Bugzilla didn't register the reply.  I have resent it.

>> This patch, without a further description, makes absolutely no sense,
>> and is furthermore implemented poorly -- I really don't want more ad
>> hoc code if it can be avoided.
> 
> Well, I use the feature bit in powernow-k8.c. We don't need to advertize
> it in /proc/cpuinfo per se if that's what you prefer?

No, I'm asking why it's being moved away from the common area -- I don't
see any evidence that it causes the reported failure scenario, and it
complicates the code needlessly.

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-20 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20 14:05 [PATCH 1/2] x86, cpuid: Unbreak CPB CPUID feature Borislav Petkov
2010-09-20 15:10 ` H. Peter Anvin
2010-09-20 15:20   ` Borislav Petkov
2010-09-20 15:25     ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox