lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c62985530812021324m45a26782kd52beca1b6437747@mail.gmail.com>
Date:	Tue, 2 Dec 2008 22:24:42 +0100
From:	"Frédéric Weisbecker" <fweisbec@...il.com>
To:	"Steven Rostedt" <rostedt@...dmis.org>
Cc:	linux-kernel@...r.kernel.org, "Ingo Molnar" <mingo@...e.hu>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Steven Rostedt" <srostedt@...hat.com>
Subject: Re: [PATCH 4/5] ftrace: clean up function graph asm

2008/12/2 Steven Rostedt <rostedt@...dmis.org>:
> From: Steven Rostedt <srostedt@...hat.com>
>
> Impact: clean up
>
> There exists macros for x86 asm to handle x86_64 and i386.
> This patch updates function graph asm to use them.
>
> Signed-off-by: Steven Rostedt <srostedt@...hat.com>
> ---
>  arch/x86/kernel/ftrace.c |   20 ++++----------------
>  1 files changed, 4 insertions(+), 16 deletions(-)
>
> diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
> index 5883247..1a5b8f8 100644
> --- a/arch/x86/kernel/ftrace.c
> +++ b/arch/x86/kernel/ftrace.c
> @@ -467,28 +467,16 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
>         * ignore such a protection.
>         */
>        asm volatile(
> -#ifdef CONFIG_X86_64
> -               "1: movq (%[parent_old]), %[old]\n"
> -               "2: movq %[return_hooker], (%[parent_replaced])\n"
> -#else
> -               "1: movl (%[parent_old]), %[old]\n"
> -               "2: movl %[return_hooker], (%[parent_replaced])\n"
> -#endif
> +               "1: " _ASM_MOV " (%[parent_old]), %[old]\n"
> +               "2: " _ASM_MOV " %[return_hooker], (%[parent_replaced])\n"
>                "   movl $0, %[faulted]\n"
>
>                ".section .fixup, \"ax\"\n"
>                "3: movl $1, %[faulted]\n"
>                ".previous\n"
>
> -               ".section __ex_table, \"a\"\n"
> -#ifdef CONFIG_X86_64
> -               "   .quad 1b, 3b\n"
> -               "   .quad 2b, 3b\n"
> -#else
> -               "   .long 1b, 3b\n"
> -               "   .long 2b, 3b\n"
> -#endif
> -               ".previous\n"
> +               _ASM_EXTABLE(1b, 3b)
> +               _ASM_EXTABLE(2b, 3b)
>
>                : [parent_replaced] "=r" (parent), [old] "=r" (old),
>                  [faulted] "=r" (faulted)
> --

Thanks Steven. I wasn't aware of _ASM_MOV.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ