Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1995441pxb; Mon, 18 Jan 2021 05:42:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2lBmreRVcgBSMscaxgPTtRxj40srMgbRioTQ/aU4ykTR+ieiK1qSp7zYCmqmD/0LuY31s X-Received: by 2002:a05:6402:513:: with SMTP id m19mr14267914edv.229.1610977344485; Mon, 18 Jan 2021 05:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610977344; cv=none; d=google.com; s=arc-20160816; b=B5sQj6IYWnK7k8tLY+cKMloDkgOtvmaKk9GtvV+lk5VvBIkavB9lqru/ipPl5CC5Mi hoXWQ7GcHR7V34aJF7lYPsya0h8Sy8pNQ3o90YT2NbiZ/SMgC1WlD3bmJNFOdmLS2BKJ WC85zrYsb9abtDRzZuvxXFNvSWkcywdGblr3w4X9EM5uFh/J8xblHfIoEmBUmCoi3Rnt 4y3VH8NLnjGB6fenCpIbeub6IHUI5qxUDRK3HlQRqONjLg+c8ShEHHGSvIAfSt77t4fc G4i+WjO72BZk66B7yNzbku7fiX0/QA2ccx5T3iiHQ5r7GI7n8mXMjVkFMJA7nMGJPu3k MBdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Xvb2bA8jC9t3A+BvPDpcUOdOaB4WCZGa538oav7lt1c=; b=gMAPgTAc9S/W3TmZ5zy5IX07NF6FCLMYil7I01jYRzq7ohhaZ0g151yJSO1CnnUtYW V9je57uAkdZYVtC80XOyCt39bbujf2Rfc8tGNA3RlLe5IvBq2yucmJFNW9aqzjD0DwaT jgj4w2r8U+ht85Eh80VrV8nr50ce1xfM1FoWMg6CTv8EA8JmyhrYU8zFLPbzphgyQwHR OyDigmezsDVPx8fEcfG13jfy/thFKBWrULsAFhI9aebQELPFVgflueUWt0348gXEB7Q8 l0V9s6LshnuAhQxxEJ85/ZP9TRRFajLsM3lXbDUXXjFOm9H3At3LzNH78GeOoiGSq2BN MSxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=DXnI2dGL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si7155981ejv.36.2021.01.18.05.41.54; Mon, 18 Jan 2021 05:42:24 -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; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=DXnI2dGL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404629AbhARNjm (ORCPT + 99 others); Mon, 18 Jan 2021 08:39:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404494AbhARNgF (ORCPT ); Mon, 18 Jan 2021 08:36:05 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C9A4C061573 for ; Mon, 18 Jan 2021 05:35:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Xvb2bA8jC9t3A+BvPDpcUOdOaB4WCZGa538oav7lt1c=; b=DXnI2dGLpur6S3oIRBNPe9eRvf 9wBJ1K5v2cDKlr4WKcbCx728sjDx55fL7nTx5tJ9On33BP9wQUEMj+7UcY2Qnx1dA5Jbvn2c64SeJ //dyAz3s+wzxLKLdxL4VBgShOG9YuGu9JkdQFrMuvmpYTm2WtOA/+OwvFVSu/xj94bVoUFM8nVY1/ 5oqCqfbu8j5e8iMp37iV/ocqJmEm6RLxlXXsdwmBVvYhfNDW3+v8BhM2mYSef4BH8okcPtw6tTALp A4XldKeMccE/wHz9K9tRF8QN91kb3HZWyB1o9I7ws2g0TcRYIVcvtVCwDXEOagNGE54w4NEB/OAA4 lsZcsTiQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1UgU-00028y-VW; Mon, 18 Jan 2021 13:35:07 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0DEFF30015A; Mon, 18 Jan 2021 14:35:04 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id ECF642023AA35; Mon, 18 Jan 2021 14:35:03 +0100 (CET) Date: Mon, 18 Jan 2021 14:35:03 +0100 From: Peter Zijlstra To: Like Xu 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 Subject: Re: [PATCH] x86/perf: Use static_call for x86_pmu.guest_get_msrs Message-ID: References: <20210118072151.44481-1-like.xu@linux.intel.com> <202101182008.jQybUDa0-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 09:05:06PM +0800, Like Xu wrote: > I guess this fix will silence the compiler error, > and v2 will be sent after the local 0day test passes. I think there's also a problem where you don't assign a function at all. I think you want something like if (!x86_pmu.guest_get_msr) x86_pmu.guest_get_msr = guest_get_msr_nop; right before x86_pmu_static_call_update(); And then have it be something like: static void *guest_et_msr_nop(int *nr) { *nr = 0; return NULL; } and then you can reduce the entire thing to: struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr) { return static_call(x86_pmu_guest_get_msrs)(nr); }