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 X-Spam-Level: X-Spam-Status: No, score=-14.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D266C10F14 for ; Thu, 18 Apr 2019 18:26:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4548B2064A for ; Thu, 18 Apr 2019 18:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555611960; bh=HL6exLtOGefw0CGTJO3mTSTmXRcAQR1Qmvdgd85ISQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=X5hSYF1oimh0EHqFmth9CZg1Q6LPW0GKxUsKegiuE/jMWyDJcvdeb0jCuvGVrm9ik NJzPUCr6bFGb2GVKXFw8ZRI61Jot7qFygPPhZ0UzXH+Vewl0BxxHBqxWBiEkzBo1r0 7Y97pCVvyy+YLfM0vMAy+kusQimv5faNN1m8aKnM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391113AbfDRSZ7 (ORCPT ); Thu, 18 Apr 2019 14:25:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:34224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391176AbfDRSFC (ORCPT ); Thu, 18 Apr 2019 14:05:02 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 107C3217FA; Thu, 18 Apr 2019 18:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555610701; bh=HL6exLtOGefw0CGTJO3mTSTmXRcAQR1Qmvdgd85ISQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nBp+F45xNKbzZGgpGslRUf0/x8stdIpnz/mzFeFeHqJmLTcOAU9bD65Tju9cJPzpq zJwCByGVueBruE/ptrb9mWyJpU8nvY1RH/nzS7uhYf7VBxqoIeE0S17a4TLOylfPXN ItsAhjblLL96EMrkI66z9T3qVHfHTA+HKQDfIg+o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Lutomirski , Josh Poimboeuf , Nathan Chancellor , Nick Desaulniers , Miguel Ojeda , Sasha Levin Subject: [PATCH 4.14 52/92] compiler.h: update definition of unreachable() Date: Thu, 18 Apr 2019 19:57:10 +0200 Message-Id: <20190418160434.609303304@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190418160430.325165109@linuxfoundation.org> References: <20190418160430.325165109@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit fe0640eb30b7da261ae84d252ed9ed3c7e68dfd8 ] Fixes the objtool warning seen with Clang: arch/x86/mm/fault.o: warning: objtool: no_context()+0x220: unreachable instruction Fixes commit 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") Josh noted that the fallback definition was meant to work around a pre-gcc-4.6 bug. GCC still needs to work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82365, so compiler-gcc.h defines its own version of unreachable(). Clang and ICC can use this shared definition. Link: https://github.com/ClangBuiltLinux/linux/issues/204 Suggested-by: Andy Lutomirski Suggested-by: Josh Poimboeuf Tested-by: Nathan Chancellor Signed-off-by: Nick Desaulniers Signed-off-by: Miguel Ojeda Signed-off-by: Sasha Levin --- include/linux/compiler.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index a704d032713b..67c3934fb9ed 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -119,7 +119,10 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, # define ASM_UNREACHABLE #endif #ifndef unreachable -# define unreachable() do { annotate_reachable(); do { } while (1); } while (0) +# define unreachable() do { \ + annotate_unreachable(); \ + __builtin_unreachable(); \ +} while (0) #endif /* -- 2.19.1