x86: loadflags cleanups
v2 cover x86: loadflags cleanups
There are a couple macros in the arch/x86/include/uapi/asm/bootparam.h for checking loadflags bits. Let's use it instead of shifting bits
Alexander Kuleshov (2):
x86: use already defined KEEP_SEGMENTS macro from bootparam.h x86/boot: use already defined KEEP_SEGMENTS macro in head_{32,64}.S
arch/x86/boot/compressed/head_32.S | 5 +++-- arch/x86/boot/compressed/head_64.S | 3 ++- arch/x86/kernel/head_32.S | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
2.3.0-rc1
PATCH v2 1/2 x86: use already defined KEEP_SEGMENTS macro from bootparam.h
There is already defined macro KEEP_SEGMENTS in the bootparam.h, let's use it instead of shifting bits
--- arch/x86/kernel/head_32.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
arch/x86/kernel/head_32.S +4 -3
@@ -22,7 +22,8 @@ #include <asm/cpufeature.h> #include <asm/percpu.h> #include <asm/nops.h> - +#include <asm/bootmparam.h> + /* Physical address */ #define pa(X) ((X) - __PAGE_OFFSET)
@@ -89,8 +90,8 @@ ENTRY(startup_32) movl pa(stack_start),%ecx /* test KEEP_SEGMENTS flag to see if the bootloader is asking - us to not reload segments */ - testb $(1<<6), BP_loadflags(%esi) + us to not reload segments */ + testb $KEEP_SEGMENTS, BP_loadflags(%esi) jnz 2f /*
Signature · 1 line
2.3.0-rc1
PATCH v2 2/2 x86/boot: use already defined KEEP_SEGMENTS macro in head_{32,64}.S
In reply to Alexander KuleshovThere is already defined macro KEEP_SEGMENTS in the bootparam.h, let's use it instead of shifting bits
--- arch/x86/boot/compressed/head_32.S | 5 +++-- arch/x86/boot/compressed/head_64.S | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-)
arch/x86/boot/compressed/head_32.S +3 -2
@@ -29,7 +29,8 @@ #include <asm/page_types.h> #include <asm/boot.h> #include <asm/asm-offsets.h> - +#include <asm/bootparam.h> + __HEAD ENTRY(startup_32) #ifdef CONFIG_EFI_STUB
@@ -102,7 +103,7 @@ preferred_addr: * Test KEEP_SEGMENTS flag to see if the bootloader is asking * us to not reload segments */ - testb $(1<<6), BP_loadflags(%esi) + testb $KEEP_SEGMENTS, BP_loadflags(%esi) jnz 1f cli
arch/x86/boot/compressed/head_64.S +2 -1
@@ -31,6 +31,7 @@ #include <asm/msr.h> #include <asm/processor-flags.h> #include <asm/asm-offsets.h> +#include <asm/bootparam.h> __HEAD .code32
@@ -46,7 +47,7 @@ ENTRY(startup_32) * Test KEEP_SEGMENTS flag to see if the bootloader is asking * us to not reload segments */ - testb $(1<<6), BP_loadflags(%esi) + testb $KEEP_SEGMENTS, BP_loadflags(%esi) jnz 1f cli
Signature · 1 line
2.3.0-rc1
Quoted 11 lines · Alexander Kuleshov
There are a couple macros in the
arch/x86/include/uapi/asm/bootparam.hfor checking loadflags bits. Let's use it instead of shifting bitsAlexander Kuleshov (2):
x86: use already definedKEEP_SEGMENTSmacro frombootparam.hx86/boot: use already definedKEEP_SEGMENTSmacro in head_{32,64}.Sarch/x86/boot/compressed/head_32.S | 5 +++-- arch/x86/boot/compressed/head_64.S | 3 ++- arch/x86/kernel/head_32.S | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-)
I think a single patch would be perfectly fine for a cleanup that does the same thing in three files.
Thanks,
Ingo