Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6422502ybi; Wed, 29 May 2019 07:37:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyku8Fu6fQjM13tCIT6k26mz0xh7QnsKTsS1cg9OwU7F0joUGe8kmJ7VzqaEmd6evmZfs2 X-Received: by 2002:a17:90a:26cf:: with SMTP id m73mr3460857pje.90.1559140630763; Wed, 29 May 2019 07:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559140630; cv=none; d=google.com; s=arc-20160816; b=ed1xhS5Pc84HQGdi0d1agzC15PNJf1+zMcNzSYapgFaKqa5H9wGubFL/bkq0j8g1jr 3ks1F96f3pIjnE72jnEf7Xw0uFi66mIepjZS6Gh87iB3Au/cItPCs+fJ6lNPqdPoa4rq 08lJPwr0GhHMJhvm09913x7nokqPSNSebL7b1iUHVAuzvAcJHX5ls2bdvWFKjiGKw4Zw 7lsha4b92iw6kg0eYgJIewxUIfz4vgWCvWvr1TagNGhxx9174qLuQSXC36fsM/MxUyoX MVytRbNjczfDh+KmSWXEChVH+BDMROOi49HKLgXqwsFDkaOJZnWJpmSowfGI/y4blw5R DTsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DKXqVwKLkpKfLGi3YtNc5RJ3vF42yThedjJmhv5EEws=; b=UPLWz+6nrtS/X1QtJY14AfKRDwl8t2Rke3K8a4F/+aWape0yP4hDJ/158lQnprdE7A aDif9oGPzPwjwFZyrUEbJyhBX1SHLose3qHC5l8BFeFtP2BXOVVYIoU82DkpWXxofVme Veb7fso2FCvX3OF7VMvDmwsqfgGhK6a1x5RzmzLiQtQhsmH/D+rh+qPcxYRaEClelxqc 4QQyTVEVB+CWIvWvgq71iPuMnhk/TAaVCWqi0zQD9ECxHKMDwyUebNL3fDesyZLX7br/ ljPGV2ViH/CsoJpCo9zGzp9LyVFP9XheO2eHdErEtSuJ15FgEmYVMCeRQJVRmh+px2Pt YHkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ba6si25873118plb.436.2019.05.29.07.36.53; Wed, 29 May 2019 07:37:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726699AbfE2Of1 (ORCPT + 99 others); Wed, 29 May 2019 10:35:27 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:47106 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbfE2Of1 (ORCPT ); Wed, 29 May 2019 10:35:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A1CE2341; Wed, 29 May 2019 07:35:26 -0700 (PDT) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CE57A3F5AF; Wed, 29 May 2019 07:35:23 -0700 (PDT) Date: Wed, 29 May 2019 15:35:10 +0100 From: Will Deacon To: Peter Zijlstra Cc: Young Xiao <92siuyang@gmail.com>, linux@armlinux.org.uk, mark.rutland@arm.com, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, x86@kernel.org, kan.liang@linux.intel.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ravi.bangoria@linux.vnet.ibm.com, mpe@ellerman.id.au, acme@redhat.com, eranian@google.com, fweisbec@gmail.com, jolsa@redhat.com Subject: Re: [PATCH] perf: Fix oops when kthread execs user process Message-ID: <20190529143510.GA11154@fuggles.cambridge.arm.com> References: <1559046689-24091-1-git-send-email-92siuyang@gmail.com> <20190528140103.GT2623@hirez.programming.kicks-ass.net> <20190528153224.GE20758@fuggles.cambridge.arm.com> <20190528173228.GW2623@hirez.programming.kicks-ass.net> <20190529091733.GA4485@fuggles.cambridge.arm.com> <20190529101042.GN2623@hirez.programming.kicks-ass.net> <20190529102022.GC4485@fuggles.cambridge.arm.com> <20190529125557.GU2623@hirez.programming.kicks-ass.net> <20190529130521.GA11023@fuggles.cambridge.arm.com> <20190529132515.GW2623@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190529132515.GW2623@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 29, 2019 at 03:25:15PM +0200, Peter Zijlstra wrote: > On Wed, May 29, 2019 at 02:05:21PM +0100, Will Deacon wrote: > > On Wed, May 29, 2019 at 02:55:57PM +0200, Peter Zijlstra wrote: > > > > if (user_mode(regs)) { > > > > Hmm, so it just occurred to me that Mark's observation is that the regs > > can be junk in some cases. In which case, should we be checking for > > kthreads first? > > task_pt_regs() can return garbage, but @regs is the exception (or > perf_arch_fetch_caller_regs()) regs, and for those user_mode() had > better be correct. So what should we report for the idle task? Will