From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758854AbdEVMbA (ORCPT ); Mon, 22 May 2017 08:31:00 -0400 Received: from mga11.intel.com ([192.55.52.93]:29632 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753268AbdEVMa7 (ORCPT ); Mon, 22 May 2017 08:30:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,377,1491289200"; d="scan'208";a="105083382" Subject: Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is specified To: Peter Zijlstra , Mark Rutland Cc: acme@kernel.org, jolsa@kernel.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, Will Deacon References: <1495189152-5766-1-git-send-email-yao.jin@linux.intel.com> <20170519092905.yivnfjyhblm5wiap@hirez.programming.kicks-ass.net> <20170519121056.c45jbsfgcdjfuoow@hirez.programming.kicks-ass.net> <20170519123648.p4tkt6xrt5xachuw@hirez.programming.kicks-ass.net> <6d82d33c-df7d-f1ea-979a-5898efe88528@linux.intel.com> <20170522084529.GC1478@leverpostej> <20170522092651.nwhlpdws2ysyhlma@hirez.programming.kicks-ass.net> From: "Jin, Yao" Message-ID: <94a086e2-af12-49e9-f9c7-5b4b1b83ddfb@linux.intel.com> Date: Mon, 22 May 2017 20:30:54 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170522092651.nwhlpdws2ysyhlma@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/22/2017 5:26 PM, Peter Zijlstra wrote: > On Mon, May 22, 2017 at 09:45:30AM +0100, Mark Rutland wrote: >> On Mon, May 22, 2017 at 10:12:22AM +0800, Jin, Yao wrote: >>> But the code is being ugly and hard to maintain. And frankly I don't >>> know kernel address space for all arch. >>> >>> Any idea? Could we just do at x86 side this time? >> Can we not check user_mode(regs) for all architectures? >> >> !user_mode(regs) implies a kernel sample. > Yes, that should work at that point. We specifically already rely on > user_mode() in the generic code. > > On x86 we specifically set regs->cs to match regs->ip (in cases where > this isn't necessarily so) before calling into the generic code to make > this work. > Got it. Thanks Mark, thanks Peter!