Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3675128pxb; Mon, 24 Jan 2022 15:04:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzByzS7xvyiO++n/sCfHcA4u3Aav3LtEDRO3gCpNEmNwYPDRoV50pCNobCB967g02p6HcR+ X-Received: by 2002:a63:595e:: with SMTP id j30mr12262917pgm.487.1643065479972; Mon, 24 Jan 2022 15:04:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643065479; cv=none; d=google.com; s=arc-20160816; b=eQDgRe5LBlPBZccSxG8McsGbMOUr3lIM03qPe2CN0hefhl98i1F/WtsuQYvTfT8H8K kI0MW5vG3bCaBVozBbs8mN7KTvPO6vJv2J02mGEOxX3MQsj3fkSMO6psnU3/V7iSKPWM 5iOEaGaWSux705CL1iAm9knWmLnlqeWb4GOGMUYpa6StJpo6xMuTfTZ8rcj3/OdO/bbC 0nXDgLIFsKJ0bu8qi/c5KDzwDsrC5Y6Ese3sWvpgbgiHEEs0Lv4plHaAUGce7L7FZmd/ QFMfoC18a8b1XqBFvEaWNuBnclqK/j7gPfgW1jpQb1/2W2P4YhlLWoZKdLWQ2JsD4YQb PWRA== 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=rFIqAVAf3SOCz0PK5Xun5RVM8j5fzVJsuSvp1VvgnZ8=; b=PJwzkOWar+SEzgF/1+pVQb7Nc4dXR0V6CXe0ot8tDCXvTF92xAViUNGVC3wIls3baw j5RdeNhxFn3QN8gjqKaHN8LzcFtVKg3luAOwqmnh4bDeVG1V3zdx3vGEp92PsU2iSahe cdTsf9vnAiTuLmyaj92jK8VuwZjwYfCESJkytWCSWVOsDCscGIgpL+d7OE8YVGtzNiyr /J7HjuDlauidU/tfV6P5a4gG0OntZ8CC44OhJn1eeB3n1+dkJfUQqOz5dQikiv9WJXqk TpyA3bQNOZcZI58KWM16UhrpEsO/2+pYpUJyG/REfDdJufC+c6GXo8hIvWg+IO6JtuYA dmNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=maYodSCW; 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 f5si2287525pfe.346.2022.01.24.15.04.27; Mon, 24 Jan 2022 15:04:39 -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=maYodSCW; 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 S1841743AbiAXW74 (ORCPT + 99 others); Mon, 24 Jan 2022 17:59:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1577007AbiAXV5J (ORCPT ); Mon, 24 Jan 2022 16:57:09 -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 629F0C094272; Mon, 24 Jan 2022 12:38:39 -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 0252B61574; Mon, 24 Jan 2022 20:38:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFD16C340EA; Mon, 24 Jan 2022 20:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056718; bh=n5STwlI8aR1A8Yu0tQjeLMa+CdZhF5iB8+1SGg5i+O0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=maYodSCWrU1J1tKJm5ZZeFSOm7v4It60nqt1QY+eoJRq8ef9I20nxXz3PV8H6qjFk so4+nlGjYOJ8qHM+XKVa9RJ3KcXbj6yLZ4tO+zSKLSqUi62EKEqXqpAd+pAHJRMnkl cL9AZOL5pVtvJokMm9tO9cSdN27QVe5fzOe48i9A= 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.15 544/846] x86/mce: Mark mce_end() noinstr Date: Mon, 24 Jan 2022 19:41:01 +0100 Message-Id: <20220124184119.789585189@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 c5a1022463bcc..c37a0bcf2744b 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1081,10 +1081,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; @@ -1128,7 +1131,8 @@ static int mce_end(int order) /* * Don't reset anything. That's done by the Monarch. */ - return 0; + ret = 0; + goto out; } /* @@ -1144,6 +1148,10 @@ reset: * Let others run again. */ atomic_set(&mce_executing, 0); + +out: + instrumentation_end(); + return ret; } -- 2.34.1