diff options
Diffstat (limited to 'arch/i386')
28 files changed, 229 insertions, 139 deletions
diff --git a/arch/i386/boot/boot.h b/arch/i386/boot/boot.h index dec70c9b6050..20bab9431acb 100644 --- a/arch/i386/boot/boot.h +++ b/arch/i386/boot/boot.h | |||
@@ -87,7 +87,7 @@ static inline void set_fs(u16 seg) | |||
87 | static inline u16 fs(void) | 87 | static inline u16 fs(void) |
88 | { | 88 | { |
89 | u16 seg; | 89 | u16 seg; |
90 | asm("movw %%fs,%0" : "=rm" (seg)); | 90 | asm volatile("movw %%fs,%0" : "=rm" (seg)); |
91 | return seg; | 91 | return seg; |
92 | } | 92 | } |
93 | 93 | ||
@@ -98,7 +98,7 @@ static inline void set_gs(u16 seg) | |||
98 | static inline u16 gs(void) | 98 | static inline u16 gs(void) |
99 | { | 99 | { |
100 | u16 seg; | 100 | u16 seg; |
101 | asm("movw %%gs,%0" : "=rm" (seg)); | 101 | asm volatile("movw %%gs,%0" : "=rm" (seg)); |
102 | return seg; | 102 | return seg; |
103 | } | 103 | } |
104 | 104 | ||
@@ -107,19 +107,19 @@ typedef unsigned int addr_t; | |||
107 | static inline u8 rdfs8(addr_t addr) | 107 | static inline u8 rdfs8(addr_t addr) |
108 | { | 108 | { |
109 | u8 v; | 109 | u8 v; |
110 | asm("movb %%fs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr)); | 110 | asm volatile("movb %%fs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr)); |
111 | return v; | 111 | return v; |
112 | } | 112 | } |
113 | static inline u16 rdfs16(addr_t addr) | 113 | static inline u16 rdfs16(addr_t addr) |
114 | { | 114 | { |
115 | u16 v; | 115 | u16 v; |
116 | asm("movw %%fs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr)); | 116 | asm volatile("movw %%fs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr)); |
117 | return v; | 117 | return v; |
118 | } | 118 | } |
119 | static inline u32 rdfs32(addr_t addr) | 119 | static inline u32 rdfs32(addr_t addr) |
120 | { | 120 | { |
121 | u32 v; | 121 | u32 v; |
122 | asm("movl %%fs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr)); | 122 | asm volatile("movl %%fs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr)); |
123 | return v; | 123 | return v; |
124 | } | 124 | } |
125 | 125 | ||
@@ -139,19 +139,19 @@ static inline void wrfs32(u32 v, addr_t addr) | |||
139 | static inline u8 rdgs8(addr_t addr) | 139 | static inline u8 rdgs8(addr_t addr) |
140 | { | 140 | { |
141 | u8 v; | 141 | u8 v; |
142 | asm("movb %%gs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr)); | 142 | asm volatile("movb %%gs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr)); |
143 | return v; | 143 | return v; |
144 | } | 144 | } |
145 | static inline u16 rdgs16(addr_t addr) | 145 | static inline u16 rdgs16(addr_t addr) |
146 | { | 146 | { |
147 | u16 v; | 147 | u16 v; |
148 | asm("movw %%gs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr)); | 148 | asm volatile("movw %%gs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr)); |
149 | return v; | 149 | return v; |
150 | } | 150 | } |
151 | static inline u32 rdgs32(addr_t addr) | 151 | static inline u32 rdgs32(addr_t addr) |
152 | { | 152 | { |
153 | u32 v; | 153 | u32 v; |
154 | asm("movl %%gs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr)); | 154 | asm volatile("movl %%gs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr)); |
155 | return v; | 155 | return v; |
156 | } | 156 | } |
157 | 157 | ||
@@ -180,15 +180,15 @@ static inline int memcmp(const void *s1, const void *s2, size_t len) | |||
180 | static inline int memcmp_fs(const void *s1, addr_t s2, size_t len) | 180 | static inline int memcmp_fs(const void *s1, addr_t s2, size_t len) |
181 | { | 181 | { |
182 | u8 diff; | 182 | u8 diff; |
183 | asm("fs; repe; cmpsb; setnz %0" | 183 | asm volatile("fs; repe; cmpsb; setnz %0" |
184 | : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len)); | 184 | : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len)); |
185 | return diff; | 185 | return diff; |
186 | } | 186 | } |
187 | static inline int memcmp_gs(const void *s1, addr_t s2, size_t len) | 187 | static inline int memcmp_gs(const void *s1, addr_t s2, size_t len) |
188 | { | 188 | { |
189 | u8 diff; | 189 | u8 diff; |
190 | asm("gs; repe; cmpsb; setnz %0" | 190 | asm volatile("gs; repe; cmpsb; setnz %0" |
191 | : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len)); | 191 | : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len)); |
192 | return diff; | 192 | return diff; |
193 | } | 193 | } |
194 | 194 | ||
diff --git a/arch/i386/boot/cpucheck.c b/arch/i386/boot/cpucheck.c index 991e8ceae1de..e655a89c5510 100644 --- a/arch/i386/boot/cpucheck.c +++ b/arch/i386/boot/cpucheck.c | |||
@@ -96,7 +96,8 @@ static int has_fpu(void) | |||
96 | asm volatile("movl %0,%%cr0" : : "r" (cr0)); | 96 | asm volatile("movl %0,%%cr0" : : "r" (cr0)); |
97 | } | 97 | } |
98 | 98 | ||
99 | asm("fninit ; fnstsw %0 ; fnstcw %1" : "+m" (fsw), "+m" (fcw)); | 99 | asm volatile("fninit ; fnstsw %0 ; fnstcw %1" |
100 | : "+m" (fsw), "+m" (fcw)); | ||
100 | 101 | ||
101 | return fsw == 0 && (fcw & 0x103f) == 0x003f; | 102 | return fsw == 0 && (fcw & 0x103f) == 0x003f; |
102 | } | 103 | } |
diff --git a/arch/i386/boot/edd.c b/arch/i386/boot/edd.c index 82b5c846a194..bd138e442ec2 100644 --- a/arch/i386/boot/edd.c +++ b/arch/i386/boot/edd.c | |||
@@ -30,9 +30,9 @@ static int read_mbr(u8 devno, void *buf) | |||
30 | cx = 0x0001; /* Sector 0-0-1 */ | 30 | cx = 0x0001; /* Sector 0-0-1 */ |
31 | dx = devno; | 31 | dx = devno; |
32 | bx = (size_t)buf; | 32 | bx = (size_t)buf; |
33 | asm("pushfl; stc; int $0x13; setc %%al; popfl" | 33 | asm volatile("pushfl; stc; int $0x13; setc %%al; popfl" |
34 | : "+a" (ax), "+c" (cx), "+d" (dx), "+b" (bx) | 34 | : "+a" (ax), "+c" (cx), "+d" (dx), "+b" (bx) |
35 | : : "esi", "edi", "memory"); | 35 | : : "esi", "edi", "memory"); |
36 | 36 | ||
37 | return -(u8)ax; /* 0 or -1 */ | 37 | return -(u8)ax; /* 0 or -1 */ |
38 | } | 38 | } |
diff --git a/arch/i386/boot/header.S b/arch/i386/boot/header.S index 7f4a2c53bd76..f3140e596d40 100644 --- a/arch/i386/boot/header.S +++ b/arch/i386/boot/header.S | |||
@@ -275,7 +275,7 @@ die: | |||
275 | hlt | 275 | hlt |
276 | jmp die | 276 | jmp die |
277 | 277 | ||
278 | .size die, .-due | 278 | .size die, .-die |
279 | 279 | ||
280 | .section ".initdata", "a" | 280 | .section ".initdata", "a" |
281 | setup_corrupt: | 281 | setup_corrupt: |
diff --git a/arch/i386/boot/memory.c b/arch/i386/boot/memory.c index 1a2e62db8bed..378353956b5d 100644 --- a/arch/i386/boot/memory.c +++ b/arch/i386/boot/memory.c | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | static int detect_memory_e820(void) | 21 | static int detect_memory_e820(void) |
22 | { | 22 | { |
23 | int count = 0; | ||
23 | u32 next = 0; | 24 | u32 next = 0; |
24 | u32 size, id; | 25 | u32 size, id; |
25 | u8 err; | 26 | u8 err; |
@@ -27,20 +28,33 @@ static int detect_memory_e820(void) | |||
27 | 28 | ||
28 | do { | 29 | do { |
29 | size = sizeof(struct e820entry); | 30 | size = sizeof(struct e820entry); |
30 | id = SMAP; | 31 | |
32 | /* Important: %edx is clobbered by some BIOSes, | ||
33 | so it must be either used for the error output | ||
34 | or explicitly marked clobbered. */ | ||
31 | asm("int $0x15; setc %0" | 35 | asm("int $0x15; setc %0" |
32 | : "=am" (err), "+b" (next), "+d" (id), "+c" (size), | 36 | : "=d" (err), "+b" (next), "=a" (id), "+c" (size), |
33 | "=m" (*desc) | 37 | "=m" (*desc) |
34 | : "D" (desc), "a" (0xe820)); | 38 | : "D" (desc), "d" (SMAP), "a" (0xe820)); |
39 | |||
40 | /* Some BIOSes stop returning SMAP in the middle of | ||
41 | the search loop. We don't know exactly how the BIOS | ||
42 | screwed up the map at that point, we might have a | ||
43 | partial map, the full map, or complete garbage, so | ||
44 | just return failure. */ | ||
45 | if (id != SMAP) { | ||
46 | count = 0; | ||
47 | break; | ||
48 | } | ||
35 | 49 | ||
36 | if (err || id != SMAP) | 50 | if (err) |
37 | break; | 51 | break; |
38 | 52 | ||
39 | boot_params.e820_entries++; | 53 | count++; |
40 | desc++; | 54 | desc++; |
41 | } while (next && boot_params.e820_entries < E820MAX); | 55 | } while (next && count < E820MAX); |
42 | 56 | ||
43 | return boot_params.e820_entries; | 57 | return boot_params.e820_entries = count; |
44 | } | 58 | } |
45 | 59 | ||
46 | static int detect_memory_e801(void) | 60 | static int detect_memory_e801(void) |
@@ -89,11 +103,16 @@ static int detect_memory_88(void) | |||
89 | 103 | ||
90 | int detect_memory(void) | 104 | int detect_memory(void) |
91 | { | 105 | { |
106 | int err = -1; | ||
107 | |||
92 | if (detect_memory_e820() > 0) | 108 | if (detect_memory_e820() > 0) |
93 | return 0; | 109 | err = 0; |
94 | 110 | ||
95 | if (!detect_memory_e801()) | 111 | if (!detect_memory_e801()) |
96 | return 0; | 112 | err = 0; |
113 | |||
114 | if (!detect_memory_88()) | ||
115 | err = 0; | ||
97 | 116 | ||
98 | return detect_memory_88(); | 117 | return err; |
99 | } | 118 | } |
diff --git a/arch/i386/boot/pm.c b/arch/i386/boot/pm.c index 6be9ca811d17..09fb342cc62e 100644 --- a/arch/i386/boot/pm.c +++ b/arch/i386/boot/pm.c | |||
@@ -122,7 +122,11 @@ static void setup_gdt(void) | |||
122 | /* DS: data, read/write, 4 GB, base 0 */ | 122 | /* DS: data, read/write, 4 GB, base 0 */ |
123 | [GDT_ENTRY_BOOT_DS] = GDT_ENTRY(0xc093, 0, 0xfffff), | 123 | [GDT_ENTRY_BOOT_DS] = GDT_ENTRY(0xc093, 0, 0xfffff), |
124 | }; | 124 | }; |
125 | struct gdt_ptr gdt; | 125 | /* Xen HVM incorrectly stores a pointer to the gdt_ptr, instead |
126 | of the gdt_ptr contents. Thus, make it static so it will | ||
127 | stay in memory, at least long enough that we switch to the | ||
128 | proper kernel GDT. */ | ||
129 | static struct gdt_ptr gdt; | ||
126 | 130 | ||
127 | gdt.len = sizeof(boot_gdt)-1; | 131 | gdt.len = sizeof(boot_gdt)-1; |
128 | gdt.ptr = (u32)&boot_gdt + (ds() << 4); | 132 | gdt.ptr = (u32)&boot_gdt + (ds() << 4); |
diff --git a/arch/i386/boot/tty.c b/arch/i386/boot/tty.c index 9c668aad3515..f3f14bd26371 100644 --- a/arch/i386/boot/tty.c +++ b/arch/i386/boot/tty.c | |||
@@ -54,9 +54,9 @@ static u8 gettime(void) | |||
54 | u16 ax = 0x0200; | 54 | u16 ax = 0x0200; |
55 | u16 cx, dx; | 55 | u16 cx, dx; |
56 | 56 | ||
57 | asm("int $0x1a" | 57 | asm volatile("int $0x1a" |
58 | : "+a" (ax), "=c" (cx), "=d" (dx) | 58 | : "+a" (ax), "=c" (cx), "=d" (dx) |
59 | : : "ebx", "esi", "edi"); | 59 | : : "ebx", "esi", "edi"); |
60 | 60 | ||
61 | return dx >> 8; | 61 | return dx >> 8; |
62 | } | 62 | } |
@@ -67,7 +67,7 @@ static u8 gettime(void) | |||
67 | int getchar(void) | 67 | int getchar(void) |
68 | { | 68 | { |
69 | u16 ax = 0; | 69 | u16 ax = 0; |
70 | asm("int $0x16" : "+a" (ax)); | 70 | asm volatile("int $0x16" : "+a" (ax)); |
71 | 71 | ||
72 | return ax & 0xff; | 72 | return ax & 0xff; |
73 | } | 73 | } |
@@ -75,9 +75,9 @@ int getchar(void) | |||
75 | static int kbd_pending(void) | 75 | static int kbd_pending(void) |
76 | { | 76 | { |
77 | u8 pending; | 77 | u8 pending; |
78 | asm("int $0x16; setnz %0" | 78 | asm volatile("int $0x16; setnz %0" |
79 | : "=rm" (pending) | 79 | : "=rm" (pending) |
80 | : "a" (0x0100)); | 80 | : "a" (0x0100)); |
81 | return pending; | 81 | return pending; |
82 | } | 82 | } |
83 | 83 | ||
diff --git a/arch/i386/boot/video-vesa.c b/arch/i386/boot/video-vesa.c index f1bc71e948cf..192190710710 100644 --- a/arch/i386/boot/video-vesa.c +++ b/arch/i386/boot/video-vesa.c | |||
@@ -29,7 +29,7 @@ static void vesa_store_mode_params_graphics(void); | |||
29 | static int vesa_probe(void) | 29 | static int vesa_probe(void) |
30 | { | 30 | { |
31 | #if defined(CONFIG_VIDEO_VESA) || defined(CONFIG_FIRMWARE_EDID) | 31 | #if defined(CONFIG_VIDEO_VESA) || defined(CONFIG_FIRMWARE_EDID) |
32 | u16 ax; | 32 | u16 ax, cx, di; |
33 | u16 mode; | 33 | u16 mode; |
34 | addr_t mode_ptr; | 34 | addr_t mode_ptr; |
35 | struct mode_info *mi; | 35 | struct mode_info *mi; |
@@ -39,9 +39,11 @@ static int vesa_probe(void) | |||
39 | 39 | ||
40 | vginfo.signature = VBE2_MAGIC; | 40 | vginfo.signature = VBE2_MAGIC; |
41 | 41 | ||
42 | /* Optimistically assume a VESA BIOS is register-clean... */ | ||
43 | ax = 0x4f00; | 42 | ax = 0x4f00; |
44 | asm("int $0x10" : "+a" (ax), "=m" (vginfo) : "D" (&vginfo)); | 43 | di = (size_t)&vginfo; |
44 | asm(INT10 | ||
45 | : "+a" (ax), "+D" (di), "=m" (vginfo) | ||
46 | : : "ebx", "ecx", "edx", "esi"); | ||
45 | 47 | ||
46 | if (ax != 0x004f || | 48 | if (ax != 0x004f || |
47 | vginfo.signature != VESA_MAGIC || | 49 | vginfo.signature != VESA_MAGIC || |
@@ -64,9 +66,11 @@ static int vesa_probe(void) | |||
64 | memset(&vminfo, 0, sizeof vminfo); /* Just in case... */ | 66 | memset(&vminfo, 0, sizeof vminfo); /* Just in case... */ |
65 | 67 | ||
66 | ax = 0x4f01; | 68 | ax = 0x4f01; |
67 | asm("int $0x10" | 69 | cx = mode; |
68 | : "+a" (ax), "=m" (vminfo) | 70 | di = (size_t)&vminfo; |
69 | : "c" (mode), "D" (&vminfo)); | 71 | asm(INT10 |
72 | : "+a" (ax), "+c" (cx), "+D" (di), "=m" (vminfo) | ||
73 | : : "ebx", "edx", "esi"); | ||
70 | 74 | ||
71 | if (ax != 0x004f) | 75 | if (ax != 0x004f) |
72 | continue; | 76 | continue; |
@@ -102,16 +106,18 @@ static int vesa_probe(void) | |||
102 | 106 | ||
103 | static int vesa_set_mode(struct mode_info *mode) | 107 | static int vesa_set_mode(struct mode_info *mode) |
104 | { | 108 | { |
105 | u16 ax; | 109 | u16 ax, bx, cx, di; |
106 | int is_graphic; | 110 | int is_graphic; |
107 | u16 vesa_mode = mode->mode - VIDEO_FIRST_VESA; | 111 | u16 vesa_mode = mode->mode - VIDEO_FIRST_VESA; |
108 | 112 | ||
109 | memset(&vminfo, 0, sizeof vminfo); /* Just in case... */ | 113 | memset(&vminfo, 0, sizeof vminfo); /* Just in case... */ |
110 | 114 | ||
111 | ax = 0x4f01; | 115 | ax = 0x4f01; |
112 | asm("int $0x10" | 116 | cx = vesa_mode; |
113 | : "+a" (ax), "=m" (vminfo) | 117 | di = (size_t)&vminfo; |
114 | : "c" (vesa_mode), "D" (&vminfo)); | 118 | asm(INT10 |
119 | : "+a" (ax), "+c" (cx), "+D" (di), "=m" (vminfo) | ||
120 | : : "ebx", "edx", "esi"); | ||
115 | 121 | ||
116 | if (ax != 0x004f) | 122 | if (ax != 0x004f) |
117 | return -1; | 123 | return -1; |
@@ -129,9 +135,11 @@ static int vesa_set_mode(struct mode_info *mode) | |||
129 | 135 | ||
130 | 136 | ||
131 | ax = 0x4f02; | 137 | ax = 0x4f02; |
132 | asm volatile("int $0x10" | 138 | bx = vesa_mode; |
133 | : "+a" (ax) | 139 | di = 0; |
134 | : "b" (vesa_mode), "D" (0)); | 140 | asm volatile(INT10 |
141 | : "+a" (ax), "+b" (bx), "+D" (di) | ||
142 | : : "ecx", "edx", "esi"); | ||
135 | 143 | ||
136 | if (ax != 0x004f) | 144 | if (ax != 0x004f) |
137 | return -1; | 145 | return -1; |
diff --git a/arch/i386/boot/video-vga.c b/arch/i386/boot/video-vga.c index 700d09a9c9b3..aef02f9ec0c1 100644 --- a/arch/i386/boot/video-vga.c +++ b/arch/i386/boot/video-vga.c | |||
@@ -47,16 +47,16 @@ static u8 vga_set_basic_mode(void) | |||
47 | 47 | ||
48 | #ifdef CONFIG_VIDEO_400_HACK | 48 | #ifdef CONFIG_VIDEO_400_HACK |
49 | if (adapter >= ADAPTER_VGA) { | 49 | if (adapter >= ADAPTER_VGA) { |
50 | asm(INT10 | 50 | asm volatile(INT10 |
51 | : : "a" (0x1202), "b" (0x0030) | 51 | : : "a" (0x1202), "b" (0x0030) |
52 | : "ecx", "edx", "esi", "edi"); | 52 | : "ecx", "edx", "esi", "edi"); |
53 | } | 53 | } |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | ax = 0x0f00; | 56 | ax = 0x0f00; |
57 | asm(INT10 | 57 | asm volatile(INT10 |
58 | : "+a" (ax) | 58 | : "+a" (ax) |
59 | : : "ebx", "ecx", "edx", "esi", "edi"); | 59 | : : "ebx", "ecx", "edx", "esi", "edi"); |
60 | 60 | ||
61 | mode = (u8)ax; | 61 | mode = (u8)ax; |
62 | 62 | ||
@@ -73,9 +73,10 @@ static u8 vga_set_basic_mode(void) | |||
73 | mode = 3; | 73 | mode = 3; |
74 | 74 | ||
75 | /* Set the mode */ | 75 | /* Set the mode */ |
76 | ax = mode; | ||
76 | asm volatile(INT10 | 77 | asm volatile(INT10 |
77 | : : "a" (mode) | 78 | : "+a" (ax) |
78 | : "ebx", "ecx", "edx", "esi", "edi"); | 79 | : : "ebx", "ecx", "edx", "esi", "edi"); |
79 | do_restore = 1; | 80 | do_restore = 1; |
80 | return mode; | 81 | return mode; |
81 | } | 82 | } |
diff --git a/arch/i386/boot/video.c b/arch/i386/boot/video.c index 693f20d3102e..e4ba897bf9a3 100644 --- a/arch/i386/boot/video.c +++ b/arch/i386/boot/video.c | |||
@@ -147,7 +147,7 @@ int mode_defined(u16 mode) | |||
147 | } | 147 | } |
148 | 148 | ||
149 | /* Set mode (without recalc) */ | 149 | /* Set mode (without recalc) */ |
150 | static int raw_set_mode(u16 mode) | 150 | static int raw_set_mode(u16 mode, u16 *real_mode) |
151 | { | 151 | { |
152 | int nmode, i; | 152 | int nmode, i; |
153 | struct card_info *card; | 153 | struct card_info *card; |
@@ -165,8 +165,10 @@ static int raw_set_mode(u16 mode) | |||
165 | 165 | ||
166 | if ((mode == nmode && visible) || | 166 | if ((mode == nmode && visible) || |
167 | mode == mi->mode || | 167 | mode == mi->mode || |
168 | mode == (mi->y << 8)+mi->x) | 168 | mode == (mi->y << 8)+mi->x) { |
169 | *real_mode = mi->mode; | ||
169 | return card->set_mode(mi); | 170 | return card->set_mode(mi); |
171 | } | ||
170 | 172 | ||
171 | if (visible) | 173 | if (visible) |
172 | nmode++; | 174 | nmode++; |
@@ -178,7 +180,7 @@ static int raw_set_mode(u16 mode) | |||
178 | if (mode >= card->xmode_first && | 180 | if (mode >= card->xmode_first && |
179 | mode < card->xmode_first+card->xmode_n) { | 181 | mode < card->xmode_first+card->xmode_n) { |
180 | struct mode_info mix; | 182 | struct mode_info mix; |
181 | mix.mode = mode; | 183 | *real_mode = mix.mode = mode; |
182 | mix.x = mix.y = 0; | 184 | mix.x = mix.y = 0; |
183 | return card->set_mode(&mix); | 185 | return card->set_mode(&mix); |
184 | } | 186 | } |
@@ -223,6 +225,7 @@ static void vga_recalc_vertical(void) | |||
223 | static int set_mode(u16 mode) | 225 | static int set_mode(u16 mode) |
224 | { | 226 | { |
225 | int rv; | 227 | int rv; |
228 | u16 real_mode; | ||
226 | 229 | ||
227 | /* Very special mode numbers... */ | 230 | /* Very special mode numbers... */ |
228 | if (mode == VIDEO_CURRENT_MODE) | 231 | if (mode == VIDEO_CURRENT_MODE) |
@@ -232,13 +235,16 @@ static int set_mode(u16 mode) | |||
232 | else if (mode == EXTENDED_VGA) | 235 | else if (mode == EXTENDED_VGA) |
233 | mode = VIDEO_8POINT; | 236 | mode = VIDEO_8POINT; |
234 | 237 | ||
235 | rv = raw_set_mode(mode); | 238 | rv = raw_set_mode(mode, &real_mode); |
236 | if (rv) | 239 | if (rv) |
237 | return rv; | 240 | return rv; |
238 | 241 | ||
239 | if (mode & VIDEO_RECALC) | 242 | if (mode & VIDEO_RECALC) |
240 | vga_recalc_vertical(); | 243 | vga_recalc_vertical(); |
241 | 244 | ||
245 | /* Save the canonical mode number for the kernel, not | ||
246 | an alias, size specification or menu position */ | ||
247 | boot_params.hdr.vid_mode = real_mode; | ||
242 | return 0; | 248 | return 0; |
243 | } | 249 | } |
244 | 250 | ||
diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S index ed0a0f2c1597..f22ba8534d26 100644 --- a/arch/i386/kernel/acpi/wakeup.S +++ b/arch/i386/kernel/acpi/wakeup.S | |||
@@ -151,51 +151,30 @@ bogus_real_magic: | |||
151 | #define VIDEO_FIRST_V7 0x0900 | 151 | #define VIDEO_FIRST_V7 0x0900 |
152 | 152 | ||
153 | # Setting of user mode (AX=mode ID) => CF=success | 153 | # Setting of user mode (AX=mode ID) => CF=success |
154 | |||
155 | # For now, we only handle VESA modes (0x0200..0x03ff). To handle other | ||
156 | # modes, we should probably compile in the video code from the boot | ||
157 | # directory. | ||
154 | mode_set: | 158 | mode_set: |
155 | movw %ax, %bx | 159 | movw %ax, %bx |
156 | #if 0 | 160 | subb $VIDEO_FIRST_VESA>>8, %bh |
157 | cmpb $0xff, %ah | 161 | cmpb $2, %bh |
158 | jz setalias | 162 | jb check_vesa |
159 | |||
160 | testb $VIDEO_RECALC>>8, %ah | ||
161 | jnz _setrec | ||
162 | |||
163 | cmpb $VIDEO_FIRST_RESOLUTION>>8, %ah | ||
164 | jnc setres | ||
165 | |||
166 | cmpb $VIDEO_FIRST_SPECIAL>>8, %ah | ||
167 | jz setspc | ||
168 | |||
169 | cmpb $VIDEO_FIRST_V7>>8, %ah | ||
170 | jz setv7 | ||
171 | #endif | ||
172 | |||
173 | cmpb $VIDEO_FIRST_VESA>>8, %ah | ||
174 | jnc check_vesa | ||
175 | #if 0 | ||
176 | orb %ah, %ah | ||
177 | jz setmenu | ||
178 | #endif | ||
179 | |||
180 | decb %ah | ||
181 | # jz setbios Add bios modes later | ||
182 | 163 | ||
183 | setbad: clc | 164 | setbad: |
165 | clc | ||
184 | ret | 166 | ret |
185 | 167 | ||
186 | check_vesa: | 168 | check_vesa: |
187 | subb $VIDEO_FIRST_VESA>>8, %bh | ||
188 | orw $0x4000, %bx # Use linear frame buffer | 169 | orw $0x4000, %bx # Use linear frame buffer |
189 | movw $0x4f02, %ax # VESA BIOS mode set call | 170 | movw $0x4f02, %ax # VESA BIOS mode set call |
190 | int $0x10 | 171 | int $0x10 |
191 | cmpw $0x004f, %ax # AL=4f if implemented | 172 | cmpw $0x004f, %ax # AL=4f if implemented |
192 | jnz _setbad # AH=0 if OK | 173 | jnz setbad # AH=0 if OK |
193 | 174 | ||
194 | stc | 175 | stc |
195 | ret | 176 | ret |
196 | 177 | ||
197 | _setbad: jmp setbad | ||
198 | |||
199 | .code32 | 178 | .code32 |
200 | ALIGN | 179 | ALIGN |
201 | 180 | ||
diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c index 9f4ac8b02de4..bd72d94e713e 100644 --- a/arch/i386/kernel/alternative.c +++ b/arch/i386/kernel/alternative.c | |||
@@ -445,8 +445,6 @@ void __kprobes text_poke(void *addr, unsigned char *opcode, int len) | |||
445 | { | 445 | { |
446 | memcpy(addr, opcode, len); | 446 | memcpy(addr, opcode, len); |
447 | sync_core(); | 447 | sync_core(); |
448 | /* Not strictly needed, but can speed CPU recovery up. Ignore cross cacheline | 448 | /* Could also do a CLFLUSH here to speed up CPU recovery; but |
449 | case. */ | 449 | that causes hangs on some VIA CPUs. */ |
450 | if (cpu_has_clflush) | ||
451 | asm("clflush (%0) " :: "r" (addr) : "memory"); | ||
452 | } | 450 | } |
diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c index ef8f0bc3fc71..f0cce3c2dc3a 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c +++ b/arch/i386/kernel/cpu/cpufreq/longhaul.c | |||
@@ -76,6 +76,7 @@ static unsigned int longhaul_index; | |||
76 | /* Module parameters */ | 76 | /* Module parameters */ |
77 | static int scale_voltage; | 77 | static int scale_voltage; |
78 | static int disable_acpi_c3; | 78 | static int disable_acpi_c3; |
79 | static int revid_errata; | ||
79 | 80 | ||
80 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg) | 81 | #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg) |
81 | 82 | ||
@@ -168,7 +169,10 @@ static void do_powersaver(int cx_address, unsigned int clock_ratio_index, | |||
168 | 169 | ||
169 | rdmsrl(MSR_VIA_LONGHAUL, longhaul.val); | 170 | rdmsrl(MSR_VIA_LONGHAUL, longhaul.val); |
170 | /* Setup new frequency */ | 171 | /* Setup new frequency */ |
171 | longhaul.bits.RevisionKey = longhaul.bits.RevisionID; | 172 | if (!revid_errata) |
173 | longhaul.bits.RevisionKey = longhaul.bits.RevisionID; | ||
174 | else | ||
175 | longhaul.bits.RevisionKey = 0; | ||
172 | longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf; | 176 | longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf; |
173 | longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4; | 177 | longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4; |
174 | /* Setup new voltage */ | 178 | /* Setup new voltage */ |
@@ -272,7 +276,7 @@ static void longhaul_setstate(unsigned int table_index) | |||
272 | 276 | ||
273 | dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", | 277 | dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", |
274 | fsb, mult/10, mult%10, print_speed(speed/1000)); | 278 | fsb, mult/10, mult%10, print_speed(speed/1000)); |
275 | 279 | retry_loop: | |
276 | preempt_disable(); | 280 | preempt_disable(); |
277 | local_irq_save(flags); | 281 | local_irq_save(flags); |
278 | 282 | ||
@@ -344,6 +348,47 @@ static void longhaul_setstate(unsigned int table_index) | |||
344 | preempt_enable(); | 348 | preempt_enable(); |
345 | 349 | ||
346 | freqs.new = calc_speed(longhaul_get_cpu_mult()); | 350 | freqs.new = calc_speed(longhaul_get_cpu_mult()); |
351 | /* Check if requested frequency is set. */ | ||
352 | if (unlikely(freqs.new != speed)) { | ||
353 | printk(KERN_INFO PFX "Failed to set requested frequency!\n"); | ||
354 | /* Revision ID = 1 but processor is expecting revision key | ||
355 | * equal to 0. Jumpers at the bottom of processor will change | ||
356 | * multiplier and FSB, but will not change bits in Longhaul | ||
357 | * MSR nor enable voltage scaling. */ | ||
358 | if (!revid_errata) { | ||
359 | printk(KERN_INFO PFX "Enabling \"Ignore Revision ID\" " | ||
360 | "option.\n"); | ||
361 | revid_errata = 1; | ||
362 | msleep(200); | ||
363 | goto retry_loop; | ||
364 | } | ||
365 | /* Why ACPI C3 sometimes doesn't work is a mystery for me. | ||
366 | * But it does happen. Processor is entering ACPI C3 state, | ||
367 | * but it doesn't change frequency. I tried poking various | ||
368 | * bits in northbridge registers, but without success. */ | ||
369 | if (longhaul_flags & USE_ACPI_C3) { | ||
370 | printk(KERN_INFO PFX "Disabling ACPI C3 support.\n"); | ||
371 | longhaul_flags &= ~USE_ACPI_C3; | ||
372 | if (revid_errata) { | ||
373 | printk(KERN_INFO PFX "Disabling \"Ignore " | ||
374 | "Revision ID\" option.\n"); | ||
375 | revid_errata = 0; | ||
376 | } | ||
377 | msleep(200); | ||
378 | goto retry_loop; | ||
379 | } | ||
380 | /* This shouldn't happen. Longhaul ver. 2 was reported not | ||
381 | * working on processors without voltage scaling, but with | ||
382 | * RevID = 1. RevID errata will make things right. Just | ||
383 | * to be 100% sure. */ | ||
384 | if (longhaul_version == TYPE_LONGHAUL_V2) { | ||
385 | printk(KERN_INFO PFX "Switching to Longhaul ver. 1\n"); | ||
386 | longhaul_version = TYPE_LONGHAUL_V1; | ||
387 | msleep(200); | ||
388 | goto retry_loop; | ||
389 | } | ||
390 | } | ||
391 | /* Report true CPU frequency */ | ||
347 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 392 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); |
348 | 393 | ||
349 | if (!bm_timeout) | 394 | if (!bm_timeout) |
@@ -956,11 +1001,20 @@ static void __exit longhaul_exit(void) | |||
956 | kfree(longhaul_table); | 1001 | kfree(longhaul_table); |
957 | } | 1002 | } |
958 | 1003 | ||
1004 | /* Even if BIOS is exporting ACPI C3 state, and it is used | ||
1005 | * with success when CPU is idle, this state doesn't | ||
1006 | * trigger frequency transition in some cases. */ | ||
959 | module_param (disable_acpi_c3, int, 0644); | 1007 | module_param (disable_acpi_c3, int, 0644); |
960 | MODULE_PARM_DESC(disable_acpi_c3, "Don't use ACPI C3 support"); | 1008 | MODULE_PARM_DESC(disable_acpi_c3, "Don't use ACPI C3 support"); |
961 | 1009 | /* Change CPU voltage with frequency. Very usefull to save | |
1010 | * power, but most VIA C3 processors aren't supporting it. */ | ||
962 | module_param (scale_voltage, int, 0644); | 1011 | module_param (scale_voltage, int, 0644); |
963 | MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor"); | 1012 | MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor"); |
1013 | /* Force revision key to 0 for processors which doesn't | ||
1014 | * support voltage scaling, but are introducing itself as | ||
1015 | * such. */ | ||
1016 | module_param(revid_errata, int, 0644); | ||
1017 | MODULE_PARM_DESC(revid_errata, "Ignore CPU Revision ID"); | ||
964 | 1018 | ||
965 | MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>"); | 1019 | MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>"); |
966 | MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors."); | 1020 | MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors."); |
diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/i386/kernel/cpu/intel_cacheinfo.c index d5a456d27d82..db6c25aa5776 100644 --- a/arch/i386/kernel/cpu/intel_cacheinfo.c +++ b/arch/i386/kernel/cpu/intel_cacheinfo.c | |||
@@ -515,7 +515,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu) | |||
515 | 515 | ||
516 | cpuid4_info[cpu] = kzalloc( | 516 | cpuid4_info[cpu] = kzalloc( |
517 | sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); | 517 | sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL); |
518 | if (unlikely(cpuid4_info[cpu] == NULL)) | 518 | if (cpuid4_info[cpu] == NULL) |
519 | return -ENOMEM; | 519 | return -ENOMEM; |
520 | 520 | ||
521 | oldmask = current->cpus_allowed; | 521 | oldmask = current->cpus_allowed; |
@@ -748,6 +748,8 @@ static void __cpuinit cache_remove_dev(struct sys_device * sys_dev) | |||
748 | unsigned int cpu = sys_dev->id; | 748 | unsigned int cpu = sys_dev->id; |
749 | unsigned long i; | 749 | unsigned long i; |
750 | 750 | ||
751 | if (cpuid4_info[cpu] == NULL) | ||
752 | return; | ||
751 | for (i = 0; i < num_cache_leaves; i++) { | 753 | for (i = 0; i < num_cache_leaves; i++) { |
752 | cache_remove_shared_cpu_map(cpu, i); | 754 | cache_remove_shared_cpu_map(cpu, i); |
753 | kobject_unregister(&(INDEX_KOBJECT_PTR(cpu,i)->kobj)); | 755 | kobject_unregister(&(INDEX_KOBJECT_PTR(cpu,i)->kobj)); |
diff --git a/arch/i386/kernel/cpu/perfctr-watchdog.c b/arch/i386/kernel/cpu/perfctr-watchdog.c index 4be488e73bee..93fecd4b03de 100644 --- a/arch/i386/kernel/cpu/perfctr-watchdog.c +++ b/arch/i386/kernel/cpu/perfctr-watchdog.c | |||
@@ -263,8 +263,8 @@ static int setup_k7_watchdog(unsigned nmi_hz) | |||
263 | unsigned int evntsel; | 263 | unsigned int evntsel; |
264 | struct nmi_watchdog_ctlblk *wd = &__get_cpu_var(nmi_watchdog_ctlblk); | 264 | struct nmi_watchdog_ctlblk *wd = &__get_cpu_var(nmi_watchdog_ctlblk); |
265 | 265 | ||
266 | perfctr_msr = MSR_K7_PERFCTR0; | 266 | perfctr_msr = wd_ops->perfctr; |
267 | evntsel_msr = MSR_K7_EVNTSEL0; | 267 | evntsel_msr = wd_ops->evntsel; |
268 | 268 | ||
269 | wrmsrl(perfctr_msr, 0UL); | 269 | wrmsrl(perfctr_msr, 0UL); |
270 | 270 | ||
@@ -343,8 +343,8 @@ static int setup_p6_watchdog(unsigned nmi_hz) | |||
343 | unsigned int evntsel; | 343 | unsigned int evntsel; |
344 | struct nmi_watchdog_ctlblk *wd = &__get_cpu_var(nmi_watchdog_ctlblk); | 344 | struct nmi_watchdog_ctlblk *wd = &__get_cpu_var(nmi_watchdog_ctlblk); |
345 | 345 | ||
346 | perfctr_msr = MSR_P6_PERFCTR0; | 346 | perfctr_msr = wd_ops->perfctr; |
347 | evntsel_msr = MSR_P6_EVNTSEL0; | 347 | evntsel_msr = wd_ops->evntsel; |
348 | 348 | ||
349 | /* KVM doesn't implement this MSR */ | 349 | /* KVM doesn't implement this MSR */ |
350 | if (wrmsr_safe(perfctr_msr, 0, 0) < 0) | 350 | if (wrmsr_safe(perfctr_msr, 0, 0) < 0) |
@@ -569,8 +569,8 @@ static int setup_intel_arch_watchdog(unsigned nmi_hz) | |||
569 | (ebx & ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT)) | 569 | (ebx & ARCH_PERFMON_UNHALTED_CORE_CYCLES_PRESENT)) |
570 | return 0; | 570 | return 0; |
571 | 571 | ||
572 | perfctr_msr = MSR_ARCH_PERFMON_PERFCTR1; | 572 | perfctr_msr = wd_ops->perfctr; |
573 | evntsel_msr = MSR_ARCH_PERFMON_EVENTSEL1; | 573 | evntsel_msr = wd_ops->evntsel; |
574 | 574 | ||
575 | wrmsrl(perfctr_msr, 0UL); | 575 | wrmsrl(perfctr_msr, 0UL); |
576 | 576 | ||
@@ -605,6 +605,16 @@ static struct wd_ops intel_arch_wd_ops = { | |||
605 | .evntsel = MSR_ARCH_PERFMON_EVENTSEL1, | 605 | .evntsel = MSR_ARCH_PERFMON_EVENTSEL1, |
606 | }; | 606 | }; |
607 | 607 | ||
608 | static struct wd_ops coreduo_wd_ops = { | ||
609 | .reserve = single_msr_reserve, | ||
610 | .unreserve = single_msr_unreserve, | ||
611 | .setup = setup_intel_arch_watchdog, | ||
612 | .rearm = p6_rearm, | ||
613 | .stop = single_msr_stop_watchdog, | ||
614 | .perfctr = MSR_ARCH_PERFMON_PERFCTR0, | ||
615 | .evntsel = MSR_ARCH_PERFMON_EVENTSEL0, | ||
616 | }; | ||
617 | |||
608 | static void probe_nmi_watchdog(void) | 618 | static void probe_nmi_watchdog(void) |
609 | { | 619 | { |
610 | switch (boot_cpu_data.x86_vendor) { | 620 | switch (boot_cpu_data.x86_vendor) { |
@@ -615,6 +625,12 @@ static void probe_nmi_watchdog(void) | |||
615 | wd_ops = &k7_wd_ops; | 625 | wd_ops = &k7_wd_ops; |
616 | break; | 626 | break; |
617 | case X86_VENDOR_INTEL: | 627 | case X86_VENDOR_INTEL: |
628 | /* Work around Core Duo (Yonah) errata AE49 where perfctr1 | ||
629 | doesn't have a working enable bit. */ | ||
630 | if (boot_cpu_data.x86 == 6 && boot_cpu_data.x86_model == 14) { | ||
631 | wd_ops = &coreduo_wd_ops; | ||
632 | break; | ||
633 | } | ||
618 | if (cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) { | 634 | if (cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) { |
619 | wd_ops = &intel_arch_wd_ops; | 635 | wd_ops = &intel_arch_wd_ops; |
620 | break; | 636 | break; |
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 4b8a8da4b2e0..e2f4a1c68547 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c | |||
@@ -754,14 +754,6 @@ static int pirq_entries [MAX_PIRQS]; | |||
754 | static int pirqs_enabled; | 754 | static int pirqs_enabled; |
755 | int skip_ioapic_setup; | 755 | int skip_ioapic_setup; |
756 | 756 | ||
757 | static int __init ioapic_setup(char *str) | ||
758 | { | ||
759 | skip_ioapic_setup = 1; | ||
760 | return 1; | ||
761 | } | ||
762 | |||
763 | __setup("noapic", ioapic_setup); | ||
764 | |||
765 | static int __init ioapic_pirq_setup(char *str) | 757 | static int __init ioapic_pirq_setup(char *str) |
766 | { | 758 | { |
767 | int i, max; | 759 | int i, max; |
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index 8c1c965eb2a8..c7227e2180f8 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/i386/kernel/nmi.c | |||
@@ -115,12 +115,12 @@ static int __init check_nmi_watchdog(void) | |||
115 | atomic_dec(&nmi_active); | 115 | atomic_dec(&nmi_active); |
116 | } | 116 | } |
117 | } | 117 | } |
118 | endflag = 1; | ||
118 | if (!atomic_read(&nmi_active)) { | 119 | if (!atomic_read(&nmi_active)) { |
119 | kfree(prev_nmi_count); | 120 | kfree(prev_nmi_count); |
120 | atomic_set(&nmi_active, -1); | 121 | atomic_set(&nmi_active, -1); |
121 | return -1; | 122 | return -1; |
122 | } | 123 | } |
123 | endflag = 1; | ||
124 | printk("OK.\n"); | 124 | printk("OK.\n"); |
125 | 125 | ||
126 | /* now that we know it works we can reduce NMI frequency to | 126 | /* now that we know it works we can reduce NMI frequency to |
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c index 0c8f00e69c4d..7c1b92522e95 100644 --- a/arch/i386/kernel/ptrace.c +++ b/arch/i386/kernel/ptrace.c | |||
@@ -274,7 +274,6 @@ static void clear_singlestep(struct task_struct *child) | |||
274 | void ptrace_disable(struct task_struct *child) | 274 | void ptrace_disable(struct task_struct *child) |
275 | { | 275 | { |
276 | clear_singlestep(child); | 276 | clear_singlestep(child); |
277 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
278 | clear_tsk_thread_flag(child, TIF_SYSCALL_EMU); | 277 | clear_tsk_thread_flag(child, TIF_SYSCALL_EMU); |
279 | } | 278 | } |
280 | 279 | ||
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index cfffe3dd9e83..47b0bef335bd 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -100,36 +100,45 @@ asmlinkage void machine_check(void); | |||
100 | int kstack_depth_to_print = 24; | 100 | int kstack_depth_to_print = 24; |
101 | static unsigned int code_bytes = 64; | 101 | static unsigned int code_bytes = 64; |
102 | 102 | ||
103 | static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) | 103 | static inline int valid_stack_ptr(struct thread_info *tinfo, void *p, unsigned size) |
104 | { | 104 | { |
105 | return p > (void *)tinfo && | 105 | return p > (void *)tinfo && |
106 | p < (void *)tinfo + THREAD_SIZE - 3; | 106 | p <= (void *)tinfo + THREAD_SIZE - size; |
107 | } | 107 | } |
108 | 108 | ||
109 | /* The form of the top of the frame on the stack */ | ||
110 | struct stack_frame { | ||
111 | struct stack_frame *next_frame; | ||
112 | unsigned long return_address; | ||
113 | }; | ||
114 | |||
109 | static inline unsigned long print_context_stack(struct thread_info *tinfo, | 115 | static inline unsigned long print_context_stack(struct thread_info *tinfo, |
110 | unsigned long *stack, unsigned long ebp, | 116 | unsigned long *stack, unsigned long ebp, |
111 | struct stacktrace_ops *ops, void *data) | 117 | struct stacktrace_ops *ops, void *data) |
112 | { | 118 | { |
113 | unsigned long addr; | ||
114 | |||
115 | #ifdef CONFIG_FRAME_POINTER | 119 | #ifdef CONFIG_FRAME_POINTER |
116 | while (valid_stack_ptr(tinfo, (void *)ebp)) { | 120 | struct stack_frame *frame = (struct stack_frame *)ebp; |
117 | unsigned long new_ebp; | 121 | while (valid_stack_ptr(tinfo, frame, sizeof(*frame))) { |
118 | addr = *(unsigned long *)(ebp + 4); | 122 | struct stack_frame *next; |
123 | unsigned long addr; | ||
124 | |||
125 | addr = frame->return_address; | ||
119 | ops->address(data, addr); | 126 | ops->address(data, addr); |
120 | /* | 127 | /* |
121 | * break out of recursive entries (such as | 128 | * break out of recursive entries (such as |
122 | * end_of_stack_stop_unwind_function). Also, | 129 | * end_of_stack_stop_unwind_function). Also, |
123 | * we can never allow a frame pointer to | 130 | * we can never allow a frame pointer to |
124 | * move downwards! | 131 | * move downwards! |
125 | */ | 132 | */ |
126 | new_ebp = *(unsigned long *)ebp; | 133 | next = frame->next_frame; |
127 | if (new_ebp <= ebp) | 134 | if (next <= frame) |
128 | break; | 135 | break; |
129 | ebp = new_ebp; | 136 | frame = next; |
130 | } | 137 | } |
131 | #else | 138 | #else |
132 | while (valid_stack_ptr(tinfo, stack)) { | 139 | while (valid_stack_ptr(tinfo, stack, sizeof(*stack))) { |
140 | unsigned long addr; | ||
141 | |||
133 | addr = *stack++; | 142 | addr = *stack++; |
134 | if (__kernel_text_address(addr)) | 143 | if (__kernel_text_address(addr)) |
135 | ops->address(data, addr); | 144 | ops->address(data, addr); |
diff --git a/arch/i386/kernel/tsc.c b/arch/i386/kernel/tsc.c index debd7dbb4158..a39280b4dd3a 100644 --- a/arch/i386/kernel/tsc.c +++ b/arch/i386/kernel/tsc.c | |||
@@ -292,7 +292,6 @@ static struct clocksource clocksource_tsc = { | |||
292 | 292 | ||
293 | void mark_tsc_unstable(char *reason) | 293 | void mark_tsc_unstable(char *reason) |
294 | { | 294 | { |
295 | sched_clock_unstable_event(); | ||
296 | if (!tsc_unstable) { | 295 | if (!tsc_unstable) { |
297 | tsc_unstable = 1; | 296 | tsc_unstable = 1; |
298 | tsc_enabled = 0; | 297 | tsc_enabled = 0; |
diff --git a/arch/i386/mach-generic/Makefile b/arch/i386/mach-generic/Makefile index 77fbc9f64fbc..6914485c0d85 100644 --- a/arch/i386/mach-generic/Makefile +++ b/arch/i386/mach-generic/Makefile | |||
@@ -2,6 +2,6 @@ | |||
2 | # Makefile for the generic architecture | 2 | # Makefile for the generic architecture |
3 | # | 3 | # |
4 | 4 | ||
5 | EXTRA_CFLAGS += -I../kernel | 5 | EXTRA_CFLAGS := -Iarch/i386/kernel |
6 | 6 | ||
7 | obj-y := probe.o summit.o bigsmp.o es7000.o default.o ../mach-es7000/ | 7 | obj-y := probe.o summit.o bigsmp.o es7000.o default.o ../mach-es7000/ |
diff --git a/arch/i386/mach-voyager/Makefile b/arch/i386/mach-voyager/Makefile index f24d29651318..33b74cf0dd22 100644 --- a/arch/i386/mach-voyager/Makefile +++ b/arch/i386/mach-voyager/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
3 | # | 3 | # |
4 | 4 | ||
5 | EXTRA_CFLAGS += -I../kernel | 5 | EXTRA_CFLAGS := -Iarch/i386/kernel |
6 | obj-y := setup.o voyager_basic.o voyager_thread.o | 6 | obj-y := setup.o voyager_basic.o voyager_thread.o |
7 | 7 | ||
8 | obj-$(CONFIG_SMP) += voyager_smp.o voyager_cat.o | 8 | obj-$(CONFIG_SMP) += voyager_smp.o voyager_cat.o |
diff --git a/arch/i386/mm/highmem.c b/arch/i386/mm/highmem.c index ad8d86cc683e..1c3bf95f7356 100644 --- a/arch/i386/mm/highmem.c +++ b/arch/i386/mm/highmem.c | |||
@@ -34,17 +34,16 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot) | |||
34 | /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ | 34 | /* even !CONFIG_PREEMPT needs this, for in_atomic in do_page_fault */ |
35 | pagefault_disable(); | 35 | pagefault_disable(); |
36 | 36 | ||
37 | idx = type + KM_TYPE_NR*smp_processor_id(); | ||
38 | BUG_ON(!pte_none(*(kmap_pte-idx))); | ||
39 | |||
40 | if (!PageHighMem(page)) | 37 | if (!PageHighMem(page)) |
41 | return page_address(page); | 38 | return page_address(page); |
42 | 39 | ||
40 | idx = type + KM_TYPE_NR*smp_processor_id(); | ||
43 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | 41 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); |
42 | BUG_ON(!pte_none(*(kmap_pte-idx))); | ||
44 | set_pte(kmap_pte-idx, mk_pte(page, prot)); | 43 | set_pte(kmap_pte-idx, mk_pte(page, prot)); |
45 | arch_flush_lazy_mmu_mode(); | 44 | arch_flush_lazy_mmu_mode(); |
46 | 45 | ||
47 | return (void*) vaddr; | 46 | return (void *)vaddr; |
48 | } | 47 | } |
49 | 48 | ||
50 | void *kmap_atomic(struct page *page, enum km_type type) | 49 | void *kmap_atomic(struct page *page, enum km_type type) |
diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c index efdf95ac8031..6c06d9c0488e 100644 --- a/arch/i386/mm/hugetlbpage.c +++ b/arch/i386/mm/hugetlbpage.c | |||
@@ -367,7 +367,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, | |||
367 | return -ENOMEM; | 367 | return -ENOMEM; |
368 | 368 | ||
369 | if (flags & MAP_FIXED) { | 369 | if (flags & MAP_FIXED) { |
370 | if (prepare_hugepage_range(addr, len, pgoff)) | 370 | if (prepare_hugepage_range(addr, len)) |
371 | return -EINVAL; | 371 | return -EINVAL; |
372 | return addr; | 372 | return addr; |
373 | } | 373 | } |
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c index 665db063a40a..8434f2323b87 100644 --- a/arch/i386/pci/irq.c +++ b/arch/i386/pci/irq.c | |||
@@ -550,6 +550,7 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route | |||
550 | case PCI_DEVICE_ID_INTEL_ICH9_3: | 550 | case PCI_DEVICE_ID_INTEL_ICH9_3: |
551 | case PCI_DEVICE_ID_INTEL_ICH9_4: | 551 | case PCI_DEVICE_ID_INTEL_ICH9_4: |
552 | case PCI_DEVICE_ID_INTEL_ICH9_5: | 552 | case PCI_DEVICE_ID_INTEL_ICH9_5: |
553 | case PCI_DEVICE_ID_INTEL_TOLAPAI_0: | ||
553 | r->name = "PIIX/ICH"; | 554 | r->name = "PIIX/ICH"; |
554 | r->get = pirq_piix_get; | 555 | r->get = pirq_piix_get; |
555 | r->set = pirq_piix_set; | 556 | r->set = pirq_piix_set; |
diff --git a/arch/i386/pci/pcbios.c b/arch/i386/pci/pcbios.c index 5f5193401bea..10ac8c316c46 100644 --- a/arch/i386/pci/pcbios.c +++ b/arch/i386/pci/pcbios.c | |||
@@ -412,7 +412,7 @@ struct irq_routing_options { | |||
412 | u16 segment; | 412 | u16 segment; |
413 | } __attribute__((packed)); | 413 | } __attribute__((packed)); |
414 | 414 | ||
415 | struct irq_routing_table * __devinit pcibios_get_irq_routing_table(void) | 415 | struct irq_routing_table * pcibios_get_irq_routing_table(void) |
416 | { | 416 | { |
417 | struct irq_routing_options opt; | 417 | struct irq_routing_options opt; |
418 | struct irq_routing_table *rt = NULL; | 418 | struct irq_routing_table *rt = NULL; |
diff --git a/arch/i386/xen/enlighten.c b/arch/i386/xen/enlighten.c index f0c37511d8da..f01bfcd4bdee 100644 --- a/arch/i386/xen/enlighten.c +++ b/arch/i386/xen/enlighten.c | |||
@@ -623,8 +623,8 @@ static unsigned long xen_read_cr2_direct(void) | |||
623 | 623 | ||
624 | static void xen_write_cr4(unsigned long cr4) | 624 | static void xen_write_cr4(unsigned long cr4) |
625 | { | 625 | { |
626 | /* never allow TSC to be disabled */ | 626 | /* Just ignore cr4 changes; Xen doesn't allow us to do |
627 | native_write_cr4(cr4 & ~X86_CR4_TSD); | 627 | anything anyway. */ |
628 | } | 628 | } |
629 | 629 | ||
630 | static unsigned long xen_read_cr3(void) | 630 | static unsigned long xen_read_cr3(void) |
diff --git a/arch/i386/xen/mmu.c b/arch/i386/xen/mmu.c index 4ae038aa6c24..874db0cd1d2a 100644 --- a/arch/i386/xen/mmu.c +++ b/arch/i386/xen/mmu.c | |||
@@ -559,6 +559,9 @@ void xen_exit_mmap(struct mm_struct *mm) | |||
559 | put_cpu(); | 559 | put_cpu(); |
560 | 560 | ||
561 | spin_lock(&mm->page_table_lock); | 561 | spin_lock(&mm->page_table_lock); |
562 | xen_pgd_unpin(mm->pgd); | 562 | |
563 | /* pgd may not be pinned in the error exit path of execve */ | ||
564 | if (PagePinned(virt_to_page(mm->pgd))) | ||
565 | xen_pgd_unpin(mm->pgd); | ||
563 | spin_unlock(&mm->page_table_lock); | 566 | spin_unlock(&mm->page_table_lock); |
564 | } | 567 | } |