Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3797546rwe; Mon, 17 Apr 2023 03:50:56 -0700 (PDT) X-Google-Smtp-Source: AKy350YyK+k+OAkQ4v47XNMdBC8uoq3Z+On+96kpPY4n+E9hDM4CypwVpFCizMn0AfIGqXQMjoKA X-Received: by 2002:a05:6a21:6d94:b0:ef:2389:66c5 with SMTP id wl20-20020a056a216d9400b000ef238966c5mr8859037pzb.12.1681728656504; Mon, 17 Apr 2023 03:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681728656; cv=none; d=google.com; s=arc-20160816; b=B5x+6PVGhBRjiP0IpSBA7uTcYmZFGQzJnNJhhabbuzWe5prOPa2I2cBekp4L7c1Uca qyn+aGWYKIRmDyNsWcaGz5FkxPGR5JXkDiW6C/LDODF1DR32Yt+2agNfw8MhtS3C+Ign a8785VzpSe1+dyVXrvlWcd7gWBIvI0kI0Z2o1+qxPZi8VO0+NhOKTJak+NB4gIy0o29T nAXlmWqEJkPujSiCTMzGIoidmSuNyjqrm4NmFOpncjChF3MknGP6Etgxdgx/Z8/yA6g7 jRtPFSaWo8gfuDnvkRG7SqzdxBX6YI91+Poo/tdSW4FiHbZ4bAAR+y/Hgt875j4LQ+bj gDFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=W5gz0IAPwW8Ml+TPwzI2zzEnnHxfoa0E4AWfaz+JnGM=; b=l5okPHOMKCSJyIFSjRN76tyJdzpOgCEd0Xfh7iGy1LeDqLLUW5jSPj8xW/TDj8BJ/x l7keV8gfKqfZKUk/giBGUHDzuJlqBORnmYKXlvJnIvY+PGzYjThERuEAujzzo9n2sgVm uF7/jvmdU6DIDpYkYfUd/AzRxFETOenvRlvhI3F/DLjMBMstfDuEs0lQZ2Ti0/Zdi4j9 R9qMZhdIPOw+YiTcO2imkgkMTRC3iUW3Fty7rfD2yZwEfLznxOspqyfvjvCBU4y8Dspv kB00H/AZvfwSv8/Y/qYZ9B89FeVTCTkqnq4Gb5kg34N4bJqJSs8BlNXziIqqpB//pIfN WrAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ycu5EFvg; dkim=neutral (no key) header.i=@linutronix.de header.b=IatCR1nr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j191-20020a638bc8000000b0051b7ba485d9si7990669pge.868.2023.04.17.03.50.43; Mon, 17 Apr 2023 03:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ycu5EFvg; dkim=neutral (no key) header.i=@linutronix.de header.b=IatCR1nr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230231AbjDQKtG (ORCPT + 99 others); Mon, 17 Apr 2023 06:49:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbjDQKsm (ORCPT ); Mon, 17 Apr 2023 06:48:42 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 298BFA9; Mon, 17 Apr 2023 03:47:52 -0700 (PDT) Date: Mon, 17 Apr 2023 10:46:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1681728405; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W5gz0IAPwW8Ml+TPwzI2zzEnnHxfoa0E4AWfaz+JnGM=; b=ycu5EFvgo2VWpyjSRBGDmDd/h4hpo2wBiH2VbxpHQWJCJTgxEpgsCJTLSSNe5wtQdzF82k 1wP0+5Dj/23IkzjhhHkjT4ZutwjKoOfIZtOt0D6wVxLuq6agj7czZhRAOmEbZUZty/jAjW BhUsh26jqs6wtY4z7VadeOmaBTSO0Ubt8ECebRkMqupeZ8ijziTm8zowr2wOKG347CVCWW qNE1g6PST6VoZ4f3gNNDtvH4Al2MBKQ9RCpPa8lxJhrWHGY0eNemvIPyLCjpTPYywnSnJi MJsxaCOIoHhFfVmO+dj89I5f702XDHIue0NuQhtnkzfH+1HZJPG/a5e7bJPk+Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1681728405; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W5gz0IAPwW8Ml+TPwzI2zzEnnHxfoa0E4AWfaz+JnGM=; b=IatCR1nrLl6AdV6PUJGG4QhrGoFAjl7fG+oIycCyls0pO3vzN7IlLYcokWLz9hFJhm0bMm Rw+FNMkVxSBqTSDw== From: "tip-bot2 for Guilherme G. Piccoli" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] x86/hyperv: Mark hv_ghcb_terminate() as noreturn Cc: Arnd Bergmann , "Guilherme G. Piccoli" , Josh Poimboeuf , "Peter Zijlstra (Intel)" , Michael Kelley , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <32453a703dfcf0d007b473c9acbf70718222b74b.1681342859.git.jpoimboe@kernel.org> References: <32453a703dfcf0d007b473c9acbf70718222b74b.1681342859.git.jpoimboe@kernel.org> MIME-Version: 1.0 Message-ID: <168172840540.404.15994550116544514863.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the objtool/core branch of tip: Commit-ID: 611d4c716db0141cfc436994dc5aff1d69c924ad Gitweb: https://git.kernel.org/tip/611d4c716db0141cfc436994dc5aff1d69c924ad Author: Guilherme G. Piccoli AuthorDate: Wed, 12 Apr 2023 16:49:41 -07:00 Committer: Peter Zijlstra CommitterDate: Fri, 14 Apr 2023 17:31:28 +02:00 x86/hyperv: Mark hv_ghcb_terminate() as noreturn Annotate the function prototype and definition as noreturn to prevent objtool warnings like: vmlinux.o: warning: objtool: hyperv_init+0x55c: unreachable instruction Also, as per Josh's suggestion, add it to the global_noreturns list. As a comparison, an objdump output without the annotation: [...] 1b63: mov $0x1,%esi 1b68: xor %edi,%edi 1b6a: callq ffffffff8102f680 1b6f: jmpq ffffffff82f217ec # unreachable 1b74: cmpq $0xffffffffffffffff,-0x702a24(%rip) [...] Now, after adding the __noreturn to the function prototype: [...] 17df: callq ffffffff8102f6d0 17e4: test %al,%al 17e6: je ffffffff82f21bb9 [...] 1bb9: mov $0x1,%esi 1bbe: xor %edi,%edi 1bc0: callq ffffffff8102f680 1bc5: nopw %cs:0x0(%rax,%rax,1) # end of function Reported-by: Arnd Bergmann Signed-off-by: Guilherme G. Piccoli Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/32453a703dfcf0d007b473c9acbf70718222b74b.1681342859.git.jpoimboe@kernel.org --- arch/x86/hyperv/ivm.c | 2 +- arch/x86/include/asm/mshyperv.h | 2 +- tools/objtool/check.c | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/hyperv/ivm.c b/arch/x86/hyperv/ivm.c index 1dbcbd9..4f79dc7 100644 --- a/arch/x86/hyperv/ivm.c +++ b/arch/x86/hyperv/ivm.c @@ -127,7 +127,7 @@ static enum es_result hv_ghcb_hv_call(struct ghcb *ghcb, u64 exit_code, return ES_OK; } -void hv_ghcb_terminate(unsigned int set, unsigned int reason) +void __noreturn hv_ghcb_terminate(unsigned int set, unsigned int reason) { u64 val = GHCB_MSR_TERM_REQ; diff --git a/arch/x86/include/asm/mshyperv.h b/arch/x86/include/asm/mshyperv.h index 4c4c0ec..09c26e6 100644 --- a/arch/x86/include/asm/mshyperv.h +++ b/arch/x86/include/asm/mshyperv.h @@ -212,7 +212,7 @@ int hv_set_mem_host_visibility(unsigned long addr, int numpages, bool visible); void hv_ghcb_msr_write(u64 msr, u64 value); void hv_ghcb_msr_read(u64 msr, u64 *value); bool hv_ghcb_negotiate_protocol(void); -void hv_ghcb_terminate(unsigned int set, unsigned int reason); +void __noreturn hv_ghcb_terminate(unsigned int set, unsigned int reason); #else static inline void hv_ghcb_msr_write(u64 msr, u64 value) {} static inline void hv_ghcb_msr_read(u64 msr, u64 *value) {} diff --git a/tools/objtool/check.c b/tools/objtool/check.c index e1b01ea..5b600bb 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -213,6 +213,7 @@ static bool __dead_end_function(struct objtool_file *file, struct symbol *func, "ex_handler_msr_mce", "fortify_panic", "hlt_play_dead", + "hv_ghcb_terminate", "kthread_complete_and_exit", "kthread_exit", "kunit_try_catch_throw",