Skip to content

Commit

Permalink
x86: avoid high BIOS area when allocating address space
Browse files Browse the repository at this point in the history
This prevents allocation of the last 2MB before 4GB.

The experiment described here shows Windows 7 ignoring the last 1MB:
https://bugzilla.kernel.org/show_bug.cgi?id=23542#c27

This patch ignores the top 2MB instead of just 1MB because H. Peter Anvin
says "There will be ROM at the top of the 32-bit address space; it's a fact
of the architecture, and on at least older systems it was common to have a
shadow 1 MiB below."

Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Bjorn Helgaas authored and Jesse Barnes committed Dec 17, 2010
1 parent 4dc2287 commit a2c606d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions arch/x86/include/asm/e820.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ struct e820map {
#define BIOS_BEGIN 0x000a0000
#define BIOS_END 0x00100000

#define BIOS_ROM_BASE 0xffe00000
#define BIOS_ROM_END 0xffffffff

#ifdef __KERNEL__
/* see comment in arch/x86/kernel/e820.c */
extern struct e820map e820;
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/kernel/resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ static void remove_e820_regions(struct resource *avail)

void arch_remove_reservations(struct resource *avail)
{
/* Trim out BIOS area (low 1MB) and E820 regions */
/* Trim out BIOS areas (low 1MB and high 2MB) and E820 regions */
if (avail->flags & IORESOURCE_MEM) {
if (avail->start < BIOS_END)
avail->start = BIOS_END;
resource_clip(avail, BIOS_ROM_BASE, BIOS_ROM_END);

remove_e820_regions(avail);
}
Expand Down

0 comments on commit a2c606d

Please sign in to comment.