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: <20160715130818.GA19840@leverpostej>
Date:	Fri, 15 Jul 2016 14:08:18 +0100
From:	Mark Rutland <mark.rutland@....com>
To:	Anna-Maria Gleixner <anna-maria@...utronix.de>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>, rt@...utronix.de,
	Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Will Deacon <will.deacon@....com>
Subject: Re: [patch V2 35/67] arm/perf: Convert to hotplug state machine

Hi,

On Wed, Jul 13, 2016 at 05:16:36PM +0000, Anna-Maria Gleixner wrote:
> From: Thomas Gleixner <tglx@...utronix.de>
> 
> Straight forward conversion w/o bells and whistles.
> 
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Reviewed-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> Cc: Linus Torvalds <torvalds@...ux-foundation.org>
> Cc: Mark Rutland <mark.rutland@....com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Will Deacon <will.deacon@....com>
> Signed-off-by: Anna-Maria Gleixner <anna-maria@...utronix.de>
> ---
>  drivers/perf/arm_pmu.c       | 36 +++++++++++++++---------------------
>  include/linux/cpuhotplug.h   |  1 +
>  include/linux/perf/arm_pmu.h |  1 -
>  3 files changed, 16 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c
> index 140436a..ae9fc6c 100644
> --- a/drivers/perf/arm_pmu.c
> +++ b/drivers/perf/arm_pmu.c
> @@ -691,24 +691,15 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
>   * UNKNOWN at reset, the PMU must be explicitly reset to avoid reading
>   * junk values out of them.
>   */
> -static int cpu_pmu_notify(struct notifier_block *b, unsigned long action,
> -			  void *hcpu)
> +static int arm_perf_starting_cpu(unsigned int cpu)
>  {
> -	int cpu = (unsigned long)hcpu;
> -	struct arm_pmu *pmu = container_of(b, struct arm_pmu, hotplug_nb);
> -
> -	if ((action & ~CPU_TASKS_FROZEN) != CPU_STARTING)
> -		return NOTIFY_DONE;
> -
> -	if (!cpumask_test_cpu(cpu, &pmu->supported_cpus))
> -		return NOTIFY_DONE;
> -
> -	if (pmu->reset)
> -		pmu->reset(pmu);
> -	else
> -		return NOTIFY_DONE;
> -
> -	return NOTIFY_OK;
> +	if (!__oprofile_cpu_pmu)
> +		return 0;
> +	if (!cpumask_test_cpu(cpu, &__oprofile_cpu_pmu->supported_cpus))
> +		return 0;
> +	if (__oprofile_cpu_pmu->reset)
> +		__oprofile_cpu_pmu->reset(__oprofile_cpu_pmu);
> +	return 0;
>  }

We may have multiple PMUs (e.g. two in big.LITTLE systems), and
__oprofile_cpu_pmu only contains one of these. So this conversion is not
correct.

We were relying on the notifier list implicitly containing a list of
those PMUs. It seems like we need an explicit list here.

We keep __oprofile_cpu_pmu around for legacy 32-bit users of OProfile
(on non-hetereogeneous systems), and that's all that the variable should
be used for.

Thanks,
Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ