* [PATCH] x86: relocate_kernel - use predefined PAGE_SIZE instead of own alias
@ 2008-03-21 20:12 Cyrill Gorcunov
2008-03-21 20:18 ` H. Peter Anvin
2008-03-21 20:53 ` Ingo Molnar
0 siblings, 2 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2008-03-21 20:12 UTC (permalink / raw)
To: Ingo Molnar; +Cc: H. Peter Anvin, LKML
This patch does clean up relocate_kernel_(32|64).S a bit by getting rid
of local PAGE_ALIGNED macro. We should use well-known PAGE_SIZE instead
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
relocate_kernel_32.S | 3 +--
relocate_kernel_64.S | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
Index: linux-2.6.git/arch/x86/kernel/relocate_kernel_32.S
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/relocate_kernel_32.S 2008-03-15 11:24:51.000000000 +0300
+++ linux-2.6.git/arch/x86/kernel/relocate_kernel_32.S 2008-03-21 23:00:10.000000000 +0300
@@ -15,12 +15,11 @@
*/
#define PTR(x) (x << 2)
-#define PAGE_ALIGNED (1 << PAGE_SHIFT)
#define PAGE_ATTR 0x63 /* _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY */
#define PAE_PGD_ATTR 0x01 /* _PAGE_PRESENT */
.text
- .align PAGE_ALIGNED
+ .align PAGE_SIZE
.globl relocate_kernel
relocate_kernel:
movl 8(%esp), %ebp /* list of pages */
Index: linux-2.6.git/arch/x86/kernel/relocate_kernel_64.S
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/relocate_kernel_64.S 2008-03-15 11:24:51.000000000 +0300
+++ linux-2.6.git/arch/x86/kernel/relocate_kernel_64.S 2008-03-21 22:59:08.000000000 +0300
@@ -15,11 +15,10 @@
*/
#define PTR(x) (x << 3)
-#define PAGE_ALIGNED (1 << PAGE_SHIFT)
#define PAGE_ATTR 0x63 /* _PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED|_PAGE_DIRTY */
.text
- .align PAGE_ALIGNED
+ .align PAGE_SIZE
.code64
.globl relocate_kernel
relocate_kernel:
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: relocate_kernel - use predefined PAGE_SIZE instead of own alias
2008-03-21 20:12 [PATCH] x86: relocate_kernel - use predefined PAGE_SIZE instead of own alias Cyrill Gorcunov
@ 2008-03-21 20:18 ` H. Peter Anvin
2008-03-21 20:41 ` Cyrill Gorcunov
2008-03-21 20:53 ` Ingo Molnar
1 sibling, 1 reply; 7+ messages in thread
From: H. Peter Anvin @ 2008-03-21 20:18 UTC (permalink / raw)
To: Cyrill Gorcunov; +Cc: Ingo Molnar, LKML
Cyrill Gorcunov wrote:
> This patch does clean up relocate_kernel_(32|64).S a bit by getting rid
> of local PAGE_ALIGNED macro. We should use well-known PAGE_SIZE instead
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Looks good!
-hpa
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: relocate_kernel - use predefined PAGE_SIZE instead of own alias
2008-03-21 20:18 ` H. Peter Anvin
@ 2008-03-21 20:41 ` Cyrill Gorcunov
2008-03-21 20:50 ` H. Peter Anvin
0 siblings, 1 reply; 7+ messages in thread
From: Cyrill Gorcunov @ 2008-03-21 20:41 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Ingo Molnar, LKML
[H. Peter Anvin - Fri, Mar 21, 2008 at 01:18:13PM -0700]
> Cyrill Gorcunov wrote:
>> This patch does clean up relocate_kernel_(32|64).S a bit by getting rid
>> of local PAGE_ALIGNED macro. We should use well-known PAGE_SIZE instead
>> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
>
> Looks good!
>
> -hpa
>
Thanks Peter for review, btw we have in relocate_kernel_32.S
188: movl %cr4, %eax
189: andl $0, %eax
190: movl %eax, %cr4
but maybe would be better just replace it with
xorl %eax, %eax
movl %eax, %cr4
or there is some nonobvious reason not to do so?
- Cyrill -
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: relocate_kernel - use predefined PAGE_SIZE instead of own alias
2008-03-21 20:41 ` Cyrill Gorcunov
@ 2008-03-21 20:50 ` H. Peter Anvin
2008-03-21 20:52 ` Cyrill Gorcunov
2008-03-21 21:02 ` Cyrill Gorcunov
0 siblings, 2 replies; 7+ messages in thread
From: H. Peter Anvin @ 2008-03-21 20:50 UTC (permalink / raw)
To: Cyrill Gorcunov; +Cc: Ingo Molnar, LKML
Cyrill Gorcunov wrote:
> [H. Peter Anvin - Fri, Mar 21, 2008 at 01:18:13PM -0700]
>> Cyrill Gorcunov wrote:
>>> This patch does clean up relocate_kernel_(32|64).S a bit by getting rid
>>> of local PAGE_ALIGNED macro. We should use well-known PAGE_SIZE instead
>>> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
>> Looks good!
>>
>> -hpa
>>
>
> Thanks Peter for review, btw we have in relocate_kernel_32.S
>
> 188: movl %cr4, %eax
> 189: andl $0, %eax
> 190: movl %eax, %cr4
>
> but maybe would be better just replace it with
>
> xorl %eax, %eax
> movl %eax, %cr4
>
> or there is some nonobvious reason not to do so?
>
The only case I can think of would be if the code expects to patch the
zero, but even then it'd be cantankerous, because gas will optimize that
zero down to a single byte.
So, no :)
-hpa
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: relocate_kernel - use predefined PAGE_SIZE instead of own alias
2008-03-21 20:50 ` H. Peter Anvin
@ 2008-03-21 20:52 ` Cyrill Gorcunov
2008-03-21 21:02 ` Cyrill Gorcunov
1 sibling, 0 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2008-03-21 20:52 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Ingo Molnar, LKML
[H. Peter Anvin - Fri, Mar 21, 2008 at 01:50:33PM -0700]
> Cyrill Gorcunov wrote:
>> [H. Peter Anvin - Fri, Mar 21, 2008 at 01:18:13PM -0700]
>>> Cyrill Gorcunov wrote:
>>>> This patch does clean up relocate_kernel_(32|64).S a bit by getting rid
>>>> of local PAGE_ALIGNED macro. We should use well-known PAGE_SIZE instead
>>>> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
>>> Looks good!
>>>
>>> -hpa
>>>
>> Thanks Peter for review, btw we have in relocate_kernel_32.S
>> 188: movl %cr4, %eax
>> 189: andl $0, %eax
>> 190: movl %eax, %cr4
>> but maybe would be better just replace it with
>> xorl %eax, %eax
>> movl %eax, %cr4
>> or there is some nonobvious reason not to do so?
>
> The only case I can think of would be if the code expects to patch the
> zero, but even then it'd be cantankerous, because gas will optimize that
> zero down to a single byte.
>
> So, no :)
>
> -hpa
>
>
ah! thanks ;)
- Cyrill -
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: relocate_kernel - use predefined PAGE_SIZE instead of own alias
2008-03-21 20:50 ` H. Peter Anvin
2008-03-21 20:52 ` Cyrill Gorcunov
@ 2008-03-21 21:02 ` Cyrill Gorcunov
1 sibling, 0 replies; 7+ messages in thread
From: Cyrill Gorcunov @ 2008-03-21 21:02 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Ingo Molnar, LKML
[H. Peter Anvin - Fri, Mar 21, 2008 at 01:50:33PM -0700]
> Cyrill Gorcunov wrote:
>> [H. Peter Anvin - Fri, Mar 21, 2008 at 01:18:13PM -0700]
>>> Cyrill Gorcunov wrote:
>>>> This patch does clean up relocate_kernel_(32|64).S a bit by getting rid
>>>> of local PAGE_ALIGNED macro. We should use well-known PAGE_SIZE instead
>>>> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
>>> Looks good!
>>>
>>> -hpa
>>>
>> Thanks Peter for review, btw we have in relocate_kernel_32.S
>> 188: movl %cr4, %eax
>> 189: andl $0, %eax
>> 190: movl %eax, %cr4
>> but maybe would be better just replace it with
>> xorl %eax, %eax
>> movl %eax, %cr4
>> or there is some nonobvious reason not to do so?
>
> The only case I can think of would be if the code expects to patch the
> zero, but even then it'd be cantankerous, because gas will optimize that
> zero down to a single byte.
>
> So, no :)
>
> -hpa
>
well, Peter, it seems I'm too tired on this week and misinterpred
your message, my prev message with text "ah..." is wrong, i'll patch
this code later (almost sleeping now ;)
- Cyrill -
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] x86: relocate_kernel - use predefined PAGE_SIZE instead of own alias
2008-03-21 20:12 [PATCH] x86: relocate_kernel - use predefined PAGE_SIZE instead of own alias Cyrill Gorcunov
2008-03-21 20:18 ` H. Peter Anvin
@ 2008-03-21 20:53 ` Ingo Molnar
1 sibling, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-03-21 20:53 UTC (permalink / raw)
To: Cyrill Gorcunov; +Cc: H. Peter Anvin, LKML
* Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> This patch does clean up relocate_kernel_(32|64).S a bit by getting
> rid of local PAGE_ALIGNED macro. We should use well-known PAGE_SIZE
> instead
thanks Cyrill, applied.
Ingo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-03-21 21:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-21 20:12 [PATCH] x86: relocate_kernel - use predefined PAGE_SIZE instead of own alias Cyrill Gorcunov
2008-03-21 20:18 ` H. Peter Anvin
2008-03-21 20:41 ` Cyrill Gorcunov
2008-03-21 20:50 ` H. Peter Anvin
2008-03-21 20:52 ` Cyrill Gorcunov
2008-03-21 21:02 ` Cyrill Gorcunov
2008-03-21 20:53 ` Ingo Molnar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.