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: <1339181341.30462.5.camel@twins>
Date:	Fri, 08 Jun 2012 20:49:01 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	Ingo Molnar <mingo@...nel.org>, linux-kernel@...r.kernel.org,
	andi@...stfloor.org, mingo@...e.hu, ming.m.lin@...el.com,
	Andreas Herrmann <andreas.herrmann3@....com>,
	Borislav Petkov <borislav.petkov@....com>,
	Dimitri Sivanich <sivanich@....com>,
	Dmitry Adamushko <dmitry.adamushko@...il.com>
Subject: Re: [PATCH] perf/x86: check ucode before disabling PEBS on
 SandyBridge

On Fri, 2012-06-08 at 18:28 +0200, Stephane Eranian wrote:
> >  static int apply_microcode_on_target(int cpu)
> >  {
> >        struct apply_microcode_ctx ctx = { .err = 0 };
> >        int ret;
> >
> > +       ret = microcode_notifier_check(ucode_cpu_info + cpu);
> > +       if (ret)
> > +               return ret;
> > +
> >        ret = smp_call_function_single(cpu, apply_microcode_local, &ctx, 1);
> >        if (!ret)
> >                ret = ctx.err;
> >
> > +       if (!ret)
> > +               microcode_notifier_done();
> > +
> I suspect you want to do this here and not after the update() has completed over
> all CPU (for_each_online_cpu()), because you want to prevent a race condition
> with perf_event users trying PEBS at the same time. If not, then why not move
> the callback after all the smp_call() are done. 

Because not all callers are in a for_each_cpu loop. For instance, see
the reload_store() thing.

Also, since the ucode is per-cpu and not machine wide, a per-cpu
callback makes more sense.
--
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