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:	Thu, 5 Jun 2014 15:38:39 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, ak@...ux.intel.com,
	jolsa@...hat.com, zheng.z.yan@...el.com,
	maria.n.dimakopoulou@...il.com
Subject: Re: [PATCH 5/9] perf/x86: implement cross-HT corruption bug
 workaround

On Wed, Jun 04, 2014 at 11:34:14PM +0200, Stephane Eranian wrote:
>  static void
> +intel_start_scheduling(struct cpu_hw_events *cpuc)
> +{

> +	/*
> +	 * lock shared state until we are done scheduling
> +	 * in stop_event_scheduling()
> +	 * makes scheduling appear as a transaction
> +	 */
> +	spin_lock_irqsave(&excl_cntrs->lock, excl_cntrs->lock_flags);
> +
> +	/*
> +	 * save initial state of sibling thread
> +	 */
> +	memcpy(xlo->init_state, xlo->state, sizeof(xlo->init_state));
> +}
> +
> +static void
> +intel_stop_scheduling(struct cpu_hw_events *cpuc)
> +{

> +	/*
> +	 * make new sibling thread state visible
> +	 */
> +	memcpy(xlo->state, xlo->init_state, sizeof(xlo->state));
> +
> +	xl->sched_started = false;
> +	/*
> +	 * release shared state lock (lock acquire in intel_start_scheduling())
> +	 */
> +	spin_unlock_irqrestore(&excl_cntrs->lock, excl_cntrs->lock_flags);
> +}

Do you really need the irqsave/irqrestore? From what I can tell this is
always called under perf_event_context::lock and that is already an
IRQ-safe lock, so interrupts should always be disabled here.

Also, it looks like xl->state is the effective state, and ->init_state
is the work state? Is init the right name for this?

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ