Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


gorcunov at gmail

May 13, 2008, 9:55 AM

Post #1 of 6 (408 views)
Permalink
[patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register

There is no need for testing the values because we already know
what they should be. Just set them in straight way.

Signed-off-by: Cyrill Gorcunov <gorcunov[at]gmail.com>
---

Index: linux-2.6.git/arch/x86/kernel/head_64.S
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/head_64.S 2008-05-13 19:17:31.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/head_64.S 2008-05-13 19:35:11.000000000 +0400
@@ -155,9 +155,7 @@ ENTRY(secondary_startup_64)
*/

/* Enable PAE mode and PGE */
- xorq %rax, %rax
- btsq $5, %rax
- btsq $7, %rax
+ movq $(X86_CR4_PAE | X86_CR4_PGE), %rax
movq %rax, %cr4

/* Setup early boot stage 4 level pagetables. */

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


hpa at zytor

May 13, 2008, 10:03 AM

Post #2 of 6 (370 views)
Permalink
Re: [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register [In reply to]

Cyrill Gorcunov wrote:
> There is no need for testing the values because we already know
> what they should be. Just set them in straight way.

He isn't testing them, he's setting individual bits.

Either of these is pretty silly; the right way to do this is:

movl $(X86_CR4_PAE|X86_CR4_PGE), %eax
movq %rax, %cr4

A movl in 64-bit mode zero extends.

-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


gorcunov at gmail

May 13, 2008, 10:07 AM

Post #3 of 6 (370 views)
Permalink
Re: [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register [In reply to]

[.H. Peter Anvin - Tue, May 13, 2008 at 10:03:42AM -0700]
> Cyrill Gorcunov wrote:
>> There is no need for testing the values because we already know
>> what they should be. Just set them in straight way.
>
> He isn't testing them, he's setting individual bits.

not exactly - bts: bit test and set

>
> Either of these is pretty silly; the right way to do this is:
>
> movl $(X86_CR4_PAE|X86_CR4_PGE), %eax
> movq %rax, %cr4
>
> A movl in 64-bit mode zero extends.
>
> -hpa
>
ok, thanks Peter, i'll update in minute ;)

- Cyrill -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


gorcunov at gmail

May 13, 2008, 10:09 AM

Post #4 of 6 (368 views)
Permalink
Re: [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register [In reply to]

[.H. Peter Anvin - Tue, May 13, 2008 at 10:03:42AM -0700]
> Cyrill Gorcunov wrote:
>> There is no need for testing the values because we already know
>> what they should be. Just set them in straight way.
>
> He isn't testing them, he's setting individual bits.
>
> Either of these is pretty silly; the right way to do this is:
>
> movl $(X86_CR4_PAE|X86_CR4_PGE), %eax
> movq %rax, %cr4
>
> A movl in 64-bit mode zero extends.
>
> -hpa
>

Here is updated version
---
[PATCH] x86: head_64.S cleanup - use straight move to CR4 register

Signed-off-by: Cyrill Gorcunov <gorcunov[at]gmail.com>
---

Index: linux-2.6.git/arch/x86/kernel/head_64.S
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/head_64.S 2008-05-13 20:04:23.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/head_64.S 2008-05-13 21:08:20.000000000 +0400
@@ -155,9 +155,7 @@ ENTRY(secondary_startup_64)
*/

/* Enable PAE mode and PGE */
- xorq %rax, %rax
- btsq $5, %rax
- btsq $7, %rax
+ movl $(X86_CR4_PAE | X86_CR4_PGE), %rax
movq %rax, %cr4

/* Setup early boot stage 4 level pagetables. */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


hpa at zytor

May 13, 2008, 10:11 AM

Post #5 of 6 (371 views)
Permalink
Re: [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register [In reply to]

Cyrill Gorcunov wrote:
> [.H. Peter Anvin - Tue, May 13, 2008 at 10:03:42AM -0700]
>> Cyrill Gorcunov wrote:
>>> There is no need for testing the values because we already know
>>> what they should be. Just set them in straight way.
>> He isn't testing them, he's setting individual bits.
>>
>> Either of these is pretty silly; the right way to do this is:
>>
>> movl $(X86_CR4_PAE|X86_CR4_PGE), %eax
>> movq %rax, %cr4
>>
>> A movl in 64-bit mode zero extends.
>>
>> -hpa
>>
>
> Here is updated version
> ---
> [PATCH] x86: head_64.S cleanup - use straight move to CR4 register
>
> Signed-off-by: Cyrill Gorcunov <gorcunov[at]gmail.com>
> ---
>
> Index: linux-2.6.git/arch/x86/kernel/head_64.S
> ===================================================================
> --- linux-2.6.git.orig/arch/x86/kernel/head_64.S 2008-05-13 20:04:23.000000000 +0400
> +++ linux-2.6.git/arch/x86/kernel/head_64.S 2008-05-13 21:08:20.000000000 +0400
> @@ -155,9 +155,7 @@ ENTRY(secondary_startup_64)
> */
>
> /* Enable PAE mode and PGE */
> - xorq %rax, %rax
> - btsq $5, %rax
> - btsq $7, %rax
> + movl $(X86_CR4_PAE | X86_CR4_PGE), %rax
> movq %rax, %cr4
>

Syntax error. %eax, not %rax.

-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


gorcunov at gmail

May 13, 2008, 10:14 AM

Post #6 of 6 (370 views)
Permalink
Re: [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register [In reply to]

[.H. Peter Anvin - Tue, May 13, 2008 at 10:11:34AM -0700]
> Cyrill Gorcunov wrote:
>> [.H. Peter Anvin - Tue, May 13, 2008 at 10:03:42AM -0700]
>>> Cyrill Gorcunov wrote:
>>>> There is no need for testing the values because we already know
>>>> what they should be. Just set them in straight way.
>>> He isn't testing them, he's setting individual bits.
>>>
>>> Either of these is pretty silly; the right way to do this is:
>>>
>>> movl $(X86_CR4_PAE|X86_CR4_PGE), %eax
>>> movq %rax, %cr4
>>>
>>> A movl in 64-bit mode zero extends.
>>>
>>> -hpa
>>>
>> Here is updated version
>> ---
>> [PATCH] x86: head_64.S cleanup - use straight move to CR4 register
>> Signed-off-by: Cyrill Gorcunov <gorcunov[at]gmail.com>
>> ---
>> Index: linux-2.6.git/arch/x86/kernel/head_64.S
>> ===================================================================
>> --- linux-2.6.git.orig/arch/x86/kernel/head_64.S 2008-05-13
>> 20:04:23.000000000 +0400
>> +++ linux-2.6.git/arch/x86/kernel/head_64.S 2008-05-13 21:08:20.000000000
>> +0400
>> @@ -155,9 +155,7 @@ ENTRY(secondary_startup_64)
>> */
>> /* Enable PAE mode and PGE */
>> - xorq %rax, %rax
>> - btsq $5, %rax
>> - btsq $7, %rax
>> + movl $(X86_CR4_PAE | X86_CR4_PGE), %rax
>> movq %rax, %cr4
>>
>
> Syntax error. %eax, not %rax.
>
> -hpa
>


Oh my, what I'm doing... sorry
Here we go

---
[PATCH] x86: head_64.S cleanup - use straight move to CR4 register

Signed-off-by: Cyrill Gorcunov <gorcunov[at]gmail.com>
---

Index: linux-2.6.git/arch/x86/kernel/head_64.S
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/head_64.S 2008-05-13 20:04:23.000000000 +0400
+++ linux-2.6.git/arch/x86/kernel/head_64.S 2008-05-13 21:12:39.000000000 +0400
@@ -155,9 +155,7 @@ ENTRY(secondary_startup_64)
*/

/* Enable PAE mode and PGE */
- xorq %rax, %rax
- btsq $5, %rax
- btsq $7, %rax
+ movl $(X86_CR4_PAE | X86_CR4_PGE), %eax
movq %rax, %cr4

/* Setup early boot stage 4 level pagetables. */

- Cyrill -
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo[at]vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.