Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8988390ybi; Tue, 23 Jul 2019 19:32:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNDdYqQ5hDJCJjWfLeVVWhb8yWytoNIcSiY5WCVyPeNBlzXTlkKkn1s/Aa8Tz73y5iOhxM X-Received: by 2002:a62:1597:: with SMTP id 145mr8520790pfv.180.1563935573627; Tue, 23 Jul 2019 19:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563935573; cv=none; d=google.com; s=arc-20160816; b=wokJ6UB//JDGvRN0cNVeWwHUHEiJBUSMwPSuIMHwu+vUQMpkojzNK6c5fWQ0Jp/5N4 VOf7dJXDQmVhkFCs6DoIZZ3kCqFULk2JoGiPPRLfGJi++CfII/bDxM4XTx1CwXjhnd8q 41KdF/+h8hqXhkOSsC+OZ3IqIZAyNPunvOep+jINE6ZnnbFNlSWFYEAANe9MwMXfC27L OufXBk6sbA+SFRJM0y7OV30O1tFKbfA7SO9Mg/nYEt7QLF6n5k8A8BaIkljsKWFEZMOY 0zR7SLhNxBRgHnWUI0QVuNb9NlBQb46AdUiEdgtEFoCMIaDFGDyqxlBg+1WlnZfsj9A3 HTpw== 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:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=ds+yDlyVjybdin7f83dyTCd0MUOnW1rqJpaXINk50aY=; b=fvWPlysLHjoqn3k2HWjB3lQfYBlXErlVlqvdloXLYLsAsVW5C9Fmm9x1RrhshPi63y DTpLxZCI6YLSzqYc4Hp0cOMoh3j2xFfmCSVlw1PdfGceJuoSJUrZN077dAShcfsgrG5R H2yfyGF77NBDcNzrASqIbCgQlKjAJtYIg/zgJKAQEVOsFiyb8TuuYDWiewP7NbcnQt6S 15aKnBaEL659PFsitKdHZ7sNDhWKLJj1SXHD/SYPzslMTCAIEwDfzbZWERccgvb/KFkF qcz88zz9Ky0BCnPrCwC6Oa9J3FfCexnyjhBALAM13DwoI5QhoGy3yIboZBSCQgEWD3kI UIjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gXAWs6d2; 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 f2si15628549pgl.74.2019.07.23.19.32.37; Tue, 23 Jul 2019 19:32:53 -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=@google.com header.s=20161025 header.b=gXAWs6d2; 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 S2392038AbfGWVYs (ORCPT + 99 others); Tue, 23 Jul 2019 17:24:48 -0400 Received: from mail-pl1-f202.google.com ([209.85.214.202]:56492 "EHLO mail-pl1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731769AbfGWVYr (ORCPT ); Tue, 23 Jul 2019 17:24:47 -0400 Received: by mail-pl1-f202.google.com with SMTP id o6so22734065plk.23 for ; Tue, 23 Jul 2019 14:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=ds+yDlyVjybdin7f83dyTCd0MUOnW1rqJpaXINk50aY=; b=gXAWs6d2vlg5BYWrnPRZwakEFntdJVkTe2aKhDwU216RDblqMWjy0Qs40H075C/NuS kztEgi0juyk1ocSdIn6Mj3Uh5VsdGEuKaJMiqhLYTLC+hGPHfmILvhece/gb8Kn1ZSM8 sJcF/uITqnLsw8glV/BmivbZ0zgMPgYuxS9QZ3hjgC+Mxk5WVQS4aF7OTT/fs8IZOb4v R3zc2ks9rcV3MaxCgiNa9cqUjMvOeQWgsytHTXv7THgoVmnvQhfH7mE4iytWW74xOHz2 Hj18LQIEP6jOmEPouijbybHC/RMmH08o3G5rhJ1F/Kpy4llOsgrP8K6hKiH0cweJnXZ+ IyXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=ds+yDlyVjybdin7f83dyTCd0MUOnW1rqJpaXINk50aY=; b=OxrIKr5P7AF3A2a/GnQXeUX91uqNjfAQatseeKHc48Tu+/FNzlhYr/PTaKUR23etaC LR77Z/NRQPdvuG6OYSXQx86qn4CSoi4fB6OrpLbW3cx0ymdjNCrCpyaPKgIs2Q6yENT1 LA2hRlGtFghMe0gn2sJNUOVvB6HydW1nD/rP5RyAbyicdTa4jP7eNjos83zbEBSyRRHK nGdmJI3Dys2QFIfNGCXRfFRbukyi9wPVZu/HCYqw0RqfeRceqblBXVYlsFvlVSI9utNk QTtvnBoAC0DUz+M7ujdvb9C09Fm2qdnQt7bqmSBV8CMTgqJoj/XS6UoG9gAcDHSnNk47 RMWw== X-Gm-Message-State: APjAAAWLHjeeJUMDmlKGL8UasM4FK8g2KMxUpm4SBviZeVmuqQv4m27O W+WkTT4SOCchNRTgGqnVYyQLqO+ZRmPsmLGP3Ns= X-Received: by 2002:a65:6448:: with SMTP id s8mr78700016pgv.223.1563917086436; Tue, 23 Jul 2019 14:24:46 -0700 (PDT) Date: Tue, 23 Jul 2019 14:24:12 -0700 In-Reply-To: <20190723212418.36379-1-ndesaulniers@google.com> Message-Id: <20190723212418.36379-3-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190723212418.36379-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.22.0.709.g102302147b-goog Subject: [PATCH v3 0/2] Support kexec/kdump for clang built kernel From: Nick Desaulniers To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de Cc: peterz@infradead.org, clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org, yamada.masahiro@socionext.com, Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 1. Reuse the implementation of memcpy and memset instead of relying on __builtin_memcpy and __builtin_memset as it causes infinite recursion in Clang (at any opt level) or GCC at -O2. 2. Don't reset KBUILD_CFLAGS, rather filter CONFIG_FUNCTION_TRACER, CONFIG_STACKPROTECTOR, and CONFIG_STACKPROTECTOR_STRONG flags via `CFLAGS_REMOVE_.o' A good test of this series (besides boot testing a kexec kernel): * There should be no undefined symbols in arch/x86/purgatory/purgatory.ro: $ nm arch/x86/purgatory/purgatory.ro particularly `warn`, `bcmp`, `__stack_chk_fail`, `memcpy` or `memset`. * `-pg`, `-fstack-protector`, `-fstack-protector-strong` should not be added to the command line for the c source files under arch/x86/purgatory/ when compiling with CONFIG_FUNCTION_TRACER=y, CONFIG_STACKPROTECTOR=y, and CONFIG_STACKPROTECTOR_STRONG=y. V3 of: https://groups.google.com/forum/#!msg/clang-built-linux/GzThkAkZqqI/J727I6vpBwAJ Nick Desaulniers (2): x86/purgatory: do not use __builtin_memcpy and __builtin_memset x86/purgatory: use CFLAGS_REMOVE rather than reset KBUILD_CFLAGS arch/x86/boot/string.c | 7 +++++++ arch/x86/purgatory/Makefile | 29 ++++++++++++++++++++++++----- arch/x86/purgatory/purgatory.c | 6 ++++++ arch/x86/purgatory/string.c | 23 ----------------------- 4 files changed, 37 insertions(+), 28 deletions(-) delete mode 100644 arch/x86/purgatory/string.c -- 2.22.0.709.g102302147b-goog