* [PATCH 2/2] x86, CPUID: Correct operator precedence when generating mask
@ 2010-09-20 14:06 Borislav Petkov
2010-09-20 15:11 ` H. Peter Anvin
0 siblings, 1 reply; 3+ messages in thread
From: Borislav Petkov @ 2010-09-20 14:06 UTC (permalink / raw)
To: H. Peter Anvin, Ingo Molnar, Thomas Gleixner; +Cc: LKML, x86
NEED_<cpufeature> masks used in the CPU feature testing macros are
cutoff at the last 5 bits to prevent overflow since the cpu feature
words are 32-bit-wide bitfields. Fix this for the PSE and PGE masks too.
This wasn't a real problem since the PSE and PGE bits are nicely < 31.
Cc: stable@kernel.org
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
arch/x86/include/asm/required-features.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/required-features.h b/arch/x86/include/asm/required-features.h
index 6c7fc25..0df924d 100644
--- a/arch/x86/include/asm/required-features.h
+++ b/arch/x86/include/asm/required-features.h
@@ -53,8 +53,8 @@
#define NEED_PSE 0
#define NEED_PGE 0
#else
-#define NEED_PSE (1<<(X86_FEATURE_PSE) & 31)
-#define NEED_PGE (1<<(X86_FEATURE_PGE) & 31)
+#define NEED_PSE (1<<(X86_FEATURE_PSE & 31))
+#define NEED_PGE (1<<(X86_FEATURE_PGE & 31))
#endif
#define NEED_MSR (1<<(X86_FEATURE_MSR & 31))
#define NEED_FXSR (1<<(X86_FEATURE_FXSR & 31))
--
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] 3+ messages in thread
* Re: [PATCH 2/2] x86, CPUID: Correct operator precedence when generating mask
2010-09-20 14:06 [PATCH 2/2] x86, CPUID: Correct operator precedence when generating mask Borislav Petkov
@ 2010-09-20 15:11 ` H. Peter Anvin
2010-09-21 12:00 ` Borislav Petkov
0 siblings, 1 reply; 3+ messages in thread
From: H. Peter Anvin @ 2010-09-20 15:11 UTC (permalink / raw)
To: Borislav Petkov; +Cc: Ingo Molnar, Thomas Gleixner, LKML, x86
On 09/20/2010 07:06 AM, Borislav Petkov wrote:
> NEED_<cpufeature> masks used in the CPU feature testing macros are
> cutoff at the last 5 bits to prevent overflow since the cpu feature
> words are 32-bit-wide bitfields. Fix this for the PSE and PGE masks too.
>
> This wasn't a real problem since the PSE and PGE bits are nicely < 31.
>
> Cc: stable@kernel.org
> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Since this is a non-manifest bug there really doesn't seem to be any
reason to bother stable with it.
-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] 3+ messages in thread
* Re: [PATCH 2/2] x86, CPUID: Correct operator precedence when generating mask
2010-09-20 15:11 ` H. Peter Anvin
@ 2010-09-21 12:00 ` Borislav Petkov
0 siblings, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2010-09-21 12:00 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:11:43AM -0400
> Since this is a non-manifest bug there really doesn't seem to be any
> reason to bother stable with it.
--
From: Borislav Petkov <borislav.petkov@amd.com>
Date: Tue Sep 21 13:56:59 CEST 2010
Subject: [PATCH] x86, CPUID: Correct operator precedence when generating mask
NEED_<cpufeature> masks used in the CPU feature testing macros are
cutoff at the last 5 bits to prevent overflow since the cpu feature
words are 32-bit-wide bitfields. Fix this for the PSE and PGE masks too.
This wasn't a real problem since the PSE and PGE bits are nicely < 31.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
arch/x86/include/asm/required-features.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/required-features.h b/arch/x86/include/asm/required-features.h
index 6c7fc25..0df924d 100644
--- a/arch/x86/include/asm/required-features.h
+++ b/arch/x86/include/asm/required-features.h
@@ -53,8 +53,8 @@
#define NEED_PSE 0
#define NEED_PGE 0
#else
-#define NEED_PSE (1<<(X86_FEATURE_PSE) & 31)
-#define NEED_PGE (1<<(X86_FEATURE_PGE) & 31)
+#define NEED_PSE (1<<(X86_FEATURE_PSE & 31))
+#define NEED_PGE (1<<(X86_FEATURE_PGE & 31))
#endif
#define NEED_MSR (1<<(X86_FEATURE_MSR & 31))
#define NEED_FXSR (1<<(X86_FEATURE_FXSR & 31))
--
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] 3+ messages in thread
end of thread, other threads:[~2010-09-21 12:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20 14:06 [PATCH 2/2] x86, CPUID: Correct operator precedence when generating mask Borislav Petkov
2010-09-20 15:11 ` H. Peter Anvin
2010-09-21 12:00 ` Borislav Petkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox