Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9ba7053 authored by Venkatesh Pallipadi's avatar Venkatesh Pallipadi Committed by Linus Torvalds
Browse files

[PATCH] Increase number of e820 entries hard limit from 32 to 128



The specifications that talk about E820 map doesn't have an upper limit on
the number of e820 entries.  But, today's kernel has a hard limit of 32.
With increase in memory size, we are seeing the number of E820 entries
reaching close to 32.  Patch below bumps the number upto 128.

The patch changes the location of EDDBUF in zero-page (as it comes after E820).
As, EDDBUF is not used by boot loaders, this patch should not have any effect
on bootloader-setup code interface.

Patch covers both i386 and x86-64.

Tested on:
* grub booting bzImage
* lilo booting bzImage with EDID info enabled
* pxeboot of bzImage

Side-effect:
bss increases by ~ 2K and init.data increases by ~7.5K
on all systems, due to increase in size of static arrays.

Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent be9e6870
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -79,6 +79,6 @@ Offset Type Description
0x22c   unsigned long	ramdisk_max
0x230   16 bytes 	trampoline
0x290 - 0x2cf		EDD_MBR_SIG_BUFFER (edd.S)
0x2d0 - 0x600		E820MAP
0x600 - 0x7ff		EDDBUF (edd.S) for disk signature read sector
0x600 - 0x7eb		EDDBUF (edd.S) for edd data
0x2d0 - 0xd00		E820MAP
0xd00 - 0xeff		EDDBUF (edd.S) for disk signature read sector
0xd00 - 0xeeb		EDDBUF (edd.S) for edd data
+3 −3
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ ramdisk_max: .long (-__PAGE_OFFSET-(512 << 20)-1) & 0x7fffffff
trampoline:	call	start_of_setup
		.align 16
					# The offset at this point is 0x240
		.space	(0x7ff-0x240+1) # E820 & EDD space (ending at 0x7ff)
		.space	(0xeff-0x240+1) # E820 & EDD space (ending at 0xeff)
# End of setup header #####################################################

start_of_setup:
@@ -333,9 +333,9 @@ jmpe820:
	# sizeof(e820rec).
	#
good820:
	movb	(E820NR), %al			# up to 32 entries
	movb	(E820NR), %al			# up to 128 entries
	cmpb	$E820MAX, %al
	jnl	bail820
	jae	bail820

	incb	(E820NR)
	movw	%di, %ax
+3 −3
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ ramdisk_max: .long 0xffffffff
trampoline:	call	start_of_setup
		.align 16
					# The offset at this point is 0x240
		.space  (0x7ff-0x240+1)	# E820 & EDD space (ending at 0x7ff)
		.space  (0xeff-0x240+1)	# E820 & EDD space (ending at 0xeff)
# End of setup header #####################################################

start_of_setup:
@@ -412,9 +412,9 @@ jmpe820:
	# sizeof(e820rec).
	#
good820:
	movb	(E820NR), %al			# up to 32 entries
	movb	(E820NR), %al			# up to 128 entries
	cmpb	$E820MAX, %al
	jnl	bail820
	jae	bail820

	incb	(E820NR)
	movw	%di, %ax
+1 −3
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@ static void __init clear_bss(void)
	       (unsigned long) __bss_end - (unsigned long) __bss_start);
}

extern char x86_boot_params[2048];

#define NEW_CL_POINTER		0x228	/* Relative to real mode data */
#define OLD_CL_MAGIC_ADDR	0x90020
#define OLD_CL_MAGIC            0xA33F
@@ -44,7 +42,7 @@ static void __init copy_bootdata(char *real_mode_data)
	int new_data;
	char * command_line;

	memcpy(x86_boot_params, real_mode_data, 2048); 
	memcpy(x86_boot_params, real_mode_data, BOOT_PARAM_SIZE);
	new_data = *(int *) (x86_boot_params + NEW_CL_POINTER);
	if (!new_data) {
		if (OLD_CL_MAGIC != * (u16 *) OLD_CL_MAGIC_ADDR) {
+2 −1
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <linux/string.h>
#include <linux/bootmem.h>
#include <linux/bitops.h>
#include <asm/bootsetup.h>
#include <asm/pda.h>
#include <asm/pgtable.h>
#include <asm/processor.h>
@@ -26,7 +27,7 @@
#include <asm/mman.h>
#include <asm/numa.h>

char x86_boot_params[2048] __initdata = {0,};
char x86_boot_params[BOOT_PARAM_SIZE] __initdata = {0,};

cpumask_t cpu_initialized __initdata = CPU_MASK_NONE;

Loading