Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3600708pxb; Mon, 24 Jan 2022 13:14:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0JfoJ3wIkkKzTbtRZTSix+5f4mByPFns95+Q0PqjPQ665bAfqq8NspGIA8RVe2BAsDFI/ X-Received: by 2002:aa7:88c9:0:b0:4c9:319e:ecb7 with SMTP id k9-20020aa788c9000000b004c9319eecb7mr5802616pff.58.1643058844238; Mon, 24 Jan 2022 13:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643058844; cv=none; d=google.com; s=arc-20160816; b=Em74EoUdg60ff/fvI7F8/BPqNozZAB/nojnq1aLh4rIAUhI61q+g0mChR85jBFmOdV zsTre5ZOlrXM8c7YoMPM8SH19dEEt9dPrBk5xvFRxUsURe/te/Rsaaj9YRAbQdKsLBuM ZzVRZEpyq/Jk0s7CRv1dhAEs0HSzPjUq53230Qv2k0XpNMj4G1POA945vHSDQ9dHi1TS GR0kexcapLq3LH/nRLahsOb5Cblbg2TxZYBkRbjDZjf2CtdDR6eaZNktLLrywFqfSByf rUgD7dH0dtErO3zo8HQK4fOBctIhpIgEY2wT+D7zbeUOJhH1EHh9vz668xQgFAe/1Ss5 MYCQ== 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=048pkWDivCoEEBnYNG+c7YUC2XBy88Epffx6kA7WhHA=; b=Vfn0Y8sGeoSe5EJs+P++1xaBWblhO3DxuQIgiW0DQs5k4bV3tIPeVYTTv/y63vJ9wZ UyRXstfPU4jBc5TjwAfoexCKx8pc/wGyz/zrGQtr7L/LALqXyeCCsU0U/SlLdaym2xxS tWGM+Zfb2TZyDY3XZgsyh77PSS8b1lSDw523ZHwVZnEdoXw+WwCtq5Ta6pYh88gg3u9G PwcWS2+5djrdpqJ1VHi7AFrqa3TndqZ6nz8UpaW+8KEHRHe2T3mfIEv7IWEEox4eOT/k 4dqRQKatBzCceb+W7BcpefdRPHVOPcOSj6145YEA3ivHoECDDtlM1aAHh/SjqWIsOt3Q zctQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o7FMlxVZ; 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 x4si12815603plo.108.2022.01.24.13.13.50; Mon, 24 Jan 2022 13:14:04 -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=o7FMlxVZ; 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 S1351165AbiAXUjV (ORCPT + 99 others); Mon, 24 Jan 2022 15:39:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236888AbiAXULn (ORCPT ); Mon, 24 Jan 2022 15:11:43 -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 E75F5C06F8F9; Mon, 24 Jan 2022 11:33:40 -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 86506614B8; Mon, 24 Jan 2022 19:33:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47EEBC340E5; Mon, 24 Jan 2022 19:33:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052820; bh=+JMII1/WLNgrn/UhD/fchGRwGgo2s8880QhuVgd4d5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o7FMlxVZF+WYqhnNfjyNMbrbckp7dq+wkbFVXXrbVybo7iPuPckYkYmB4BY/NLY4i PJEdoYgEWXrjbfQEzuQz9lT2Lpi+Mq6pQ07O+5/lAq2ll+E1uKeQ2OLMtg+nRKu4Lq 0A/aJUNk8V2pygpkqF8rES6Cki1oG/Q1Ilxboy2w= 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.4 185/320] x86/mce: Mark mce_end() noinstr Date: Mon, 24 Jan 2022 19:42:49 +0100 Message-Id: <20220124183959.945114596@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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 290d64e04ab20..a0f6c574c3783 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1080,10 +1080,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; @@ -1127,7 +1130,8 @@ static int mce_end(int order) /* * Don't reset anything. That's done by the Monarch. */ - return 0; + ret = 0; + goto out; } /* @@ -1142,6 +1146,10 @@ reset: * Let others run again. */ atomic_set(&mce_executing, 0); + +out: + instrumentation_end(); + return ret; } -- 2.34.1