From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763483AbZFOSmj (ORCPT ); Mon, 15 Jun 2009 14:42:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756207AbZFOSmb (ORCPT ); Mon, 15 Jun 2009 14:42:31 -0400 Received: from terminus.zytor.com ([198.137.202.10]:45065 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752091AbZFOSmb (ORCPT ); Mon, 15 Jun 2009 14:42:31 -0400 Message-ID: <4A369508.2090707@zytor.com> Date: Mon, 15 Jun 2009 11:38:00 -0700 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Linus Torvalds CC: Ingo Molnar , mingo@redhat.com, mathieu.desnoyers@polymtl.ca, paulus@samba.org, acme@redhat.com, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, penberg@cs.helsinki.fi, vegard.nossum@gmail.com, efault@gmx.de, jeremy@goop.org, npiggin@suse.de, tglx@linutronix.de, linux-tip-commits@vger.kernel.org Subject: Re: [tip:perfcounters/core] perf_counter: x86: Fix call-chain support to use NMI-safe methods References: <20090615171845.GA7664@elte.hu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds wrote: > > On Mon, 15 Jun 2009, Ingo Molnar wrote: >> A simple cr2 corruption would explain all those cc1 SIGSEGVs and >> other user-space crashes i saw, with sufficiently intense sampling - >> easily. > > Note that we could work around the %cr2 issue, since any corruption is > always nicely "nested" (ie there are never any SMP issues with async > writes to the register). > > So what we _could_ do is to have a magic value for %cr2, along with a "NMI > sequence count", and if we see that value, we just return (without doing > anything) from the page fault handler. > Wouldn't it be simpler to just require the NMI handler to save and restore %cr2 around any potentially faulting references? -hpa