Skip to content

Commit

Permalink
x86-32: tighten the bound on additional memory to map
Browse files Browse the repository at this point in the history
Impact: Tighten bound to avoid masking errors

The definition of MAPPING_BEYOND_END was excessive; this has a nasty
tendency to mask bugs.  We have learned over time that this kind of
bug hiding can cause some very strange errors.  Therefore, tighten the
bound to only need to map the actual kernel area.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Yinghai Lu <yinghai@kernel.org>
  • Loading branch information
H. Peter Anvin committed Mar 17, 2009
1 parent b8a22a6 commit 60ac982
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kernel/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
#endif

/* Enough space to fit pagetables for the low memory linear map */
MAPPING_BEYOND_END = (PAGE_TABLE_SIZE(1 << (32 - PAGE_SHIFT)) * PAGE_SIZE)
MAPPING_BEYOND_END = \
PAGE_TABLE_SIZE(((1<<32) - __PAGE_OFFSET) >> PAGE_SHIFT) << PAGE_SHIFT

/*
* Worst-case size of the kernel mapping we need to make:
Expand Down

0 comments on commit 60ac982

Please sign in to comment.