* [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register [not found] <20080513165538.952646389@gmail.com> @ 2008-05-13 16:55 ` Cyrill Gorcunov 2008-05-13 17:03 ` H. Peter Anvin 2008-05-13 16:55 ` [patch 2/2] x86: head_64.S cleanup - use PMD_SHIFT instead of numeric constant Cyrill Gorcunov 1 sibling, 1 reply; 7+ messages in thread From: Cyrill Gorcunov @ 2008-05-13 16:55 UTC (permalink / raw) To: tglx, mingo, hpa, linux-kernel; +Cc: Cyrill Gorcunov, jirislaby [-- Attachment #1: x86-head-64-S-flags --] [-- Type: text/plain, Size: 710 bytes --] 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@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. */ -- ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register 2008-05-13 16:55 ` [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register Cyrill Gorcunov @ 2008-05-13 17:03 ` H. Peter Anvin 2008-05-13 17:07 ` Cyrill Gorcunov 2008-05-13 17:09 ` Cyrill Gorcunov 0 siblings, 2 replies; 7+ messages in thread From: H. Peter Anvin @ 2008-05-13 17:03 UTC (permalink / raw) To: Cyrill Gorcunov; +Cc: tglx, mingo, linux-kernel, jirislaby 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register 2008-05-13 17:03 ` H. Peter Anvin @ 2008-05-13 17:07 ` Cyrill Gorcunov 2008-05-13 17:09 ` Cyrill Gorcunov 1 sibling, 0 replies; 7+ messages in thread From: Cyrill Gorcunov @ 2008-05-13 17:07 UTC (permalink / raw) To: H. Peter Anvin; +Cc: tglx, mingo, linux-kernel, jirislaby [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 - ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register 2008-05-13 17:03 ` H. Peter Anvin 2008-05-13 17:07 ` Cyrill Gorcunov @ 2008-05-13 17:09 ` Cyrill Gorcunov 2008-05-13 17:11 ` H. Peter Anvin 1 sibling, 1 reply; 7+ messages in thread From: Cyrill Gorcunov @ 2008-05-13 17:09 UTC (permalink / raw) To: H. Peter Anvin; +Cc: tglx, mingo, linux-kernel, jirislaby [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@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. */ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register 2008-05-13 17:09 ` Cyrill Gorcunov @ 2008-05-13 17:11 ` H. Peter Anvin 2008-05-13 17:14 ` Cyrill Gorcunov 0 siblings, 1 reply; 7+ messages in thread From: H. Peter Anvin @ 2008-05-13 17:11 UTC (permalink / raw) To: Cyrill Gorcunov; +Cc: tglx, mingo, linux-kernel, jirislaby 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@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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register 2008-05-13 17:11 ` H. Peter Anvin @ 2008-05-13 17:14 ` Cyrill Gorcunov 0 siblings, 0 replies; 7+ messages in thread From: Cyrill Gorcunov @ 2008-05-13 17:14 UTC (permalink / raw) To: H. Peter Anvin; +Cc: tglx, mingo, linux-kernel, jirislaby [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@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@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 - ^ permalink raw reply [flat|nested] 7+ messages in thread
* [patch 2/2] x86: head_64.S cleanup - use PMD_SHIFT instead of numeric constant [not found] <20080513165538.952646389@gmail.com> 2008-05-13 16:55 ` [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register Cyrill Gorcunov @ 2008-05-13 16:55 ` Cyrill Gorcunov 1 sibling, 0 replies; 7+ messages in thread From: Cyrill Gorcunov @ 2008-05-13 16:55 UTC (permalink / raw) To: tglx, mingo, hpa, linux-kernel; +Cc: Cyrill Gorcunov, jirislaby [-- Attachment #1: x86-head-64-pmd --] [-- Type: text/plain, Size: 754 bytes --] Signed-off-by: Cyrill Gorcunov <gorcunov@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:05:04.000000000 +0400 +++ linux-2.6.git/arch/x86/kernel/head_64.S 2008-05-13 20:22:27.000000000 +0400 @@ -322,11 +322,11 @@ early_idt_ripmsg: ENTRY(name) /* Automate the creation of 1 to 1 mapping pmd entries */ -#define PMDS(START, PERM, COUNT) \ - i = 0 ; \ - .rept (COUNT) ; \ - .quad (START) + (i << 21) + (PERM) ; \ - i = i + 1 ; \ +#define PMDS(START, PERM, COUNT) \ + i = 0 ; \ + .rept (COUNT) ; \ + .quad (START) + (i << PMD_SHIFT) + (PERM) ; \ + i = i + 1 ; \ .endr /* -- ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-05-13 17:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20080513165538.952646389@gmail.com>
2008-05-13 16:55 ` [patch 1/2] x86: head_64.S cleanup - use straight move to CR4 register Cyrill Gorcunov
2008-05-13 17:03 ` H. Peter Anvin
2008-05-13 17:07 ` Cyrill Gorcunov
2008-05-13 17:09 ` Cyrill Gorcunov
2008-05-13 17:11 ` H. Peter Anvin
2008-05-13 17:14 ` Cyrill Gorcunov
2008-05-13 16:55 ` [patch 2/2] x86: head_64.S cleanup - use PMD_SHIFT instead of numeric constant Cyrill Gorcunov
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®