Skip to content

Commit

Permalink
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86: Provide _sdata in the vmlinux.lds.S file
  x86: handle initrd that extends into unusable memory
  • Loading branch information
Linus Torvalds committed Jun 12, 2009
2 parents 8ebf975 + 1260866 commit db8e7f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 3 additions & 12 deletions arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,13 @@ static void __init reserve_brk(void)

#ifdef CONFIG_BLK_DEV_INITRD

#ifdef CONFIG_X86_32

#define MAX_MAP_CHUNK (NR_FIX_BTMAPS << PAGE_SHIFT)
static void __init relocate_initrd(void)
{

u64 ramdisk_image = boot_params.hdr.ramdisk_image;
u64 ramdisk_size = boot_params.hdr.ramdisk_size;
u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT;
u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT;
u64 ramdisk_here;
unsigned long slop, clen, mapaddr;
char *p, *q;
Expand Down Expand Up @@ -365,14 +363,13 @@ static void __init relocate_initrd(void)
ramdisk_image, ramdisk_image + ramdisk_size - 1,
ramdisk_here, ramdisk_here + ramdisk_size - 1);
}
#endif

static void __init reserve_initrd(void)
{
u64 ramdisk_image = boot_params.hdr.ramdisk_image;
u64 ramdisk_size = boot_params.hdr.ramdisk_size;
u64 ramdisk_end = ramdisk_image + ramdisk_size;
u64 end_of_lowmem = max_low_pfn << PAGE_SHIFT;
u64 end_of_lowmem = max_low_pfn_mapped << PAGE_SHIFT;

if (!boot_params.hdr.type_of_loader ||
!ramdisk_image || !ramdisk_size)
Expand Down Expand Up @@ -402,14 +399,8 @@ static void __init reserve_initrd(void)
return;
}

#ifdef CONFIG_X86_32
relocate_initrd();
#else
printk(KERN_ERR "initrd extends beyond end of memory "
"(0x%08llx > 0x%08llx)\ndisabling initrd\n",
ramdisk_end, end_of_lowmem);
initrd_start = 0;
#endif

free_early(ramdisk_image, ramdisk_end);
}
#else
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ SECTIONS
/* Data */
. = ALIGN(PAGE_SIZE);
.data : AT(ADDR(.data) - LOAD_OFFSET) {
/* Start of data section */
_sdata = .;
DATA_DATA
CONSTRUCTORS

Expand Down

0 comments on commit db8e7f1

Please sign in to comment.