mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] x86: loadflags cleanups
@ 2015-01-31  6:29 Alexander Kuleshov
  2015-01-31  6:30 ` [PATCH v2 1/2] x86: use already defined KEEP_SEGMENTS macro from bootparam.h Alexander Kuleshov
  2015-01-31  6:30 ` [PATCH v2 2/2] x86/boot: use already defined KEEP_SEGMENTS macro in head_{32,64}.S Alexander Kuleshov
  0 siblings, 2 replies; 5+ messages in thread
From: Alexander Kuleshov @ 2015-01-31  6:29 UTC (permalink / raw)
  To: Chris Mason; +Cc: Josef Bacik, David Sterba, linux-kernel

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(-)

-- 
2.3.0-rc1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] x86: use already defined KEEP_SEGMENTS macro from bootparam.h
  2015-01-31  6:29 [PATCH v2 0/2] x86: loadflags cleanups Alexander Kuleshov
@ 2015-01-31  6:30 ` Alexander Kuleshov
  2015-01-31  6:30 ` [PATCH v2 2/2] x86/boot: use already defined KEEP_SEGMENTS macro in head_{32,64}.S Alexander Kuleshov
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Kuleshov @ 2015-01-31  6:30 UTC (permalink / raw)
  To: Chris Mason; +Cc: Josef Bacik, David Sterba, linux-kernel, Alexander Kuleshov

There is already defined macro KEEP_SEGMENTS in the
bootparam.h, let's use it instead of shifting bits

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/x86/kernel/head_32.S | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index f36bd42..fba3990 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -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
 
 /*
-- 
2.3.0-rc1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] x86/boot: use already defined KEEP_SEGMENTS macro in head_{32,64}.S
  2015-01-31  6:29 [PATCH v2 0/2] x86: loadflags cleanups Alexander Kuleshov
  2015-01-31  6:30 ` [PATCH v2 1/2] x86: use already defined KEEP_SEGMENTS macro from bootparam.h Alexander Kuleshov
@ 2015-01-31  6:30 ` Alexander Kuleshov
  2015-01-31  6:31   ` Alexander Kuleshov
  1 sibling, 1 reply; 5+ messages in thread
From: Alexander Kuleshov @ 2015-01-31  6:30 UTC (permalink / raw)
  To: Chris Mason; +Cc: Josef Bacik, David Sterba, linux-kernel, Alexander Kuleshov

There is already defined macro KEEP_SEGMENTS in the
bootparam.h, let's use it instead of shifting bits

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/x86/boot/compressed/head_32.S | 5 +++--
 arch/x86/boot/compressed/head_64.S | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index 1d7fbbc..11e549d 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -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
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 6b1766c..90c1521 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -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
-- 
2.3.0-rc1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 2/2] x86/boot: use already defined KEEP_SEGMENTS macro in head_{32,64}.S
  2015-01-31  6:30 ` [PATCH v2 2/2] x86/boot: use already defined KEEP_SEGMENTS macro in head_{32,64}.S Alexander Kuleshov
@ 2015-01-31  6:31   ` Alexander Kuleshov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Kuleshov @ 2015-01-31  6:31 UTC (permalink / raw)
  To: Chris Mason; +Cc: Josef Bacik, David Sterba, linux-kernel, Alexander Kuleshov

Sorry for noise, misunderstood  send-email alias with maintainers.

2015-01-31 12:30 GMT+06:00 Alexander Kuleshov <kuleshovmail@gmail.com>:
> There is already defined macro KEEP_SEGMENTS in the
> bootparam.h, let's use it instead of shifting bits
>
> Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
> ---
>  arch/x86/boot/compressed/head_32.S | 5 +++--
>  arch/x86/boot/compressed/head_64.S | 3 ++-
>  2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
> index 1d7fbbc..11e549d 100644
> --- a/arch/x86/boot/compressed/head_32.S
> +++ b/arch/x86/boot/compressed/head_32.S
> @@ -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
> diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
> index 6b1766c..90c1521 100644
> --- a/arch/x86/boot/compressed/head_64.S
> +++ b/arch/x86/boot/compressed/head_64.S
> @@ -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
> --
> 2.3.0-rc1
>



-- 
_________________________
0xAX

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] x86: use already defined KEEP_SEGMENTS macro from bootparam.h
  2015-01-31  6:32 [PATCH v2 0/2] x86: loadflags cleanups Alexander Kuleshov
@ 2015-01-31  6:32 ` Alexander Kuleshov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Kuleshov @ 2015-01-31  6:32 UTC (permalink / raw)
  To: Thomas Gleixner, H. Peter Anvin, Martin Mares, Ingo Molnar
  Cc: x86, linux-kernel, Alexander Kuleshov

There is already defined macro KEEP_SEGMENTS in the
bootparam.h, let's use it instead of shifting bits

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/x86/kernel/head_32.S | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index f36bd42..fba3990 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -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
 
 /*
-- 
2.3.0-rc1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-31  6:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-31  6:29 [PATCH v2 0/2] x86: loadflags cleanups Alexander Kuleshov
2015-01-31  6:30 ` [PATCH v2 1/2] x86: use already defined KEEP_SEGMENTS macro from bootparam.h Alexander Kuleshov
2015-01-31  6:30 ` [PATCH v2 2/2] x86/boot: use already defined KEEP_SEGMENTS macro in head_{32,64}.S Alexander Kuleshov
2015-01-31  6:31   ` Alexander Kuleshov
2015-01-31  6:32 [PATCH v2 0/2] x86: loadflags cleanups Alexander Kuleshov
2015-01-31  6:32 ` [PATCH v2 1/2] x86: use already defined KEEP_SEGMENTS macro from bootparam.h Alexander Kuleshov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®