mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86: Use X86_CR4_PGE in x86/power/hibernate_asm_32.S
@ 2008-08-20  8:44 Uros Bizjak
  2008-08-20  9:53 ` Ingo Molnar
  0 siblings, 1 reply; 4+ messages in thread
From: Uros Bizjak @ 2008-08-20  8:44 UTC (permalink / raw)
  To: linux-kernel

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
---
diff --git a/arch/x86/power/hibernate_asm_32.S
b/arch/x86/power/hibernate_asm_32.S
index 4fc7e87..6fa219e 100644
--- a/arch/x86/power/hibernate_asm_32.S
+++ b/arch/x86/power/hibernate_asm_32.S
@@ -1,5 +1,3 @@
-.text
-
 /*
  * This may not use any stack, nor any variable that is not "NoSave":
  *
@@ -8,21 +6,21 @@
  * your own stack under you is bad idea.
  */

+	.text
 #include <linux/linkage.h>
 #include <asm/segment.h>
 #include <asm/page.h>
 #include <asm/asm-offsets.h>
-
-	.text
+#include <asm/processor-flags.h>

 ENTRY(swsusp_arch_suspend)
-
 	movl %esp, saved_context_esp
 	movl %ebx, saved_context_ebx
 	movl %ebp, saved_context_ebp
 	movl %esi, saved_context_esi
 	movl %edi, saved_context_edi
-	pushfl ; popl saved_context_eflags
+	pushfl
+	popl saved_context_eflags

 	call swsusp_save
 	ret
@@ -59,7 +57,7 @@ done:
 	movl	mmu_cr4_features, %ecx
 	jecxz	1f	# cr4 Pentium and higher, skip if zero
 	movl	%ecx, %edx
-	andl	$~(1<<7), %edx;  # PGE
+	andl	$~(X86_CR4_PGE), %edx
 	movl	%edx, %cr4;  # turn off PGE
 1:
 	movl	%cr3, %eax;  # flush TLB
@@ -74,7 +72,8 @@ done:
 	movl saved_context_esi, %esi
 	movl saved_context_edi, %edi

-	pushl saved_context_eflags ; popfl
+	pushl saved_context_eflags
+	popfl

 	xorl	%eax, %eax

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

* Re: [PATCH] x86: Use X86_CR4_PGE in x86/power/hibernate_asm_32.S
  2008-08-20  8:44 [PATCH] x86: Use X86_CR4_PGE in x86/power/hibernate_asm_32.S Uros Bizjak
@ 2008-08-20  9:53 ` Ingo Molnar
  2008-08-20 13:01   ` Rafael J. Wysocki
  2008-08-20 19:25   ` Pavel Machek
  0 siblings, 2 replies; 4+ messages in thread
From: Ingo Molnar @ 2008-08-20  9:53 UTC (permalink / raw)
  To: Uros Bizjak
  Cc: linux-kernel, H. Peter Anvin, Thomas Gleixner, Rafael J. Wysocki,
	Pavel Machek


* Uros Bizjak <ubizjak@gmail.com> wrote:

> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>

applied the commit below to tip/x86/cleanups - thanks Uros.

i did a small change: i moved the .text to after the include files. 
While include files are not supposed to change section attributes, it 
looks logically more consistent to have the .text right before the code.

	Ingo

----------------->
>From c171f465b7281f2d3b03e9145ec763d6a8bab176 Mon Sep 17 00:00:00 2001
From: Uros Bizjak <ubizjak@gmail.com>
Date: Wed, 20 Aug 2008 10:44:47 +0200
Subject: [PATCH] x86, cleanup: use X86_CR4_PGE in x86/power/hibernate_asm_32.S

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/power/hibernate_asm_32.S |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/power/hibernate_asm_32.S b/arch/x86/power/hibernate_asm_32.S
index 4fc7e87..d1e9b53 100644
--- a/arch/x86/power/hibernate_asm_32.S
+++ b/arch/x86/power/hibernate_asm_32.S
@@ -1,5 +1,3 @@
-.text
-
 /*
  * This may not use any stack, nor any variable that is not "NoSave":
  *
@@ -12,17 +10,18 @@
 #include <asm/segment.h>
 #include <asm/page.h>
 #include <asm/asm-offsets.h>
+#include <asm/processor-flags.h>
 
-	.text
+.text
 
 ENTRY(swsusp_arch_suspend)
-
 	movl %esp, saved_context_esp
 	movl %ebx, saved_context_ebx
 	movl %ebp, saved_context_ebp
 	movl %esi, saved_context_esi
 	movl %edi, saved_context_edi
-	pushfl ; popl saved_context_eflags
+	pushfl
+	popl saved_context_eflags
 
 	call swsusp_save
 	ret
@@ -59,7 +58,7 @@ done:
 	movl	mmu_cr4_features, %ecx
 	jecxz	1f	# cr4 Pentium and higher, skip if zero
 	movl	%ecx, %edx
-	andl	$~(1<<7), %edx;  # PGE
+	andl	$~(X86_CR4_PGE), %edx
 	movl	%edx, %cr4;  # turn off PGE
 1:
 	movl	%cr3, %eax;  # flush TLB
@@ -74,7 +73,8 @@ done:
 	movl saved_context_esi, %esi
 	movl saved_context_edi, %edi
 
-	pushl saved_context_eflags ; popfl
+	pushl saved_context_eflags
+	popfl
 
 	xorl	%eax, %eax
 

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

* Re: [PATCH] x86: Use X86_CR4_PGE in x86/power/hibernate_asm_32.S
  2008-08-20  9:53 ` Ingo Molnar
@ 2008-08-20 13:01   ` Rafael J. Wysocki
  2008-08-20 19:25   ` Pavel Machek
  1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2008-08-20 13:01 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Uros Bizjak, linux-kernel, H. Peter Anvin, Thomas Gleixner, Pavel Machek

On Wednesday, 20 of August 2008, Ingo Molnar wrote:
> 
> * Uros Bizjak <ubizjak@gmail.com> wrote:
> 
> > Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> 
> applied the commit below to tip/x86/cleanups - thanks Uros.
> 
> i did a small change: i moved the .text to after the include files. 
> While include files are not supposed to change section attributes, it 
> looks logically more consistent to have the .text right before the code.
> 
> 	Ingo
> 
> ----------------->
> From c171f465b7281f2d3b03e9145ec763d6a8bab176 Mon Sep 17 00:00:00 2001
> From: Uros Bizjak <ubizjak@gmail.com>
> Date: Wed, 20 Aug 2008 10:44:47 +0200
> Subject: [PATCH] x86, cleanup: use X86_CR4_PGE in x86/power/hibernate_asm_32.S
> 
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>

Acked-by: Rafael J. Wysocki <rjw@sisk.pl>

> ---
>  arch/x86/power/hibernate_asm_32.S |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/x86/power/hibernate_asm_32.S b/arch/x86/power/hibernate_asm_32.S
> index 4fc7e87..d1e9b53 100644
> --- a/arch/x86/power/hibernate_asm_32.S
> +++ b/arch/x86/power/hibernate_asm_32.S
> @@ -1,5 +1,3 @@
> -.text
> -
>  /*
>   * This may not use any stack, nor any variable that is not "NoSave":
>   *
> @@ -12,17 +10,18 @@
>  #include <asm/segment.h>
>  #include <asm/page.h>
>  #include <asm/asm-offsets.h>
> +#include <asm/processor-flags.h>
>  
> -	.text
> +.text
>  
>  ENTRY(swsusp_arch_suspend)
> -
>  	movl %esp, saved_context_esp
>  	movl %ebx, saved_context_ebx
>  	movl %ebp, saved_context_ebp
>  	movl %esi, saved_context_esi
>  	movl %edi, saved_context_edi
> -	pushfl ; popl saved_context_eflags
> +	pushfl
> +	popl saved_context_eflags
>  
>  	call swsusp_save
>  	ret
> @@ -59,7 +58,7 @@ done:
>  	movl	mmu_cr4_features, %ecx
>  	jecxz	1f	# cr4 Pentium and higher, skip if zero
>  	movl	%ecx, %edx
> -	andl	$~(1<<7), %edx;  # PGE
> +	andl	$~(X86_CR4_PGE), %edx
>  	movl	%edx, %cr4;  # turn off PGE
>  1:
>  	movl	%cr3, %eax;  # flush TLB
> @@ -74,7 +73,8 @@ done:
>  	movl saved_context_esi, %esi
>  	movl saved_context_edi, %edi
>  
> -	pushl saved_context_eflags ; popfl
> +	pushl saved_context_eflags
> +	popfl
>  
>  	xorl	%eax, %eax
>  
> 
> 



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

* Re: [PATCH] x86: Use X86_CR4_PGE in x86/power/hibernate_asm_32.S
  2008-08-20  9:53 ` Ingo Molnar
  2008-08-20 13:01   ` Rafael J. Wysocki
@ 2008-08-20 19:25   ` Pavel Machek
  1 sibling, 0 replies; 4+ messages in thread
From: Pavel Machek @ 2008-08-20 19:25 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Uros Bizjak, linux-kernel, H. Peter Anvin, Thomas Gleixner,
	Rafael J. Wysocki

On Wed 2008-08-20 11:53:53, Ingo Molnar wrote:
> 
> * Uros Bizjak <ubizjak@gmail.com> wrote:
> 
> > Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> 
> applied the commit below to tip/x86/cleanups - thanks Uros.
> 
> i did a small change: i moved the .text to after the include files. 
> While include files are not supposed to change section attributes, it 
> looks logically more consistent to have the .text right before the code.
> 
> 	Ingo
> 
> ----------------->
> >From c171f465b7281f2d3b03e9145ec763d6a8bab176 Mon Sep 17 00:00:00 2001
> From: Uros Bizjak <ubizjak@gmail.com>
> Date: Wed, 20 Aug 2008 10:44:47 +0200
> Subject: [PATCH] x86, cleanup: use X86_CR4_PGE in x86/power/hibernate_asm_32.S
> 
> Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>

ACK.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2008-08-20 19:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-20  8:44 [PATCH] x86: Use X86_CR4_PGE in x86/power/hibernate_asm_32.S Uros Bizjak
2008-08-20  9:53 ` Ingo Molnar
2008-08-20 13:01   ` Rafael J. Wysocki
2008-08-20 19:25   ` Pavel Machek

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

Powered by JetHome