Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1976483pxb; Mon, 18 Jan 2021 05:12:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvG4urzHkUii5KVgZnWnLw1LCwIttAHGMHtLPZXwNe8Zzo5sGjaL5LyTrf6+3qBql8hKB7 X-Received: by 2002:a05:6402:40e:: with SMTP id q14mr19050285edv.85.1610975579373; Mon, 18 Jan 2021 05:12:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610975579; cv=none; d=google.com; s=arc-20160816; b=zKrqWZIiwhAYfFISR9MGYwzNgDSsubMFKYO5yyXuBdMg8/vhQRRxNRDgqi6HPPD3cc nEXwsR6p0ae0KZ/h0JRLqn4NTZoIx2w5u24j4KpQtYV+OZI5wPYHhLTc8uRBu6HB2jFh uxNyhVL9aFFVJljgNwAzxniVaq22Iy8t3oIZsn0TjF13Gjme9Y+by5ZA03jLQlMHN7/q ro7jZgZN5yaKpwvdaBowGk4G+NYWKCnnX2MqrccxvK7yuVMJhnyzv0QGjaTrYClNJseE yoOHWEA4qUS6rhDLUmM4oSaSnNgwIWTo56ziXljsyBRmxCm8KlwFNcXKdg2xt6p1Bwdz OH/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=ilGq8WlBFmFXJovfUH0LHVcRMCUkEbPZ2OaNgNZpyGE=; b=RjxaLkuYYBGukTavaZ3HaR7qrgXpF6s0Be75eJqH/2obCF/0L6OMBKpQBudZAqIrpo PIWBhCJNe2sIlnlcI0sg6AkxStQy252terJAXVMHvW0ys+zTzeGVUJDLKLUwBZZSIGWR s1KE8qoLD5nE510oMuhd2zPZPkdqV9ZvAFPciSDlJ/OFIZFv5DWCbSsmnK7eQSFUTaGz rW0y1vKFcxRJuO9dwnUgXMWM8w3C7jrPHb8DkKYoEGR7UhIzepdcadLK0XXW6kCccWGa o9wsR9NX4RHOXZCaIWGnuZpueza5U1q21om3xE3PtZqzvxRXrLJYI3SuJA8MBtdbJPvF UAMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ci17si370033ejc.364.2021.01.18.05.12.34; Mon, 18 Jan 2021 05:12:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2389648AbhARNH0 (ORCPT + 99 others); Mon, 18 Jan 2021 08:07:26 -0500 Received: from mga04.intel.com ([192.55.52.120]:49493 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388850AbhARNHH (ORCPT ); Mon, 18 Jan 2021 08:07:07 -0500 IronPort-SDR: NdAuvIMijyUZkN+ke7q69xjOuhDrmwrIAch+a0ZWDzN/iK5v6nyl3jSFupGhfSn82BFogil0qI hDTIiQa2gKRw== X-IronPort-AV: E=McAfee;i="6000,8403,9867"; a="176227810" X-IronPort-AV: E=Sophos;i="5.79,356,1602572400"; d="scan'208";a="176227810" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2021 05:05:14 -0800 IronPort-SDR: Z4a7e9twg5ORZ3x9btiBnSsh5HzEFV6p2J/lJlFX/iclkhR1YWxwGNzRUUO9BE21p9QjkQRs+j C4NA5X2qPwDw== X-IronPort-AV: E=Sophos;i="5.79,356,1602572400"; d="scan'208";a="383566818" Received: from likexu-mobl1.ccr.corp.intel.com (HELO [10.255.29.150]) ([10.255.29.150]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2021 05:05:09 -0800 Subject: Re: [PATCH] x86/perf: Use static_call for x86_pmu.guest_get_msrs To: Peter Zijlstra Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Thomas Gleixner , Borislav Petkov , x86@kernel.org, linux-kernel@vger.kernel.org, Jason Baron , Josh Poimboeuf , kernel test robot References: <20210118072151.44481-1-like.xu@linux.intel.com> <202101182008.jQybUDa0-lkp@intel.com> From: Like Xu Organization: Intel OTC Message-ID: Date: Mon, 18 Jan 2021 21:05:06 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <202101182008.jQybUDa0-lkp@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I guess this fix will silence the compiler error, and v2 will be sent after the local 0day test passes. diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h index b9a7fd0a27e2..517f546b6b45 100644 --- a/arch/x86/include/asm/perf_event.h +++ b/arch/x86/include/asm/perf_event.h @@ -479,15 +479,11 @@ static inline void perf_events_lapic_init(void) { } static inline void perf_check_microcode(void) { } #endif -#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL) extern struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr); + +#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL) extern int x86_perf_get_lbr(struct x86_pmu_lbr *lbr); #else -static inline struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr) -{ - *nr = 0; - return NULL; -} static inline int x86_perf_get_lbr(struct x86_pmu_lbr *lbr) { return -1; On 2021/1/18 20:12, kernel test robot wrote: > Hi Like, > > Thank you for the patch! Yet something to improve: > > [auto build test ERROR on tip/perf/core] > [also build test ERROR on v5.11-rc4 next-20210118] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch] > > url: https://github.com/0day-ci/linux/commits/Like-Xu/x86-perf-Use-static_call-for-x86_pmu-guest_get_msrs/20210118-153219 > base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 9a7832ce3d920426a36cdd78eda4b3568d4d09e3 > config: x86_64-randconfig-a002-20210118 (attached as .config) > compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 95d146182fdf2315e74943b93fb3bb0cbafc5d89) > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # install x86_64 cross compiling tool for clang build > # apt-get install binutils-x86-64-linux-gnu > # https://github.com/0day-ci/linux/commit/0cd2262fad043a5edef91fca07d16759703658b8 > git remote add linux-review https://github.com/0day-ci/linux > git fetch --no-tags linux-review Like-Xu/x86-perf-Use-static_call-for-x86_pmu-guest_get_msrs/20210118-153219 > git checkout 0cd2262fad043a5edef91fca07d16759703658b8 > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All errors (new ones prefixed by >>): > >>> arch/x86/events/core.c:670:31: error: redefinition of 'perf_guest_get_msrs' > struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr) > ^ > arch/x86/include/asm/perf_event.h:486:45: note: previous definition is here > static inline struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr) > ^ > 1 error generated. > > > vim +/perf_guest_get_msrs +670 arch/x86/events/core.c > > 669 > > 670 struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr) > 671 { > 672 struct perf_guest_switch_msr *ret = NULL; > 673 > 674 ret = static_call(x86_pmu_guest_get_msrs)(nr); > 675 if (!ret) > 676 *nr = 0; > 677 > 678 return ret; > 679 } > 680 EXPORT_SYMBOL_GPL(perf_guest_get_msrs); > 681 > > --- > 0-DAY CI Kernel Test Service, Intel Corporation > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org >