Skip to content

Commit e322342

Browse files
Andi KleenLinus Torvalds
authored andcommitted
[PATCH] More x86-64 bugfixes
This patch fixes the problem some people had with their systems crashing early at boot. Also fix a problem in the LDT/TSS setup noticed by Paul Menage. And some other random fixes. - Update defconfig - Remove some unnecessary printks - Enlarge kernel mapping to 40MB - Fix acpi=ht (Suresh Siddha) - Use KERN_ALERT for more important oops lines - Fix LDT/TSS limit (Paul Menage) Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent e1900a1 commit e322342

File tree

9 files changed

+28
-15
lines changed

9 files changed

+28
-15
lines changed

arch/x86_64/defconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ CONFIG_IKCONFIG=y
3434
CONFIG_IKCONFIG_PROC=y
3535
# CONFIG_EMBEDDED is not set
3636
CONFIG_KALLSYMS=y
37+
CONFIG_KALLSYMS_ALL=y
3738
CONFIG_FUTEX=y
3839
CONFIG_EPOLL=y
3940
CONFIG_IOSCHED_NOOP=y
@@ -234,6 +235,7 @@ CONFIG_BLK_DEV_PIIX=y
234235
# CONFIG_BLK_DEV_SLC90E66 is not set
235236
# CONFIG_BLK_DEV_TRM290 is not set
236237
# CONFIG_BLK_DEV_VIA82CXXX is not set
238+
# CONFIG_IDE_ARM is not set
237239
CONFIG_BLK_DEV_IDEDMA=y
238240
# CONFIG_IDEDMA_IVB is not set
239241
CONFIG_IDEDMA_AUTO=y
@@ -258,7 +260,6 @@ CONFIG_BLK_DEV_SD=y
258260
# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
259261
#
260262
# CONFIG_SCSI_MULTI_LUN is not set
261-
# CONFIG_SCSI_REPORT_LUNS is not set
262263
# CONFIG_SCSI_CONSTANTS is not set
263264
# CONFIG_SCSI_LOGGING is not set
264265

@@ -789,7 +790,6 @@ CONFIG_USB_HIDINPUT=y
789790
# Firmware Drivers
790791
#
791792
# CONFIG_EDD is not set
792-
# CONFIG_SMBIOS is not set
793793

794794
#
795795
# File systems

arch/x86_64/kernel/acpi/sleep.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ void __init acpi_reserve_bootmem(void)
114114
acpi_wakeup_address = (unsigned long)alloc_bootmem_low(PAGE_SIZE);
115115
if ((&wakeup_end - &wakeup_start) > PAGE_SIZE)
116116
printk(KERN_CRIT "ACPI: Wakeup code way too big, will crash on attempt to suspend\n");
117-
Dprintk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
118117
}
119118

120119
static int __init acpi_sleep_setup(char *str)

arch/x86_64/kernel/head.S

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,29 @@ temp_boot_pmds:
255255

256256
.org 0x5000
257257
ENTRY(level2_kernel_pgt)
258-
/* 10MB kernel mapping. The kernel code cannot be bigger than that.
258+
/* 40MB kernel mapping. The kernel code cannot be bigger than that.
259259
When you change this change KERNEL_TEXT_SIZE in page.h too. */
260260
/* (2^48-(2*1024*1024*1024)-((2^39)*511)-((2^30)*510)) = 0 */
261261
.quad 0x0000000000000183
262262
.quad 0x0000000000200183
263263
.quad 0x0000000000400183
264264
.quad 0x0000000000600183
265265
.quad 0x0000000000800183
266-
/* 10MB mapping for now to decrease the aliasing window */
267-
.fill 15,8,0
266+
.quad 0x0000000000A00183
267+
.quad 0x0000000000C00183
268+
.quad 0x0000000000E00183
269+
.quad 0x0000000001000183
270+
.quad 0x0000000001200183
271+
.quad 0x0000000001400183
272+
.quad 0x0000000001600183
273+
.quad 0x0000000001800183
274+
.quad 0x0000000001A00183
275+
.quad 0x0000000001C00183
276+
.quad 0x0000000001E00183
277+
.quad 0x0000000002000183
278+
.quad 0x0000000002200183
279+
.quad 0x0000000002400183
280+
.quad 0x0000000002600183
268281
/* Module mapping starts here */
269282
.fill 492,8,0
270283

arch/x86_64/kernel/setup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ static __init void parse_cmdline_early (char ** cmdline_p)
253253
/* acpi=ht just means: do ACPI MADT parsing
254254
at bootup, but don't enable the full ACPI interpreter */
255255
if (!memcmp(from, "acpi=ht", 7)) {
256+
/* if (!acpi_force) */
257+
disable_acpi();
256258
acpi_ht = 1;
257259
}
258260
else if (!memcmp(from, "pci=noacpi", 10))
@@ -535,8 +537,7 @@ void __init setup_arch(char **cmdline_p)
535537
* the bootmem allocator) but before get_smp_config (to allow parsing
536538
* of MADT).
537539
*/
538-
if (!acpi_disabled)
539-
acpi_boot_init();
540+
acpi_boot_init();
540541
#endif
541542
#ifdef CONFIG_X86_LOCAL_APIC
542543
/*

arch/x86_64/kernel/traps.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ void handle_BUG(struct pt_regs *regs)
302302
if (__get_user(tmp, f.filename))
303303
f.filename = "unmapped filename";
304304
printk("----------- [cut here ] --------- [please bite here ] ---------\n");
305-
printk("Kernel BUG at %.50s:%d\n", f.filename, f.line);
305+
printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line);
306306
}
307307

308308
void out_of_line_bug(void)
@@ -356,7 +356,7 @@ void __die(const char * str, struct pt_regs * regs, long err)
356356
notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV);
357357
show_registers(regs);
358358
/* Executive summary in case the oops scrolled away */
359-
printk("RIP ");
359+
printk(KERN_ALERT "RIP ");
360360
printk_address(regs->rip);
361361
printk(" RSP <%016lx>\n", regs->rsp);
362362
}

arch/x86_64/mm/fault.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,9 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code)
423423
printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference");
424424
else
425425
printk(KERN_ALERT "Unable to handle kernel paging request");
426-
printk(" at %016lx RIP: \n",address);
426+
printk(" at %016lx RIP: \n" KERN_ALERT,address);
427427
printk_address(regs->rip);
428+
printk("\n");
428429
dump_pagetable(address);
429430
__die("Oops", regs, error_code);
430431
/* Executive summary in case the body of the oops scrolled away */

arch/x86_64/mm/numa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void __init setup_node_zones(int nodeid)
124124
start_pfn = node_start_pfn(nodeid);
125125
end_pfn = node_end_pfn(nodeid);
126126

127-
printk(KERN_INFO "setting up node %d %lx-%lx\n", nodeid, start_pfn, end_pfn);
127+
Dprintk(KERN_INFO "setting up node %d %lx-%lx\n", nodeid, start_pfn, end_pfn);
128128

129129
/* All nodes > 0 have a zero length zone DMA */
130130
dma_end_pfn = __pa(MAX_DMA_ADDRESS) >> PAGE_SHIFT;

include/asm-x86_64/desc.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned
118118
d.base1 = PTR_MIDDLE(tss) & 0xFF;
119119
d.type = type;
120120
d.p = 1;
121-
d.g = 1;
122121
d.limit1 = (size >> 16) & 0xF;
123122
d.base2 = (PTR_MIDDLE(tss) >> 8) & 0xFF;
124123
d.base3 = PTR_HIGH(tss);
@@ -135,7 +134,7 @@ static inline void set_tss_desc(unsigned cpu, void *addr)
135134
static inline void set_ldt_desc(unsigned cpu, void *addr, int size)
136135
{
137136
set_tssldt_descriptor(&cpu_gdt_table[cpu][GDT_ENTRY_LDT], (unsigned long)addr,
138-
DESC_LDT, size);
137+
DESC_LDT, size * 8);
139138
}
140139

141140
static inline void set_seg_base(unsigned cpu, int entry, void *base)

include/asm-x86_64/page.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ extern unsigned long vm_force_exec32;
8484
#define __VIRTUAL_MASK_SHIFT 48
8585
#define __VIRTUAL_MASK ((1UL << __VIRTUAL_MASK_SHIFT) - 1)
8686

87-
#define KERNEL_TEXT_SIZE (10UL*1024*1024)
87+
#define KERNEL_TEXT_SIZE (40UL*1024*1024)
8888
#define KERNEL_TEXT_START 0xffffffff80000000UL
8989

9090
#ifndef __ASSEMBLY__

0 commit comments

Comments
 (0)