aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/boot.h
diff options
context:
space:
mode:
authorJoerg Roedel <joro@8bytes.org>2008-08-13 04:07:05 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-13 05:59:18 -0400
commit7b27718bdb1b70166383dec91391df5534d449ee (patch)
tree1268fcfdaa93cd1e9c480334d31154e5cd93b09c /arch/x86/boot/boot.h
parent0ed89b06e49c326bff81d81f24b9ba955eb912d5 (diff)
x86: fix setup code crashes on my old 486 box
yesterday I tried to reactivate my old 486 box and wanted to install a current Linux with latest kernel on it. But it turned out that the latest kernel does not boot because the machine crashes early in the setup code. After some debugging it turned out that the problem is the query_ist() function. If this interrupt with that function is called the machine simply locks up. It looks like a BIOS bug. Looking for a workaround for this problem I wrote the attached patch. It checks for the CPUID instruction and if it is not implemented it does not call the speedstep BIOS function. As far as I know speedstep should be available since some Pentium earliest. Alan Cox observed that it's available since the Pentium II, so cpuid levels 4 and 5 can be excluded altogether. H. Peter Anvin cleaned up the code some more: > Right in concept, but I dislike the implementation (duplication of the > CPU detect code we already have). Could you try this patch and see if > it works for you? which, with a small modification to fix a build error with it the resulting kernel boots on my machine. Signed-off-by: Joerg Roedel <joro@8bytes.org> Signed-off-by: "H. Peter Anvin" <hpa@zytor.com> Cc: <stable@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/boot/boot.h')
-rw-r--r--arch/x86/boot/boot.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index a34b9982c7cb..9d4b4b43d97a 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -25,6 +25,8 @@
25#include <asm/boot.h> 25#include <asm/boot.h>
26#include <asm/setup.h> 26#include <asm/setup.h>
27 27
28#define NCAPINTS 8
29
28/* Useful macros */ 30/* Useful macros */
29#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) 31#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
30 32
@@ -242,6 +244,12 @@ int cmdline_find_option(const char *option, char *buffer, int bufsize);
242int cmdline_find_option_bool(const char *option); 244int cmdline_find_option_bool(const char *option);
243 245
244/* cpu.c, cpucheck.c */ 246/* cpu.c, cpucheck.c */
247struct cpu_features {
248 int level; /* Family, or 64 for x86-64 */
249 int model;
250 u32 flags[NCAPINTS];
251};
252extern struct cpu_features cpu;
245int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr); 253int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr);
246int validate_cpu(void); 254int validate_cpu(void);
247 255