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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180509091703.GH12217@hirez.programming.kicks-ass.net>
Date:   Wed, 9 May 2018 11:17:03 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Frederic Weisbecker <frederic@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>, Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Chris Zankel <chris@...kel.net>,
        Paul Mackerras <paulus@...ba.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Will Deacon <will.deacon@....com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Rich Felker <dalias@...c.org>, Ingo Molnar <mingo@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Andy Lutomirski <luto@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Max Filippov <jcmvbkbc@...il.com>
Subject: Re: [PATCH 8/9] perf/breakpoint: Split breakpoint "check" and
 "commit"

On Sun, May 06, 2018 at 09:19:54PM +0200, Frederic Weisbecker wrote:
>  arch/arm/include/asm/hw_breakpoint.h     |  5 ++++-
>  arch/arm/kernel/hw_breakpoint.c          | 22 +++-------------------
>  arch/arm64/include/asm/hw_breakpoint.h   |  5 ++++-
>  arch/arm64/kernel/hw_breakpoint.c        | 22 +++-------------------
>  arch/powerpc/include/asm/hw_breakpoint.h |  5 ++++-
>  arch/powerpc/kernel/hw_breakpoint.c      | 22 +++-------------------
>  arch/sh/include/asm/hw_breakpoint.h      |  5 ++++-
>  arch/sh/kernel/hw_breakpoint.c           | 22 +++-------------------
>  arch/x86/include/asm/hw_breakpoint.h     |  5 ++++-
>  arch/x86/kernel/hw_breakpoint.c          | 23 +++--------------------
>  arch/xtensa/include/asm/hw_breakpoint.h  |  5 ++++-
>  arch/xtensa/kernel/hw_breakpoint.c       | 22 +++-------------------

Because of those ^,

>  kernel/events/hw_breakpoint.c            | 11 ++++++-----

would it not make sense to have a prelimenary patch doing something
like:

__weak int hw_breakpoint_arch_check(struct perf_event *bp)
{
	return arch_validate_hwbkpt_settings(bp);
}

__weak void hw_breakpoint_arch_commit(struct perf_event *bp)
{
}

combined with this bit:

> diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
> index 6e28d28..6896ceeb 100644
> --- a/kernel/events/hw_breakpoint.c
> +++ b/kernel/events/hw_breakpoint.c
> @@ -402,11 +402,12 @@ int dbg_release_bp_slot(struct perf_event *bp)
>  
>  static int validate_hw_breakpoint(struct perf_event *bp)
>  {
> -	int ret;
> +	int err;
>  
> -	ret = arch_validate_hwbkpt_settings(bp);
> -	if (ret)
> -		return ret;
> +	err = hw_breakpoint_arch_check(bp, &bp->attr);
> +	if (err)
> +		return err;
> +	hw_breakpoint_arch_commit(bp);
>  
>  	if (arch_check_bp_in_kernelspace(bp)) {
>  		if (bp->attr.exclude_kernel)

And then convert the archs over one by one, and at the end remove the
weak thingies entirely?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ