From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F4D11CCB44 for ; Mon, 4 Nov 2024 19:08:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730747334; cv=none; b=k/WNCATkhD5UfBwwiAF+fboySMUrzwgqk/W5u/37peB3+XqZfp5LtuU6o7EYqZZIHmmcfqBWXOZ7AAfrVGE+R7vcAhFcYEe89jehPrJbiM//t707xxl1XeUnH9MsnErpofZdVvjO6qEzgboo/Hp4S4SFsfJMnPz3njHuJsjcBkw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730747334; c=relaxed/simple; bh=Ne9gWDmy9+oIDf7AHAPV+xcMNiOkpbnCzokN1TXM4JI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hC567c0LkEPrfYosHSK4FXhxd+FGHfNhpNPP7km6mGgj6t5Grqdm+KrvcmjOszhfxg04OUFmcdjIZHOFCEroOAPOG1iegGOmxe+p2bbilfWKvwyuhLyEJUox2RKkqsBy1eQfP5BYoDYNvojgnsgqT+pLkSY5aXnEfUX7klgm27g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HReNF6hZ; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HReNF6hZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730747332; x=1762283332; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Ne9gWDmy9+oIDf7AHAPV+xcMNiOkpbnCzokN1TXM4JI=; b=HReNF6hZxM1aWeQDUq4dAd9mzZFjJkXAZH0xoq5J9oyqPNFzB+vI2S7t dTXGpnJPBk788UVt0kxQlgNFDf7NmxtosIot7xPlUQ7DJ+oA6WhtGDgPT mKZ6++lWo6DrUbV+z94gJT82o4ryDhupAs9OSyFtuiuYawJGvH0UapzwS 4onSpI+L6BAhrLbFHHKkMI2QpMULWxefXhl+inzUQ1LOJAOqmFQsAUlZF +0SuiEjrDAoIYpfl9HqELoyeJHaHEzGaQI7NoGFpLRRIQXskZtuvj3z81 PXcsIvqlk6jalZqWbFqWP0/KPIWGtm4hqUXZxWeeMBzGtXwcM7tZuumWS w==; X-CSE-ConnectionGUID: 83LMKgIiRMabB/uTMt95cQ== X-CSE-MsgGUID: 6kO/WOSfSXyyhs7niuxfYg== X-IronPort-AV: E=McAfee;i="6700,10204,11246"; a="55864284" X-IronPort-AV: E=Sophos;i="6.11,257,1725346800"; d="scan'208";a="55864284" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 11:08:52 -0800 X-CSE-ConnectionGUID: XbfzRKTqT6uAqthkuuxYCQ== X-CSE-MsgGUID: y/iiAJh1TFS2unUJJXzOJA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,257,1725346800"; d="scan'208";a="121224533" Received: from smile.fi.intel.com ([10.237.72.154]) by orviesa001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2024 11:08:48 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.98) (envelope-from ) id 1t82RR-0000000BA8O-1MJr; Mon, 04 Nov 2024 21:08:45 +0200 Date: Mon, 4 Nov 2024 21:08:45 +0200 From: Andy Shevchenko To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Subject: Re: [PATCH v2 1/1] x86/reboot: KVM: Guard nmi_shootdown_cpus_on_restart() with ifdeffery Message-ID: References: <20241008191555.2336659-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Oct 10, 2024 at 02:37:59AM +0300, Andy Shevchenko wrote: > Wed, Oct 09, 2024 at 12:34:37PM -0700, Sean Christopherson kirjoitti: > > On Tue, Oct 08, 2024, Andy Shevchenko wrote: > > > The nmi_shootdown_cpus_on_restart() in some cases may be not used. > > > This, in particular, prevents kernel builds with clang, `make W=1` > > > and CONFIG_WERROR=y: > > > > > > arch/x86/kernel/reboot.c:957:20: error: unused function 'nmi_shootdown_cpus_on_restart' [-Werror,-Wunused-function] > > > 957 | static inline void nmi_shootdown_cpus_on_restart(void) > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > > Fix this by guarging the definitions with the respective KVM ifdeffery. > > > > > > See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static > > > inline functions for W=1 build"). > > > Heh, I tried fixing this too, and have patches to clean things up, but I ended up > > not posting them because I decided the W=1 warning was less ugly than the resulting > > code in nmi_shootdown_cpus(). > > CONFIG_WERROR=y is the default (at least in the current defconfigs for x86). > My goal is to match what ARM builds survive (to some extend?), i.e. W=1, so > may one apply either version I provided or yours? > > > If we're willing to take on a bit of weirdness in nmi_shootdown_cpus(), then much > > of the #ifdeffery can go away. Patches attached (lightly tested). So, what's the status either with the proposed change or with what Sean shared? Can we somehow move forward to fix the issue? -- With Best Regards, Andy Shevchenko