Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp2085267ybb; Fri, 29 Mar 2019 18:40:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvtiM6WGoUe8dqmM/A0bWNeo7sq+z1VvLV0oJB7+cOczoyI18bBPSTtkIcwdDjdbKeRdov X-Received: by 2002:a17:902:b217:: with SMTP id t23mr52722150plr.184.1553910057611; Fri, 29 Mar 2019 18:40:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553910057; cv=none; d=google.com; s=arc-20160816; b=AqtYDG+YKPDJuqzokc0QnVqRdqxvgaziJWE2bLhp/xZma++H9FPyzn4TwsStk6GsTZ c82ick1TA9ULyVECC1vu20K0Po95xtKU805Zb7cwqCLtMYgy3pDSNWBeeNnUEoYH1h1I z8YYfoiY67Pek7U90xboGaNaMsbm7aAJAjy/CQS8vTLnLF0bqtDNad6JDIBwdS2fwmCq 3hRbA4eyACIrPAwBD7H8hHb8QMC0NsBzXc5lJ80QfIOgp69i0PVkqveOOPYG69UyqxaH qeK68HohSCnMlwJSYNNfyO/WeAFhsQ2yfZrTjfx2xKJBsKs4sPXFW35QqXKuiLhgD0OE 09cQ== 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=fmxTU+bjqSt/VNyALAPBUcPqaHsqNmm2tqRM8u5khFI=; b=DpfUD4ZFhKNiECf0csDJZNJYePg2zVZwnEEkWm6C8pNiRRPFGRNcUPG4oNfCYiUkQA FlrZCVRZ5E20bfpANhX/7M5mJ3U7mDvheJ7TAkKODyVtLa+9jQYpQlCZ+7ZPQfD1PKaP kjDhvSP2m+DWkxcRgJZ15KPqcwlqIErmgp2rJ3Xx10RrsJSiFpzuersV/NhJIANglrUS TPMSBpz5M/hvVVCcoJoMZYTfsYeAtBjWwrc2h2hgbjQsVTPgue2mEnOO6L5hSdclnglD oc4betyV9IBv0imsXE4g3g781xvXnbMzJF91NWsBFCDG763lGxOgqyOFng8i5epYNq6B C9PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="us8u/Mf2"; 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 k17si3175096pls.66.2019.03.29.18.40.42; Fri, 29 Mar 2019 18:40:57 -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="us8u/Mf2"; 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 S1731360AbfC3BkL (ORCPT + 99 others); Fri, 29 Mar 2019 21:40:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:36542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731066AbfC3B3h (ORCPT ); Fri, 29 Mar 2019 21:29:37 -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 49037218D3; Sat, 30 Mar 2019 01:29:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553909377; bh=/YDHOgL/tSBnVUy+gBUJQ2XXaLnuamsARngpraor9Fk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=us8u/Mf2tGPllNtR4UnBnu4FxDQ619iCkIQN2DPm10BtWEv1ViQbsnOR6jORuhQx5 SqxjBigb9WjFCwGazUj/Q/7+KnzDwqt+BAnIIhxT5t8GzC9RDBSY2kfZvDUx7PIFO1 tJhHavjcXT+vAekgngnuRy9C0TbcLOtUn5Iqqdh8= 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.19 21/57] compiler.h: update definition of unreachable() Date: Fri, 29 Mar 2019 21:28:14 -0400 Message-Id: <20190330012854.32212-21-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190330012854.32212-1-sashal@kernel.org> References: <20190330012854.32212-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 269d376f5a11..81c2238b884c 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -124,7 +124,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