Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp2084389ybb; Fri, 29 Mar 2019 18:39:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlrXzN2iTR1mn0YNJfh/zUgNcFn/hnrl3WmQlrrhxA3ng0t1Pvhc3LgfSmdGafPcKf0wBT X-Received: by 2002:a63:475e:: with SMTP id w30mr22512942pgk.308.1553909954740; Fri, 29 Mar 2019 18:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553909954; cv=none; d=google.com; s=arc-20160816; b=A7Ts0AoJJKgHMhjy+2RV+eCwbWw4bBH06swwce7z4gPXtUerV5jVrvhIn+lWkcyLON XVTApS4On0MYBkXEF8tITlgPbW+PvMKAy1DdPBCGH/omEBFIqhgUy5WXKBHingLI/3tb 72YcYEvUwMQhK7Aif3ULW/SWm+WYt2VUcq/X9PoB415sMwBucb0VCczoFZtWmRC/0EJi 2WVjuFe9wNdxPLT0oHqmfouvjJ2WvfGMyCBOC251dpLY+5Ri13MtRt5sBCj+jGb5/OPu 4/HPtBq54mdWsbB1TCCsTPoVdeR7s6ESM0U2aNiHFdoSKxLjn9vMbYijazkZc2haf6et 4ytQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tfKBttTA/4F4T7e5Lggtj+MrJyEDPBdB+7EWBRkZoY0=; b=xANPWGvNo9kBF0ec9CH6zFdC6BDUdka4sHTVOAmmxLJueBU3p6A95rVbppD4hrPmGr lzDHY7ceEaQV1c1jPBsaDsFyfFsvFiPZBTBjp7rj+3JdCwbjXB1i/Pp8ZL4uX7ASGVV6 cLlpmaz4DJAqkDpkqDQX0r1ofDlmavjcixksuqOPyibaSgtwAqCNC81Art5KZP16TTSL xrUowE8WbGhCPpj8CzsoXCGN6ktgnDqWyTVwcrz/v+ehiB6rSTns65Qf4nuDEVKSEcSo DadM9HtGcqBgJs3PNkB1sfKSyBbyMwUis4Hdrt7XBRh3Tn3cpppA4sMy4mbD+Xy1/bGe NdVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fz9Ze+mw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si3126046pgq.528.2019.03.29.18.38.59; Fri, 29 Mar 2019 18:39:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fz9Ze+mw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732077AbfC3BhP (ORCPT + 99 others); Fri, 29 Mar 2019 21:37:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:38226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731776AbfC3Ba4 (ORCPT ); Fri, 29 Mar 2019 21:30:56 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 004D621773; Sat, 30 Mar 2019 01:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553909455; bh=mUhyyBjO06/dyxhqCghZnpDf0hg7B5DuAGK70pp7crw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fz9Ze+mw2xhO25NaLMtQ1Wu3rd9sG93ewyYKAUYw5w3oYc9HqbYmxChtC/9aEmJJO dncgospGIe8locb+A7RkIoOmK5eWYtromK7k0N+32tUqP8Y2WjzJpY2TQt0pV9AgAP 1Ck1dPHQAZs+27u2Vlv+keYtLdd+sk9xgCJ1DA+s= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "ndesaulniers@google.com" , Miguel Ojeda , Sasha Levin , linux-sparse@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 15/37] compiler.h: update definition of unreachable() Date: Fri, 29 Mar 2019 21:29:58 -0400 Message-Id: <20190330013020.379-15-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190330013020.379-1-sashal@kernel.org> References: <20190330013020.379-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "ndesaulniers@google.com" [ 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