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: <20131023204838.GB19466@laptop.lan>
Date:	Wed, 23 Oct 2013 22:48:38 +0200
From:	Peter Zijlstra <peterz@...radead.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Don Zickus <dzickus@...hat.com>, Andi Kleen <ak@...ux.intel.com>,
	dave.hansen@...ux.intel.com, Stephane Eranian <eranian@...gle.com>,
	jmario@...hat.com,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Arnaldo Carvalho de Melo <acme@...radead.org>,
	Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH] perf, x86: Optimize intel_pmu_pebs_fixup_ip()

On Wed, Oct 23, 2013 at 08:09:53AM +0100, Linus Torvalds wrote:
> On Tue, Oct 22, 2013 at 10:12 PM, Peter Zijlstra <peterz@...radead.org> wrote:
> >>
> >> Careful! There is one magic piece of state that you need to
> >> save-and-restore if you do this, namely %cr2. Taking a page fault
> >> always writes to %cr2, and we must *not* corrupt it in the NMI
> >> handler.
> >
> > It looks like this is already dealt with (a similar thing is done for
> > i386).
> 
> Oh, ok then, we should be good to go. I wonder why we needed that
> special "_nmi()" version, then..

Ah, the whole fault from nmi trickery from Steve is from after we did
the copy_from_user_nmi() thing. We're only just catching up :-)

> Please do check that NMI increment the irq-counts etc.. Otherwise
> you'll need to add the explicit "pagefault_disable/enable()" pair
> around the __copy_from_user_inatomic()..

Yeah, we add NMI_OFFSET to preempt_count on nmi_enter.

I'll also make sure to test we actually hit the fault path
by concurrently running something like:

 while :; echo 1 > /proc/sys/vm/drop_caches ; done

while doing perf top or so.. 
--
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