* [PATCH] Cleanup of asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm)
@ 2011-02-23 14:42 Stratos Psomadakis
2011-02-24 23:21 ` Steven Rostedt
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Stratos Psomadakis @ 2011-02-23 14:42 UTC (permalink / raw)
To: linux-kernel; +Cc: Stratos Psomadakis
I noticed that PAGE_SIZE_asm, PAGE_SHIFT_asm, and THREAD_SIZE_asm in asm-offsets.c were
no longer needed(since the _AC macro defined in include/linux/const.h makes PAGE_SIZE etc
'work' with as).
Unless I'm missing something here, PAGE_SIZE_asm/PAGE_SHIFT_asm/THREAD_SIZE_asm can be safely
removed from asm-offsets.c, and be replaced by their non-'_asm' counterparts in the code that
uses them.
Right?
The kernel builds cleanly after the patch is applied.
(I know that even if the patch is 'correct', it's as 'important', as a patch fixing typos
in comments/documentation, but anyway :/ )
Signed-off-by: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
---
arch/mn10300/kernel/asm-offsets.c | 2 +-
arch/mn10300/kernel/gdb-io-ttysm-low.S | 2 +-
arch/x86/kernel/asm-offsets_32.c | 4 ----
arch/x86/kernel/asm-offsets_64.c | 1 -
arch/x86/kernel/entry_32.S | 2 +-
arch/x86/kernel/head_32.S | 8 ++++----
arch/x86/xen/xen-head.S | 4 ++--
7 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/arch/mn10300/kernel/asm-offsets.c b/arch/mn10300/kernel/asm-offsets.c
index 96f24fa..cbe7cda 100644
--- a/arch/mn10300/kernel/asm-offsets.c
+++ b/arch/mn10300/kernel/asm-offsets.c
@@ -89,7 +89,7 @@ void foo(void)
OFFSET(EXEC_DOMAIN_handler, exec_domain, handler);
OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
- DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
+ DEFINE(PAGE_SIZE, PAGE_SIZE);
OFFSET(__rx_buffer, mn10300_serial_port, rx_buffer);
OFFSET(__rx_inp, mn10300_serial_port, rx_inp);
diff --git a/arch/mn10300/kernel/gdb-io-ttysm-low.S b/arch/mn10300/kernel/gdb-io-ttysm-low.S
index 060b7cc..7b2d665 100644
--- a/arch/mn10300/kernel/gdb-io-ttysm-low.S
+++ b/arch/mn10300/kernel/gdb-io-ttysm-low.S
@@ -38,7 +38,7 @@ gdbstub_io_rx_handler:
gdbstub_io_rx_more:
mov a3,a2
add 2,a3
- and PAGE_SIZE_asm-1,a3
+ and PAGE_SIZE-1,a3
mov (gdbstub_rx_outp),d3
cmp a3,d3
beq gdbstub_io_rx_overflow
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index 1a4088d..e1e5009 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -97,10 +97,6 @@ void foo(void)
DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -
sizeof(struct tss_struct));
- DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
- DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT);
- DEFINE(THREAD_SIZE_asm, THREAD_SIZE);
-
OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
#ifdef CONFIG_PARAVIRT
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 4a6aeed..aab9bdb 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -129,7 +129,6 @@ int main(void)
OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
BLANK();
- DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
#ifdef CONFIG_XEN
BLANK();
OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index c8b4efa..49bdedd 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -395,7 +395,7 @@ sysenter_past_esp:
* A tiny bit of offset fixup is necessary - 4*4 means the 4 words
* pushed above; +8 corresponds to copy_thread's esp0 setting.
*/
- pushl_cfi ((TI_sysenter_return)-THREAD_SIZE_asm+8+4*4)(%esp)
+ pushl_cfi ((TI_sysenter_return)-THREAD_SIZE+8+4*4)(%esp)
CFI_REL_OFFSET eip, 0
pushl_cfi %eax
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 767d6c4..187aa63 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -73,7 +73,7 @@ MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT
*/
KERNEL_PAGES = LOWMEM_PAGES
-INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm
+INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE
RESERVE_BRK(pagetables, INIT_MAP_SIZE)
/*
@@ -623,7 +623,7 @@ ENTRY(initial_code)
* BSS section
*/
__PAGE_ALIGNED_BSS
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
#ifdef CONFIG_X86_PAE
initial_pg_pmd:
.fill 1024*KPMDS,4,0
@@ -644,7 +644,7 @@ ENTRY(swapper_pg_dir)
#ifdef CONFIG_X86_PAE
__PAGE_ALIGNED_DATA
/* Page-aligned for the benefit of paravirt? */
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
ENTRY(initial_page_table)
.long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */
# if KPMDS == 3
@@ -662,7 +662,7 @@ ENTRY(initial_page_table)
# else
# error "Kernel PMDs should be 1, 2 or 3"
# endif
- .align PAGE_SIZE_asm /* needs to be page-sized too */
+ .align PAGE_SIZE /* needs to be page-sized too */
#endif
.data
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 1a5ff24..aaa7291 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -28,9 +28,9 @@ ENTRY(startup_xen)
__FINIT
.pushsection .text
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
ENTRY(hypercall_page)
- .skip PAGE_SIZE_asm
+ .skip PAGE_SIZE
.popsection
ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux")
--
1.7.4.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] Cleanup of asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm)
2011-02-23 14:42 [PATCH] Cleanup of asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm) Stratos Psomadakis
@ 2011-02-24 23:21 ` Steven Rostedt
2011-02-25 20:03 ` [PATCH RESEND 0/1] " Stratos Psomadakis
2011-02-25 20:46 ` [PATCH SPLIT 0/2] Cleanup " Stratos Psomadakis
2 siblings, 0 replies; 9+ messages in thread
From: Steven Rostedt @ 2011-02-24 23:21 UTC (permalink / raw)
To: Stratos Psomadakis
Cc: linux-kernel, Andrew Morton, Linus Torvalds, Thomas Gleixner,
Ingo Molnar, Randy Dunlap, David Howells
[ Added Cc to those that may care ]
On Wed, Feb 23, 2011 at 04:42:02PM +0200, Stratos Psomadakis wrote:
> I noticed that PAGE_SIZE_asm, PAGE_SHIFT_asm, and THREAD_SIZE_asm in asm-offsets.c were
> no longer needed(since the _AC macro defined in include/linux/const.h makes PAGE_SIZE etc
> 'work' with as).
>
> Unless I'm missing something here, PAGE_SIZE_asm/PAGE_SHIFT_asm/THREAD_SIZE_asm can be safely
> removed from asm-offsets.c, and be replaced by their non-'_asm' counterparts in the code that
> uses them.
> Right?
>
> The kernel builds cleanly after the patch is applied.
>
> (I know that even if the patch is 'correct', it's as 'important', as a patch fixing typos
> in comments/documentation, but anyway :/ )
This patch makes sense to me.
-- Steve
>
>
> Signed-off-by: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
> ---
> arch/mn10300/kernel/asm-offsets.c | 2 +-
> arch/mn10300/kernel/gdb-io-ttysm-low.S | 2 +-
> arch/x86/kernel/asm-offsets_32.c | 4 ----
> arch/x86/kernel/asm-offsets_64.c | 1 -
> arch/x86/kernel/entry_32.S | 2 +-
> arch/x86/kernel/head_32.S | 8 ++++----
> arch/x86/xen/xen-head.S | 4 ++--
> 7 files changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/arch/mn10300/kernel/asm-offsets.c b/arch/mn10300/kernel/asm-offsets.c
> index 96f24fa..cbe7cda 100644
> --- a/arch/mn10300/kernel/asm-offsets.c
> +++ b/arch/mn10300/kernel/asm-offsets.c
> @@ -89,7 +89,7 @@ void foo(void)
> OFFSET(EXEC_DOMAIN_handler, exec_domain, handler);
> OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
>
> - DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
> + DEFINE(PAGE_SIZE, PAGE_SIZE);
>
> OFFSET(__rx_buffer, mn10300_serial_port, rx_buffer);
> OFFSET(__rx_inp, mn10300_serial_port, rx_inp);
> diff --git a/arch/mn10300/kernel/gdb-io-ttysm-low.S b/arch/mn10300/kernel/gdb-io-ttysm-low.S
> index 060b7cc..7b2d665 100644
> --- a/arch/mn10300/kernel/gdb-io-ttysm-low.S
> +++ b/arch/mn10300/kernel/gdb-io-ttysm-low.S
> @@ -38,7 +38,7 @@ gdbstub_io_rx_handler:
> gdbstub_io_rx_more:
> mov a3,a2
> add 2,a3
> - and PAGE_SIZE_asm-1,a3
> + and PAGE_SIZE-1,a3
> mov (gdbstub_rx_outp),d3
> cmp a3,d3
> beq gdbstub_io_rx_overflow
> diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
> index 1a4088d..e1e5009 100644
> --- a/arch/x86/kernel/asm-offsets_32.c
> +++ b/arch/x86/kernel/asm-offsets_32.c
> @@ -97,10 +97,6 @@ void foo(void)
> DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -
> sizeof(struct tss_struct));
>
> - DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
> - DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT);
> - DEFINE(THREAD_SIZE_asm, THREAD_SIZE);
> -
> OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
>
> #ifdef CONFIG_PARAVIRT
> diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
> index 4a6aeed..aab9bdb 100644
> --- a/arch/x86/kernel/asm-offsets_64.c
> +++ b/arch/x86/kernel/asm-offsets_64.c
> @@ -129,7 +129,6 @@ int main(void)
> OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
>
> BLANK();
> - DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
> #ifdef CONFIG_XEN
> BLANK();
> OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
> diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
> index c8b4efa..49bdedd 100644
> --- a/arch/x86/kernel/entry_32.S
> +++ b/arch/x86/kernel/entry_32.S
> @@ -395,7 +395,7 @@ sysenter_past_esp:
> * A tiny bit of offset fixup is necessary - 4*4 means the 4 words
> * pushed above; +8 corresponds to copy_thread's esp0 setting.
> */
> - pushl_cfi ((TI_sysenter_return)-THREAD_SIZE_asm+8+4*4)(%esp)
> + pushl_cfi ((TI_sysenter_return)-THREAD_SIZE+8+4*4)(%esp)
> CFI_REL_OFFSET eip, 0
>
> pushl_cfi %eax
> diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
> index 767d6c4..187aa63 100644
> --- a/arch/x86/kernel/head_32.S
> +++ b/arch/x86/kernel/head_32.S
> @@ -73,7 +73,7 @@ MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT
> */
> KERNEL_PAGES = LOWMEM_PAGES
>
> -INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm
> +INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE
> RESERVE_BRK(pagetables, INIT_MAP_SIZE)
>
> /*
> @@ -623,7 +623,7 @@ ENTRY(initial_code)
> * BSS section
> */
> __PAGE_ALIGNED_BSS
> - .align PAGE_SIZE_asm
> + .align PAGE_SIZE
> #ifdef CONFIG_X86_PAE
> initial_pg_pmd:
> .fill 1024*KPMDS,4,0
> @@ -644,7 +644,7 @@ ENTRY(swapper_pg_dir)
> #ifdef CONFIG_X86_PAE
> __PAGE_ALIGNED_DATA
> /* Page-aligned for the benefit of paravirt? */
> - .align PAGE_SIZE_asm
> + .align PAGE_SIZE
> ENTRY(initial_page_table)
> .long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */
> # if KPMDS == 3
> @@ -662,7 +662,7 @@ ENTRY(initial_page_table)
> # else
> # error "Kernel PMDs should be 1, 2 or 3"
> # endif
> - .align PAGE_SIZE_asm /* needs to be page-sized too */
> + .align PAGE_SIZE /* needs to be page-sized too */
> #endif
>
> .data
> diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
> index 1a5ff24..aaa7291 100644
> --- a/arch/x86/xen/xen-head.S
> +++ b/arch/x86/xen/xen-head.S
> @@ -28,9 +28,9 @@ ENTRY(startup_xen)
> __FINIT
>
> .pushsection .text
> - .align PAGE_SIZE_asm
> + .align PAGE_SIZE
> ENTRY(hypercall_page)
> - .skip PAGE_SIZE_asm
> + .skip PAGE_SIZE
> .popsection
>
> ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux")
> --
> 1.7.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH RESEND 0/1] Cleanup of asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm)
2011-02-23 14:42 [PATCH] Cleanup of asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm) Stratos Psomadakis
2011-02-24 23:21 ` Steven Rostedt
@ 2011-02-25 20:03 ` Stratos Psomadakis
2011-02-25 20:03 ` [PATCH RESEND 1/1] " Stratos Psomadakis
2011-02-25 20:46 ` [PATCH SPLIT 0/2] Cleanup " Stratos Psomadakis
2 siblings, 1 reply; 9+ messages in thread
From: Stratos Psomadakis @ 2011-02-25 20:03 UTC (permalink / raw)
To: linux-kernel
Fixed a typo, resending.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH RESEND 1/1] Cleanup of asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm)
2011-02-25 20:03 ` [PATCH RESEND 0/1] " Stratos Psomadakis
@ 2011-02-25 20:03 ` Stratos Psomadakis
2011-02-25 20:20 ` H. Peter Anvin
0 siblings, 1 reply; 9+ messages in thread
From: Stratos Psomadakis @ 2011-02-25 20:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Stratos Psomadakis
Cleanup of asm-offsets.c.
PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm can be safely removed from
asm-offsets.c, and be replaced by their non-'_asm' counterparts in the code
that uses them, since the _AC macro defined in include/linux/const.h makes
PAGE_SIZE/PAGE_SHIFT/THREAD_SIZE work with as.
Signed-off-by: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
---
arch/mn10300/kernel/asm-offsets.c | 2 --
arch/mn10300/kernel/gdb-io-ttysm-low.S | 2 +-
arch/x86/kernel/asm-offsets_32.c | 4 ----
arch/x86/kernel/asm-offsets_64.c | 1 -
arch/x86/kernel/entry_32.S | 2 +-
arch/x86/kernel/head_32.S | 8 ++++----
arch/x86/xen/xen-head.S | 4 ++--
7 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/arch/mn10300/kernel/asm-offsets.c b/arch/mn10300/kernel/asm-offsets.c
index 96f24fa..698eb60 100644
--- a/arch/mn10300/kernel/asm-offsets.c
+++ b/arch/mn10300/kernel/asm-offsets.c
@@ -89,8 +89,6 @@ void foo(void)
OFFSET(EXEC_DOMAIN_handler, exec_domain, handler);
OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
- DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
-
OFFSET(__rx_buffer, mn10300_serial_port, rx_buffer);
OFFSET(__rx_inp, mn10300_serial_port, rx_inp);
OFFSET(__rx_outp, mn10300_serial_port, rx_outp);
diff --git a/arch/mn10300/kernel/gdb-io-ttysm-low.S b/arch/mn10300/kernel/gdb-io-ttysm-low.S
index 060b7cc..7b2d665 100644
--- a/arch/mn10300/kernel/gdb-io-ttysm-low.S
+++ b/arch/mn10300/kernel/gdb-io-ttysm-low.S
@@ -38,7 +38,7 @@ gdbstub_io_rx_handler:
gdbstub_io_rx_more:
mov a3,a2
add 2,a3
- and PAGE_SIZE_asm-1,a3
+ and PAGE_SIZE-1,a3
mov (gdbstub_rx_outp),d3
cmp a3,d3
beq gdbstub_io_rx_overflow
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index 1a4088d..e1e5009 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -97,10 +97,6 @@ void foo(void)
DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -
sizeof(struct tss_struct));
- DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
- DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT);
- DEFINE(THREAD_SIZE_asm, THREAD_SIZE);
-
OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
#ifdef CONFIG_PARAVIRT
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 4a6aeed..aab9bdb 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -129,7 +129,6 @@ int main(void)
OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
BLANK();
- DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
#ifdef CONFIG_XEN
BLANK();
OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index c8b4efa..49bdedd 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -395,7 +395,7 @@ sysenter_past_esp:
* A tiny bit of offset fixup is necessary - 4*4 means the 4 words
* pushed above; +8 corresponds to copy_thread's esp0 setting.
*/
- pushl_cfi ((TI_sysenter_return)-THREAD_SIZE_asm+8+4*4)(%esp)
+ pushl_cfi ((TI_sysenter_return)-THREAD_SIZE+8+4*4)(%esp)
CFI_REL_OFFSET eip, 0
pushl_cfi %eax
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 767d6c4..187aa63 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -73,7 +73,7 @@ MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT
*/
KERNEL_PAGES = LOWMEM_PAGES
-INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm
+INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE
RESERVE_BRK(pagetables, INIT_MAP_SIZE)
/*
@@ -623,7 +623,7 @@ ENTRY(initial_code)
* BSS section
*/
__PAGE_ALIGNED_BSS
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
#ifdef CONFIG_X86_PAE
initial_pg_pmd:
.fill 1024*KPMDS,4,0
@@ -644,7 +644,7 @@ ENTRY(swapper_pg_dir)
#ifdef CONFIG_X86_PAE
__PAGE_ALIGNED_DATA
/* Page-aligned for the benefit of paravirt? */
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
ENTRY(initial_page_table)
.long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */
# if KPMDS == 3
@@ -662,7 +662,7 @@ ENTRY(initial_page_table)
# else
# error "Kernel PMDs should be 1, 2 or 3"
# endif
- .align PAGE_SIZE_asm /* needs to be page-sized too */
+ .align PAGE_SIZE /* needs to be page-sized too */
#endif
.data
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 1a5ff24..aaa7291 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -28,9 +28,9 @@ ENTRY(startup_xen)
__FINIT
.pushsection .text
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
ENTRY(hypercall_page)
- .skip PAGE_SIZE_asm
+ .skip PAGE_SIZE
.popsection
ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux")
--
1.7.4.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH RESEND 1/1] Cleanup of asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm)
2011-02-25 20:03 ` [PATCH RESEND 1/1] " Stratos Psomadakis
@ 2011-02-25 20:20 ` H. Peter Anvin
0 siblings, 0 replies; 9+ messages in thread
From: H. Peter Anvin @ 2011-02-25 20:20 UTC (permalink / raw)
To: Stratos Psomadakis; +Cc: linux-kernel, Ingo Molnar, Thomas Gleixner
On 02/25/2011 12:03 PM, Stratos Psomadakis wrote:
> Cleanup of asm-offsets.c.
>
> PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm can be safely removed from
> asm-offsets.c, and be replaced by their non-'_asm' counterparts in the code
> that uses them, since the _AC macro defined in include/linux/const.h makes
> PAGE_SIZE/PAGE_SHIFT/THREAD_SIZE work with as.
>
> Signed-off-by: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
> ---
> arch/mn10300/kernel/asm-offsets.c | 2 --
> arch/mn10300/kernel/gdb-io-ttysm-low.S | 2 +-
> arch/x86/kernel/asm-offsets_32.c | 4 ----
> arch/x86/kernel/asm-offsets_64.c | 1 -
> arch/x86/kernel/entry_32.S | 2 +-
> arch/x86/kernel/head_32.S | 8 ++++----
> arch/x86/xen/xen-head.S | 4 ++--
> 7 files changed, 8 insertions(+), 15 deletions(-)
>
Looks good, but please separate the mn10300 and x86 chunks into separate
patches.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH SPLIT 0/2] Cleanup asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm)
2011-02-23 14:42 [PATCH] Cleanup of asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm) Stratos Psomadakis
2011-02-24 23:21 ` Steven Rostedt
2011-02-25 20:03 ` [PATCH RESEND 0/1] " Stratos Psomadakis
@ 2011-02-25 20:46 ` Stratos Psomadakis
2011-02-25 20:46 ` [PATCH 1/2] Cleanup x86 " Stratos Psomadakis
2011-02-25 20:46 ` [PATCH 2/2] Cleanup mn10300 asm-offsets.c(PAGE_SIZE_asm) Stratos Psomadakis
2 siblings, 2 replies; 9+ messages in thread
From: Stratos Psomadakis @ 2011-02-25 20:46 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Stratos Psomadakis
Split into separate x86 and mn10300 patches.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] Cleanup x86 asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm)
2011-02-25 20:46 ` [PATCH SPLIT 0/2] Cleanup " Stratos Psomadakis
@ 2011-02-25 20:46 ` Stratos Psomadakis
2011-02-26 6:34 ` [tip:x86/asm] x86, asm: Cleanup unnecssary macros in asm-offsets.c tip-bot for Stratos Psomadakis
2011-02-25 20:46 ` [PATCH 2/2] Cleanup mn10300 asm-offsets.c(PAGE_SIZE_asm) Stratos Psomadakis
1 sibling, 1 reply; 9+ messages in thread
From: Stratos Psomadakis @ 2011-02-25 20:46 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Stratos Psomadakis
Signed-off-by: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
---
arch/x86/kernel/asm-offsets_32.c | 4 ----
arch/x86/kernel/asm-offsets_64.c | 1 -
arch/x86/kernel/entry_32.S | 2 +-
arch/x86/kernel/head_32.S | 8 ++++----
arch/x86/xen/xen-head.S | 4 ++--
5 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c
index 1a4088d..e1e5009 100644
--- a/arch/x86/kernel/asm-offsets_32.c
+++ b/arch/x86/kernel/asm-offsets_32.c
@@ -97,10 +97,6 @@ void foo(void)
DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -
sizeof(struct tss_struct));
- DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
- DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT);
- DEFINE(THREAD_SIZE_asm, THREAD_SIZE);
-
OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
#ifdef CONFIG_PARAVIRT
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c
index 4a6aeed..aab9bdb 100644
--- a/arch/x86/kernel/asm-offsets_64.c
+++ b/arch/x86/kernel/asm-offsets_64.c
@@ -129,7 +129,6 @@ int main(void)
OFFSET(BP_kernel_alignment, boot_params, hdr.kernel_alignment);
BLANK();
- DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
#ifdef CONFIG_XEN
BLANK();
OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask);
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index c8b4efa..49bdedd 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -395,7 +395,7 @@ sysenter_past_esp:
* A tiny bit of offset fixup is necessary - 4*4 means the 4 words
* pushed above; +8 corresponds to copy_thread's esp0 setting.
*/
- pushl_cfi ((TI_sysenter_return)-THREAD_SIZE_asm+8+4*4)(%esp)
+ pushl_cfi ((TI_sysenter_return)-THREAD_SIZE+8+4*4)(%esp)
CFI_REL_OFFSET eip, 0
pushl_cfi %eax
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 767d6c4..187aa63 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -73,7 +73,7 @@ MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT
*/
KERNEL_PAGES = LOWMEM_PAGES
-INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm
+INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE
RESERVE_BRK(pagetables, INIT_MAP_SIZE)
/*
@@ -623,7 +623,7 @@ ENTRY(initial_code)
* BSS section
*/
__PAGE_ALIGNED_BSS
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
#ifdef CONFIG_X86_PAE
initial_pg_pmd:
.fill 1024*KPMDS,4,0
@@ -644,7 +644,7 @@ ENTRY(swapper_pg_dir)
#ifdef CONFIG_X86_PAE
__PAGE_ALIGNED_DATA
/* Page-aligned for the benefit of paravirt? */
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
ENTRY(initial_page_table)
.long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */
# if KPMDS == 3
@@ -662,7 +662,7 @@ ENTRY(initial_page_table)
# else
# error "Kernel PMDs should be 1, 2 or 3"
# endif
- .align PAGE_SIZE_asm /* needs to be page-sized too */
+ .align PAGE_SIZE /* needs to be page-sized too */
#endif
.data
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 1a5ff24..aaa7291 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -28,9 +28,9 @@ ENTRY(startup_xen)
__FINIT
.pushsection .text
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
ENTRY(hypercall_page)
- .skip PAGE_SIZE_asm
+ .skip PAGE_SIZE
.popsection
ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux")
--
1.7.4.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] Cleanup mn10300 asm-offsets.c(PAGE_SIZE_asm)
2011-02-25 20:46 ` [PATCH SPLIT 0/2] Cleanup " Stratos Psomadakis
2011-02-25 20:46 ` [PATCH 1/2] Cleanup x86 " Stratos Psomadakis
@ 2011-02-25 20:46 ` Stratos Psomadakis
1 sibling, 0 replies; 9+ messages in thread
From: Stratos Psomadakis @ 2011-02-25 20:46 UTC (permalink / raw)
To: linux-kernel; +Cc: H. Peter Anvin, Stratos Psomadakis
Signed-off-by: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
---
arch/mn10300/kernel/asm-offsets.c | 2 --
arch/mn10300/kernel/gdb-io-ttysm-low.S | 2 +-
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/arch/mn10300/kernel/asm-offsets.c b/arch/mn10300/kernel/asm-offsets.c
index 96f24fa..698eb60 100644
--- a/arch/mn10300/kernel/asm-offsets.c
+++ b/arch/mn10300/kernel/asm-offsets.c
@@ -89,8 +89,6 @@ void foo(void)
OFFSET(EXEC_DOMAIN_handler, exec_domain, handler);
OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
- DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
-
OFFSET(__rx_buffer, mn10300_serial_port, rx_buffer);
OFFSET(__rx_inp, mn10300_serial_port, rx_inp);
OFFSET(__rx_outp, mn10300_serial_port, rx_outp);
diff --git a/arch/mn10300/kernel/gdb-io-ttysm-low.S b/arch/mn10300/kernel/gdb-io-ttysm-low.S
index 060b7cc..7b2d665 100644
--- a/arch/mn10300/kernel/gdb-io-ttysm-low.S
+++ b/arch/mn10300/kernel/gdb-io-ttysm-low.S
@@ -38,7 +38,7 @@ gdbstub_io_rx_handler:
gdbstub_io_rx_more:
mov a3,a2
add 2,a3
- and PAGE_SIZE_asm-1,a3
+ and PAGE_SIZE-1,a3
mov (gdbstub_rx_outp),d3
cmp a3,d3
beq gdbstub_io_rx_overflow
--
1.7.4.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [tip:x86/asm] x86, asm: Cleanup unnecssary macros in asm-offsets.c
2011-02-25 20:46 ` [PATCH 1/2] Cleanup x86 " Stratos Psomadakis
@ 2011-02-26 6:34 ` tip-bot for Stratos Psomadakis
0 siblings, 0 replies; 9+ messages in thread
From: tip-bot for Stratos Psomadakis @ 2011-02-26 6:34 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, psomas, hpa, mingo, tglx
Commit-ID: 7bf04be8f48ceeeffa5b5a79734d6d6e0d59e5f8
Gitweb: http://git.kernel.org/tip/7bf04be8f48ceeeffa5b5a79734d6d6e0d59e5f8
Author: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
AuthorDate: Fri, 25 Feb 2011 22:46:13 +0200
Committer: H. Peter Anvin <hpa@zytor.com>
CommitDate: Fri, 25 Feb 2011 16:37:32 -0800
x86, asm: Cleanup unnecssary macros in asm-offsets.c
PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm can be safely removed from
asm-offsets.c, and be replaced by their non-'_asm' counterparts in the code
that uses them, since the _AC macro defined in include/linux/const.h makes
PAGE_SIZE/PAGE_SHIFT/THREAD_SIZE work with as.
Signed-off-by: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
LKML-Reference: <1298666774-17646-2-git-send-email-psomas@cslab.ece.ntua.gr>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
arch/x86/kernel/asm-offsets.c | 5 -----
arch/x86/kernel/entry_32.S | 2 +-
arch/x86/kernel/head_32.S | 8 ++++----
arch/x86/xen/xen-head.S | 4 ++--
4 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c
index 2b141c1..4f13faf 100644
--- a/arch/x86/kernel/asm-offsets.c
+++ b/arch/x86/kernel/asm-offsets.c
@@ -29,11 +29,6 @@
void common(void) {
BLANK();
- DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
- DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT);
- DEFINE(THREAD_SIZE_asm, THREAD_SIZE);
-
- BLANK();
OFFSET(TI_flags, thread_info, flags);
OFFSET(TI_status, thread_info, status);
OFFSET(TI_addr_limit, thread_info, addr_limit);
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S
index c8b4efa..49bdedd 100644
--- a/arch/x86/kernel/entry_32.S
+++ b/arch/x86/kernel/entry_32.S
@@ -395,7 +395,7 @@ sysenter_past_esp:
* A tiny bit of offset fixup is necessary - 4*4 means the 4 words
* pushed above; +8 corresponds to copy_thread's esp0 setting.
*/
- pushl_cfi ((TI_sysenter_return)-THREAD_SIZE_asm+8+4*4)(%esp)
+ pushl_cfi ((TI_sysenter_return)-THREAD_SIZE+8+4*4)(%esp)
CFI_REL_OFFSET eip, 0
pushl_cfi %eax
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 767d6c4..187aa63 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -73,7 +73,7 @@ MAPPING_BEYOND_END = PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT
*/
KERNEL_PAGES = LOWMEM_PAGES
-INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE_asm
+INIT_MAP_SIZE = PAGE_TABLE_SIZE(KERNEL_PAGES) * PAGE_SIZE
RESERVE_BRK(pagetables, INIT_MAP_SIZE)
/*
@@ -623,7 +623,7 @@ ENTRY(initial_code)
* BSS section
*/
__PAGE_ALIGNED_BSS
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
#ifdef CONFIG_X86_PAE
initial_pg_pmd:
.fill 1024*KPMDS,4,0
@@ -644,7 +644,7 @@ ENTRY(swapper_pg_dir)
#ifdef CONFIG_X86_PAE
__PAGE_ALIGNED_DATA
/* Page-aligned for the benefit of paravirt? */
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
ENTRY(initial_page_table)
.long pa(initial_pg_pmd+PGD_IDENT_ATTR),0 /* low identity map */
# if KPMDS == 3
@@ -662,7 +662,7 @@ ENTRY(initial_page_table)
# else
# error "Kernel PMDs should be 1, 2 or 3"
# endif
- .align PAGE_SIZE_asm /* needs to be page-sized too */
+ .align PAGE_SIZE /* needs to be page-sized too */
#endif
.data
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index 1a5ff24..aaa7291 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -28,9 +28,9 @@ ENTRY(startup_xen)
__FINIT
.pushsection .text
- .align PAGE_SIZE_asm
+ .align PAGE_SIZE
ENTRY(hypercall_page)
- .skip PAGE_SIZE_asm
+ .skip PAGE_SIZE
.popsection
ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux")
^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-02-26 6:34 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-23 14:42 [PATCH] Cleanup of asm-offsets.c(PAGE_SIZE_asm, PAGE_SHIFT_asm, THREAD_SIZE_asm) Stratos Psomadakis
2011-02-24 23:21 ` Steven Rostedt
2011-02-25 20:03 ` [PATCH RESEND 0/1] " Stratos Psomadakis
2011-02-25 20:03 ` [PATCH RESEND 1/1] " Stratos Psomadakis
2011-02-25 20:20 ` H. Peter Anvin
2011-02-25 20:46 ` [PATCH SPLIT 0/2] Cleanup " Stratos Psomadakis
2011-02-25 20:46 ` [PATCH 1/2] Cleanup x86 " Stratos Psomadakis
2011-02-26 6:34 ` [tip:x86/asm] x86, asm: Cleanup unnecssary macros in asm-offsets.c tip-bot for Stratos Psomadakis
2011-02-25 20:46 ` [PATCH 2/2] Cleanup mn10300 asm-offsets.c(PAGE_SIZE_asm) Stratos Psomadakis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox