Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1211302 > unrolled thread

[PATCH] x86/calling.h: remove unused SAVE_ALL/RESTORE_ALL macro for !CONFIG_x86_64

Started byAlexander Kuleshov <kuleshovmail@gmail.com>
First post2015-08-21 21:20 +0200
Last post2015-08-24 13:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] x86/calling.h: remove unused SAVE_ALL/RESTORE_ALL macro for !CONFIG_x86_64 Alexander Kuleshov <kuleshovmail@gmail.com> - 2015-08-21 21:20 +0200
    Re: [PATCH] x86/calling.h: remove unused SAVE_ALL/RESTORE_ALL  macro for !CONFIG_x86_64 "Jan Beulich" <JBeulich@suse.com> - 2015-08-24 13:10 +0200

#1211302 — [PATCH] x86/calling.h: remove unused SAVE_ALL/RESTORE_ALL macro for !CONFIG_x86_64

FromAlexander Kuleshov <kuleshovmail@gmail.com>
Date2015-08-21 21:20 +0200
Subject[PATCH] x86/calling.h: remove unused SAVE_ALL/RESTORE_ALL macro for !CONFIG_x86_64
Message-ID<q0014-4mg-21@gated-at.bofh.it>
SAVE_ALL and RESTORE_ALL macros for !CONFIG_X86_64 were introduced in the
1a338ac32 commit (sched, x86: Optimize the preempt_schedule() call) and
were used in the ___preempt_schedule and ___preempt_schedule_context from
the  arch/x86/kernel/preempt.S. But the arch/x86/kernel/preempt.S was
removed in the 0ad6e3c5 commit (x86: Speed up ___preempt_schedule*() by
using THUNK helpers) and ___preempt_schedule/___preempt_schedule_context
are reimplemeted and not used SAVE_ALL/RESTORE_ALL anymore.

These macros have no users anymore, so we can remove it.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
---
 arch/x86/entry/calling.h | 36 ------------------------------------
 1 file changed, 36 deletions(-)

diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h
index f4e6308..7631233 100644
--- a/arch/x86/entry/calling.h
+++ b/arch/x86/entry/calling.h
@@ -46,8 +46,6 @@ For 32-bit we have the following conventions - kernel is built with
 
 */
 
-#ifdef CONFIG_X86_64
-
 /*
  * 64-bit system call stack frame layout defines and helpers,
  * for assembly code:
@@ -207,37 +205,3 @@ For 32-bit we have the following conventions - kernel is built with
 	.macro icebp
 	.byte 0xf1
 	.endm
-
-#else /* CONFIG_X86_64 */
-
-/*
- * For 32bit only simplified versions of SAVE_ALL/RESTORE_ALL. These
- * are different from the entry_32.S versions in not changing the segment
- * registers. So only suitable for in kernel use, not when transitioning
- * from or to user space. The resulting stack frame is not a standard
- * pt_regs frame. The main use case is calling C code from assembler
- * when all the registers need to be preserved.
- */
-
-	.macro SAVE_ALL
-	pushl %eax
-	pushl %ebp
-	pushl %edi
-	pushl %esi
-	pushl %edx
-	pushl %ecx
-	pushl %ebx
-	.endm
-
-	.macro RESTORE_ALL
-	popl %ebx
-	popl %ecx
-	popl %edx
-	popl %esi
-	popl %edi
-	popl %ebp
-	popl %eax
-	.endm
-
-#endif /* CONFIG_X86_64 */
-
-- 
2.5.0

--
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/

[toc] | [next] | [standalone]


#1212076 — Re: [PATCH] x86/calling.h: remove unused SAVE_ALL/RESTORE_ALL macro for !CONFIG_x86_64

From"Jan Beulich" <JBeulich@suse.com>
Date2015-08-24 13:10 +0200
SubjectRe: [PATCH] x86/calling.h: remove unused SAVE_ALL/RESTORE_ALL macro for !CONFIG_x86_64
Message-ID<q0XNv-5TR-11@gated-at.bofh.it>
In reply to#1211302
>>> On 21.08.15 at 21:12, <kuleshovmail@gmail.com> wrote:
> SAVE_ALL and RESTORE_ALL macros for !CONFIG_X86_64 were introduced in the
> 1a338ac32 commit (sched, x86: Optimize the preempt_schedule() call) and
> were used in the ___preempt_schedule and ___preempt_schedule_context from
> the  arch/x86/kernel/preempt.S. But the arch/x86/kernel/preempt.S was
> removed in the 0ad6e3c5 commit (x86: Speed up ___preempt_schedule*() by
> using THUNK helpers) and ___preempt_schedule/___preempt_schedule_context
> are reimplemeted and not used SAVE_ALL/RESTORE_ALL anymore.
> 
> These macros have no users anymore, so we can remove it.

As far as the description goes this is fine, but ...

> --- a/arch/x86/entry/calling.h
> +++ b/arch/x86/entry/calling.h
> @@ -46,8 +46,6 @@ For 32-bit we have the following conventions - kernel is built with
>  
>  */
>  
> -#ifdef CONFIG_X86_64

... why do you remove this conditional, thus exposing x86-64-only
definitions to ix86 code?

Jan

--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web