]> git.baikalelectronics.ru Git - kernel.git/commit
x86/boot: Simplify EBDA-vs-BIOS reservation logic
authorAndy Lutomirski <luto@kernel.org>
Thu, 21 Jul 2016 21:16:52 +0000 (14:16 -0700)
committerIngo Molnar <mingo@kernel.org>
Fri, 22 Jul 2016 09:46:01 +0000 (11:46 +0200)
commitcfea051c87a0e0036beb4a6e2dabcbced3e927eb
treecd8da659f7b35829b38bd597f5be3cc78a9ad06a
parentb64308c92ea6f661fce521e950ef70807a18d8e2
x86/boot: Simplify EBDA-vs-BIOS reservation logic

Both the intent and the effect of reserve_bios_regions() is simple:
reserve the range from the apparent BIOS start (suitably filtered)
through 1MB and, if the EBDA start address is sensible, extend that
reservation downward to cover the EBDA as well.

The code is overcomplicated, though, and contains head-scratchers
like:

if (ebda_start < BIOS_START_MIN)
ebda_start = BIOS_START_MAX;

That snipped is trying to say "if ebda_start < BIOS_START_MIN,
ignore it".

Simplify it: reorder the code so that it makes sense.  This should
have no functional effect under any circumstances.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@suse.com>
Cc: Mario Limonciello <mario_limonciello@dell.com>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Toshi Kani <toshi.kani@hp.com>
Link: http://lkml.kernel.org/r/ef89c0c761be20ead8bd9a3275743e6259b6092a.1469135598.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/ebda.c