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]
Date:	Tue, 29 Mar 2011 08:24:13 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Andy Lutomirski <luto@....EDU>
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org,
	John Stultz <johnstul@...ibm.com>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 5/6] x86-64: Omit frame pointers on vread_tsc


* Andy Lutomirski <luto@....EDU> wrote:

> vread_tsc is short and hot, and it's userspace code so the usual
> reasons to keep frame pointers around don't apply.
> 
> Signed-off-by: Andy Lutomirski <luto@....edu>
> ---
> 
> It might be nicer to move vread_tsc into a separate file and change
> the options directly.
> 
>  arch/x86/kernel/tsc.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index a159fba..1aea4a6 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -764,6 +764,8 @@ static cycle_t read_tsc(struct clocksource *cs)
>  }
>  
>  #ifdef CONFIG_X86_64
> +#pragma GCC push_options
> +#pragma GCC optimize ("omit-frame-pointer")
>  static cycle_t __vsyscall_fn vread_tsc(void)
>  {
>  	cycle_t ret;
> @@ -807,6 +809,7 @@ static cycle_t __vsyscall_fn vread_tsc(void)
>  	asm volatile ("");
>  	return last;
>  }
> +#pragma GCC pop_options
>  #endif

The cleaner option would be to put the __vsyscall functions into a new .c file 
and build it with framepointers off in the Makefile, which can be done via:

CFLAGS_vtsc.o := -fno-omit-frame-pointer

or so.

We could also consider putting this function into a .S too. Not sure it works 
out in a maintainable fashion though.

Thanks,

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