From patchwork Sat Mar 2 00:07:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 159519 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp1341677jad; Fri, 1 Mar 2019 16:07:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyE7cQ+0GyLXBEA7hq0a0GZPdAfN4OteuTPC6oU7irD/Ocl/dQcrnB8PGlkhSHNQXY8a4RE X-Received: by 2002:a65:6483:: with SMTP id e3mr7458653pgv.273.1551485252055; Fri, 01 Mar 2019 16:07:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551485252; cv=none; d=google.com; s=arc-20160816; b=EPMxkNwpjGZLufD9jnOMi78e/d19XLfLU3vkg9HIuNFt70AGkwUjG3k8KHLvlK+nBj T0YPkp75nXPgMkUAwstVH95AjqMjPONu76RB5BadFZBuKS0FrDF1a/0PNDd3ngtruFOZ B7wZyGl0RUYze+TZsouqaIPGTvJhCPLGgdysZXeZ/lVF08303/S6yQ1gfETw9BDs+njc tN19L5DYGaHNJ+68Os+CRcdXGOM72I5d+to93uha+yiFnJkSA0i8Px64jaAcgZwRoJ9t RwN6nUUIzwNT4U2BYwb62bHcdHRhUMHKyQJLwXAq+M98+kcT6qFos92eB1bAuDtDymPE UGrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=sY3hGiIQgZlYTlKbHSQOU0k6Qj5QNj3YBWyce/UCZq0=; b=d5NNEyusXk7iwA2SSqiWENVJAkIkXX5FUy5ph1FrYWpSwj7zSW1O37owf0tHtbBK7C BwaU1fSkHLMWcO8u5C8lkCJpAOuFuCWQ/HcDBzcb0cOpFq2hv7EyFnsOp6f8xMgvO1Ml 3WaXR2wa6UMbKJssD/6+nhTX6XKz2f9RwLrlT5Ism5JNC9Y23WL24I8DUxp3QoY8B/si E+7ndMDA1ThVBXSXXWMDPR4Kuk0lP4F5zTjdLBwDaug6nS7RIULnrKGS+iGq8381PKYS ZihWXtvjRARZM7Vko7Clf/QVhOEGLCHynEPWUh2f5uNeUefMkKcgFGlnU8vJQEuFN1SW snAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uTU1Dcik; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si21704461pgb.164.2019.03.01.16.07.31; Fri, 01 Mar 2019 16:07:32 -0800 (PST) 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=@google.com header.s=20161025 header.b=uTU1Dcik; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726632AbfCBAHa (ORCPT + 31 others); Fri, 1 Mar 2019 19:07:30 -0500 Received: from mail-yw1-f74.google.com ([209.85.161.74]:38561 "EHLO mail-yw1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfCBAH3 (ORCPT ); Fri, 1 Mar 2019 19:07:29 -0500 Received: by mail-yw1-f74.google.com with SMTP id v85so7912143ywc.5 for ; Fri, 01 Mar 2019 16:07:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=sY3hGiIQgZlYTlKbHSQOU0k6Qj5QNj3YBWyce/UCZq0=; b=uTU1DcikEy+OVOBerS+CGyLCtCsZ6C3MQaviTtVmivEzJ5r63tmmMgbcVm+StM+rgX IP/akeHgWm3gbFcq6J3P0uP5ungxDrq30eYGT2bklh1b2/3pV0cJHNLHsCAbvNEk3VFi XHr0TgS+Ktf1lGl0ovvep0BWEY7AnkSiMNxxy2R1rDjDcqr+lJ9h6Spea3oDi59LSXa/ VmZvi93ifi192eWEMOJqEWdYUN7Jgtf7RidPPwyf7itDIjYoVXkZsvaBcqBWEAJl4tMi T+MpncWGf/H8Izqr6mMuZmtt8GgB+nTA8BCKOuvCRBwGnfrx7NOBPuptOc/uhK7VaOKF Gk6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=sY3hGiIQgZlYTlKbHSQOU0k6Qj5QNj3YBWyce/UCZq0=; b=GLqkvB0hyExTvgm0tE+gA3eBvPDNR7ai2zLEsT5ev7xE4ZtUSA0z7qeZeEYai4PEQ4 DThMy5wKD4j9iP1YsUY3vm9jUthaXDmZMCBrh0t+nkohr8YyGF7/MmIJalxgXK6qw9j/ QtNndBTvOCG94CnEi5rHkg7KRbmvGS+AiOToBooQ6QazCYNLGCyD4XJJuoWCIjorllel SQ+keYYrGf+WrvrILfCH73A7jhccuX7iVMLgIW0p5NnUKsFQCe+TEaz1JJgNWvSq6bq4 D4pHaS3x6Dlpg1PTlSa6jcoAhNEFGtfwnzvusbQpNp6phpB3w24B1E11qlo1h331iEGM OlLQ== X-Gm-Message-State: APjAAAUyaxkKCeplzJMqCC3f0sbILBMUhaLaEJqtnaNvu0uvySl53BPz 0/l3gSIZpIXU790EGK51EyNnWg3RMZleWA97LjU= X-Received: by 2002:a25:9c04:: with SMTP id c4mr3431904ybo.64.1551485248456; Fri, 01 Mar 2019 16:07:28 -0800 (PST) Date: Fri, 1 Mar 2019 16:07:14 -0800 Message-Id: <20190302000715.130116-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.21.0.352.gf09ad66450-goog Subject: [PATCH] x86/boot: clean up headers From: Nick Desaulniers To: bp@alien8.de Cc: natechancellor@gmail.com, niravd@google.com, Nick Desaulniers , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Stephen Rothwell , linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The inclusion of was causing issue as the definition of __arch_hweight64 from arch/x86/include/asm/arch_hweight.h eventually gets included. The definition is problematic when compiled with -m16 (all code in arch/x86/boot/ is) as the "D" inline assembly constraint is rejected by both compilers when passed an argument of type long long (regardless of signedness, anything smaller is fine). Because GCC performs inlining before semantic analysis, and __arch_hweight64 is dead in this translation unit, GCC does not report any issues at compile time. Clang does the semantic analysis in the front end, before inlining (run in the middle) can determine the code is dead. I consider this another case of PR33587, which I think we can do more work to solve. It turns out that arch/x86/boot/string.c doesn't actually need linux/kernel.h, simply linux/limits.h and linux/compiler.h. Include them, and sort the headers alphabetically. Link: https://bugs.llvm.org/show_bug.cgi?id=33587 Link: https://github.com/ClangBuiltLinux/linux/issues/347 Signed-off-by: Nick Desaulniers --- Note that this only regresses for us on linux-next (not mainline). arch/x86/boot/string.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.21.0.352.gf09ad66450-goog Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c index 315a67b8896b..f149316116d0 100644 --- a/arch/x86/boot/string.c +++ b/arch/x86/boot/string.c @@ -12,10 +12,11 @@ * Very basic string functions */ -#include -#include -#include #include +#include +#include +#include +#include #include "ctype.h" #include "string.h"