Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3708256pxb; Mon, 24 Jan 2022 15:59:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxAsnWMhyVy0u4nFUUaOqHed+KspIcAoNCi0usOWUYTGKyuv7L7bF9kM9xPiFtZDkjnQz5 X-Received: by 2002:a62:7c45:0:b0:4c6:d403:f27c with SMTP id x66-20020a627c45000000b004c6d403f27cmr15888168pfc.81.1643068768033; Mon, 24 Jan 2022 15:59:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643068768; cv=none; d=google.com; s=arc-20160816; b=aLfTclI9JPjhd53UkmmQ8dhgPm3Dq5bJMg8HJR6z8cWYtACB/E3mvjy7+Bol13fBxy dQUs3DArVMrRmmS8klebCewtQrSMAShhcsTrLunOfP8H/JNK8BUbaFyWpBuo/fvhTT98 JUEs4vJPqw5q3TIiClK+1N326p0Bv8ni+lUHxzWgkH4yMUoPZvpq9pPRzkFnp9btyntQ cTFj+R3Q+fStPazgIBTbCN7YZM0kZi9QZbiYorXSu4IajBk+/vxgHkoC2yR/uQlSavD3 abhH9uuO0dkm8TNuoiSvUHtWfe4FekxmLEfvNvqlhaTzRnocB5/iyljRA4TvK47DI1w5 YXpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8unpV9KOQ4Mwd3LIIXpHRqgeqKy+2w4nQeQuwIigBQg=; b=M2ZdstVa9FyOdAqzCBdX1asAt6x3NdupjLZVdmZCD9STNFyy78Fpmp15cQ81gXTQHg joZbQIT35pziiRlcN3E4/AOBfOZjtFsbzaSMyvsBu70m7ayG+OLSz7OU2BuI3kwMqe+d z1tLP9AOuGfaQKDBHlQdLI4wsBRbuvWGIQ5AvtJ3ikL7sQt2429HvEnpzGe9/9eBnZ1c b6cYgTP68JWtpF9WoA+Gv7fjVnywHR8dLuIKF2ZTYdhRkp5mpbIOIKsfANspiruW/u97 VBMLdE3vsCY6AVKCbUEp6OnUfqxGsr9kqhRwqGYFSSE87G14zu5+xC1RctDB5M3J/Q1f 9/Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jyVN+TnW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si15004291pgj.586.2022.01.24.15.59.16; Mon, 24 Jan 2022 15:59:28 -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=@linuxfoundation.org header.s=korg header.b=jyVN+TnW; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2367159AbiAXXyp (ORCPT + 99 others); Mon, 24 Jan 2022 18:54:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1846525AbiAXXQP (ORCPT ); Mon, 24 Jan 2022 18:16:15 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4F2CC0617B9; Mon, 24 Jan 2022 13:25:22 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 51B1C614B4; Mon, 24 Jan 2022 21:25:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3215CC340E4; Mon, 24 Jan 2022 21:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059521; bh=3LV5DA4CunFmtMFjiRUINxyiWNUMTcXhYsN9cLaWweI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jyVN+TnWZ0RJ4OxTa1WTr2cRmaS2YLgDZ9DbDNU8WNhex+A5e4NpCgN5Ci5t/En+Z 6ZlxMoahAVwBTX999agP17o83ELYmcen4IfBrFR9eYx5oEYFpUBLQ8lQVdLS9bqzur sYFRNBp2HD+7AKmapQxg7qjCae62FKO9KKRJ3PuQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Borislav Petkov , Sasha Levin Subject: [PATCH 5.16 0643/1039] x86/mce: Mark mce_end() noinstr Date: Mon, 24 Jan 2022 19:40:32 +0100 Message-Id: <20220124184146.973490807@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov [ Upstream commit b4813539d37fa31fed62cdfab7bd2dd8929c5b2e ] It is called by the #MC handler which is noinstr. Fixes vmlinux.o: warning: objtool: do_machine_check()+0xbd6: call to memset() leaves .noinstr.text section Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-9-bp@alien8.de Signed-off-by: Sasha Levin --- arch/x86/kernel/cpu/mce/core.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 9a52ec55e0555..75095986e5eff 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1063,10 +1063,13 @@ static int mce_start(int *no_way_out) * Synchronize between CPUs after main scanning loop. * This invokes the bulk of the Monarch processing. */ -static int mce_end(int order) +static noinstr int mce_end(int order) { - int ret = -1; u64 timeout = (u64)mca_cfg.monarch_timeout * NSEC_PER_USEC; + int ret = -1; + + /* Allow instrumentation around external facilities. */ + instrumentation_begin(); if (!timeout) goto reset; @@ -1110,7 +1113,8 @@ static int mce_end(int order) /* * Don't reset anything. That's done by the Monarch. */ - return 0; + ret = 0; + goto out; } /* @@ -1126,6 +1130,10 @@ reset: * Let others run again. */ atomic_set(&mce_executing, 0); + +out: + instrumentation_end(); + return ret; } -- 2.34.1