linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86 cleanup: suspend_asm_64.S - use X86_CR4_PGE instead of numeric value
@ 2008-02-08 21:49 Cyrill Gorcunov
  2008-02-17 18:17 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Cyrill Gorcunov @ 2008-02-08 21:49 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: H. Peter Anvin, Andi Kleen, Jeremy Fitzhardinge, LKML

By including <asm/processor-flags.h> we're allowed to use
X86_CR4_PGE instead of numeric constant.

md5 sums of compiled files are differ due to this inclusion
but .text section remains the same.

---

If anyone has an objection on this patch - just drop it please.

I'm not sure but this could have a side effect in case of future
<asm/processor-flags.h> modifications so it would require
__ASSEMBLY__ preprocessor directive.

Index: linux-2.6.git/arch/x86/kernel/suspend_asm_64.S
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/suspend_asm_64.S	2008-02-09 00:28:45.000000000 +0300
+++ linux-2.6.git/arch/x86/kernel/suspend_asm_64.S	2008-02-09 00:28:48.000000000 +0300
@@ -9,12 +9,13 @@
  * image could very well be data page in "new" image, and overwriting
  * 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>
+#include <asm/processor-flags.h>
 
 ENTRY(swsusp_arch_suspend)
 	movq	$saved_context, %rax
@@ -55,7 +56,7 @@ ENTRY(restore_image)
 	/* Flush TLB */
 	movq	mmu_cr4_features(%rip), %rax
 	movq	%rax, %rdx
-	andq	$~(1<<7), %rdx	# PGE
+	andq	$~(X86_CR4_PGE), %rdx
 	movq	%rdx, %cr4;  # turn off PGE
 	movq	%cr3, %rcx;  # flush TLB
 	movq	%rcx, %cr3;
@@ -107,7 +108,7 @@ ENTRY(restore_registers)
 	/* Flush TLB, including "global" things (vmalloc) */
 	movq	mmu_cr4_features(%rip), %rax
 	movq	%rax, %rdx
-	andq	$~(1<<7), %rdx;  # PGE
+	andq	$~(X86_CR4_PGE), %rdx
 	movq	%rdx, %cr4;  # turn off PGE
 	movq	%cr3, %rcx;  # flush TLB
 	movq	%rcx, %cr3

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

* Re: [PATCH] x86 cleanup: suspend_asm_64.S - use X86_CR4_PGE instead of numeric value
  2008-02-08 21:49 [PATCH] x86 cleanup: suspend_asm_64.S - use X86_CR4_PGE instead of numeric value Cyrill Gorcunov
@ 2008-02-17 18:17 ` Ingo Molnar
  2008-02-17 18:41   ` Cyrill Gorcunov
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2008-02-17 18:17 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: H. Peter Anvin, Andi Kleen, Jeremy Fitzhardinge, LKML


* Cyrill Gorcunov <gorcunov@gmail.com> wrote:

> By including <asm/processor-flags.h> we're allowed to use X86_CR4_PGE 
> instead of numeric constant.
> 
> md5 sums of compiled files are differ due to this inclusion but .text 
> section remains the same.

thanks Cyrill, picked it up. (the merged version is below - the target 
files moved meanwhile)

	Ingo

------------->
Subject: x86 cleanup: suspend_asm_64.S - use X86_CR4_PGE instead of numeric value
From: Cyrill Gorcunov <gorcunov@gmail.com>
Date: Sat, 9 Feb 2008 00:49:13 +0300

By including <asm/processor-flags.h> we're allowed to use
X86_CR4_PGE instead of numeric constant.

md5 sums of compiled files are differ due to this inclusion
but .text section remains the same.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/power/hibernate_asm_64.S |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-x86.q/arch/x86/power/hibernate_asm_64.S
===================================================================
--- linux-x86.q.orig/arch/x86/power/hibernate_asm_64.S
+++ linux-x86.q/arch/x86/power/hibernate_asm_64.S
@@ -20,6 +20,7 @@
 #include <asm/segment.h>
 #include <asm/page.h>
 #include <asm/asm-offsets.h>
+#include <asm/processor-flags.h>
 
 ENTRY(swsusp_arch_suspend)
 	movq	$saved_context, %rax
@@ -60,7 +61,7 @@ ENTRY(restore_image)
 	/* Flush TLB */
 	movq	mmu_cr4_features(%rip), %rax
 	movq	%rax, %rdx
-	andq	$~(1<<7), %rdx	# PGE
+	andq	$~(X86_CR4_PGE), %rdx
 	movq	%rdx, %cr4;  # turn off PGE
 	movq	%cr3, %rcx;  # flush TLB
 	movq	%rcx, %cr3;
@@ -112,7 +113,7 @@ ENTRY(restore_registers)
 	/* Flush TLB, including "global" things (vmalloc) */
 	movq	mmu_cr4_features(%rip), %rax
 	movq	%rax, %rdx
-	andq	$~(1<<7), %rdx;  # PGE
+	andq	$~(X86_CR4_PGE), %rdx
 	movq	%rdx, %cr4;  # turn off PGE
 	movq	%cr3, %rcx;  # flush TLB
 	movq	%rcx, %cr3

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

* Re: [PATCH] x86 cleanup: suspend_asm_64.S - use X86_CR4_PGE instead of numeric value
  2008-02-17 18:17 ` Ingo Molnar
@ 2008-02-17 18:41   ` Cyrill Gorcunov
  0 siblings, 0 replies; 3+ messages in thread
From: Cyrill Gorcunov @ 2008-02-17 18:41 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: H. Peter Anvin, Andi Kleen, Jeremy Fitzhardinge, LKML

[Ingo Molnar - Sun, Feb 17, 2008 at 07:17:16PM +0100]
| 
| * Cyrill Gorcunov <gorcunov@gmail.com> wrote:
| 
| > By including <asm/processor-flags.h> we're allowed to use X86_CR4_PGE 
| > instead of numeric constant.
| > 
| > md5 sums of compiled files are differ due to this inclusion but .text 
| > section remains the same.
| 
| thanks Cyrill, picked it up. (the merged version is below - the target 
| files moved meanwhile)
| 
| 	Ingo
| 
[...]

Thanks, Ingo

		- Cyrill -

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

end of thread, other threads:[~2008-02-17 18:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-08 21:49 [PATCH] x86 cleanup: suspend_asm_64.S - use X86_CR4_PGE instead of numeric value Cyrill Gorcunov
2008-02-17 18:17 ` Ingo Molnar
2008-02-17 18:41   ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).