From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3BA1C433F5 for ; Wed, 8 Dec 2021 11:14:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232468AbhLHLRj (ORCPT ); Wed, 8 Dec 2021 06:17:39 -0500 Received: from mail.skyhub.de ([5.9.137.197]:60840 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232269AbhLHLRX (ORCPT ); Wed, 8 Dec 2021 06:17:23 -0500 Received: from zn.tnic (dslb-088-067-202-008.088.067.pools.vodafone-ip.de [88.67.202.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B41631EC0535; Wed, 8 Dec 2021 12:13:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1638962030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M9QJB2LwaJ9ukINgZ591uBloMTzNmx81uGl6piFZqtw=; b=UMIIw8XprnkHYalTaV6LQDOq2THDS4a324k0UCObf3c9sDBpYjY2X5+GmjeueesSUY7tLn XiiY9xxdQBbdvMzfxgzKQW3iXsnBDncztEJgKDK3WTQwEhR39RIOth4ZVwJwuLsV2W31rk EkJcRswTJ72UuIEubIqFBF8zW9ku9fg= From: Borislav Petkov To: Tony Luck Cc: X86 ML , LKML Subject: [PATCH v1 08/12] x86/mce: Mark mce_end() noinstr Date: Wed, 8 Dec 2021 12:13:39 +0100 Message-Id: <20211208111343.8130-9-bp@alien8.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211208111343.8130-1-bp@alien8.de> References: <20211208111343.8130-1-bp@alien8.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov 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 --- 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 d81266885de3..e86334925797 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1064,10 +1064,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; @@ -1108,7 +1111,8 @@ static int mce_end(int order) /* * Don't reset anything. That's done by the Monarch. */ - return 0; + ret = 0; + goto out; } /* @@ -1124,6 +1128,10 @@ static int mce_end(int order) * Let others run again. */ atomic_set(&mce_executing, 0); + +out: + instrumentation_end(); + return ret; } -- 2.29.2