Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1968253imm; Thu, 20 Sep 2018 05:54:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYcvaNQngxpIuP0mUKVHWPMWp2d7mcsze9QKiVtHniHx9oZMU8yspszaa+1+9SJy1JH9v5B X-Received: by 2002:a17:902:b945:: with SMTP id h5-v6mr4068908pls.248.1537448066385; Thu, 20 Sep 2018 05:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537448066; cv=none; d=google.com; s=arc-20160816; b=Yax7DHXBeO+mMZ1PwhhvFgc4kBgHjA0h+MjUBxcEI879nOaJ2/9gGjl1RWlTQV/5vv EnKLVgVKPWKOTqq966s2chsSu1zxE2B+dec/8p0e0UmO/g0Cge/h7BSFC3SKkTjgYmlM MOSQZHL2GlayFaIa0ZByGrw/7eSeZFlG8kXb0kyKh/tZ9ti22m+MfsKaF8w2MLHykPcf aMGjroxC3+8Q0SKFxk8FXDSTJZfFyvW6s0L61S1eLy2X6sr3txVTPTcPWpvbbXF+jkhs 3Oj0M/2FeGauEnZkNwzU6Q2P4x+vYOQE3PR+oC1eAiqioRWebr6u2UXqoYVsFCmphgnj vrbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=X8HduCUG8vBmmExi9RuutK1HD2KJ7BoJPb9FpyLQNk0=; b=tauMigOl8chxcX+u42Dtrz3JjRS2pcb8BlHjQc9LHeiUk38z0ycx4f6+odMPs+A5Vx M9MYnhlQcSq67S2SMCPG1z4E4qSgcP9h0M+2taKPJy6cvwp/wR3X0cMJ8FLFJX0+W84p HIF7eNkekv86jAFE7tKW82o1mQLHRFuThyM/jxERmglmBQOR90/14+hjb3Jn5gr2RmNx mkRgyXSqx1dyBVORFIk0rKJeJmlBcPgdXJuRGqlORsPbrGQIcAIyLfwFjPy5dJ9iYXx3 2tr0Eqhssr/a/HM2bb0+MxNkYWtEtRi1PavW5vu95BqZm6kIpwdQzRPfoT3EmLTDKniA Db2w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i16-v6si23578526pgi.660.2018.09.20.05.54.10; Thu, 20 Sep 2018 05:54:26 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387798AbeITShY (ORCPT + 99 others); Thu, 20 Sep 2018 14:37:24 -0400 Received: from mga11.intel.com ([192.55.52.93]:21086 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387424AbeITShY (ORCPT ); Thu, 20 Sep 2018 14:37:24 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2018 05:54:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,398,1531810800"; d="scan'208";a="74826652" Received: from unknown (HELO [10.239.13.3]) ([10.239.13.3]) by orsmga008.jf.intel.com with ESMTP; 20 Sep 2018 05:53:26 -0700 Message-ID: <5BA39968.8030309@intel.com> Date: Thu, 20 Sep 2018 20:58:16 +0800 From: Wei Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Peter Zijlstra CC: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com, ak@linux.intel.com, kan.liang@intel.com, mingo@redhat.com, rkrcmar@redhat.com, like.xu@intel.com, jannh@google.com, arei.gonglei@huawei.com Subject: Re: [PATCH v3 5/5] KVM/x86/lbr: lazy save the guest lbr stack References: <1537437959-8751-1-git-send-email-wei.w.wang@intel.com> <1537437959-8751-6-git-send-email-wei.w.wang@intel.com> <20180920123753.GT24124@hirez.programming.kicks-ass.net> In-Reply-To: <20180920123753.GT24124@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/20/2018 08:37 PM, Peter Zijlstra wrote: > On Thu, Sep 20, 2018 at 06:05:59PM +0800, Wei Wang wrote: >> /** >> + * lbr_select_user_callstack - check if the user callstack mode is set >> + * >> + * @lbr_select: the lbr select msr >> + * >> + * Returns: true if the msr is configured to the user callstack mode. >> + * Otherwise, false. >> + * >> + */ >> +bool lbr_select_user_callstack(u64 lbr_select) >> +{ >> + return !!(lbr_select & LBR_USER_CALLSTACK); >> +} >> +EXPORT_SYMBOL_GPL(lbr_select_user_callstack); > That function is pure and tiny, wth is that an exported symbol and not > an inline? Thanks Peter for the comments. Because this function uses the LBR_ macros which are defined in this lbr.c file. Do you think it would be OK to move all the above LBR_ macros to asm/perf_event.h? Best, Wei