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=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 2BA4DCA9EB9 for ; Thu, 24 Oct 2019 01:48:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6D7D20650 for ; Thu, 24 Oct 2019 01:48:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="ofNboEQU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407717AbfJXBsI (ORCPT ); Wed, 23 Oct 2019 21:48:08 -0400 Received: from conssluserg-04.nifty.com ([210.131.2.83]:17634 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726925AbfJXBsH (ORCPT ); Wed, 23 Oct 2019 21:48:07 -0400 Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com [209.85.222.52]) (authenticated) by conssluserg-04.nifty.com with ESMTP id x9O1m38r025121 for ; Thu, 24 Oct 2019 10:48:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com x9O1m38r025121 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1571881684; bh=Pg0PBlnvPGzMa1Lyb7SgzTssmkI1SxEtJ6FEB1T4F30=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ofNboEQUqp9lsgicKTvUAhaI7rxygS4zx6c0oGCexmwGMPEnMQ2X2tFyof+S6L0J6 v0OmQrC6FYcrzKSBR3CwB375LfzIrrpjUdons4tKy3jNeXm/SD874D9IsRl4EWrzNp AjNjFCpTMcSsJCfcmcotwgHuxmfSEPWVX5uHhVjI3yoONOKjO0dL6pnEoKFQdXWHLL vpvhZaeulMcrd9JVnoaJWAOwCMbJzvw7ZD38JJ4c0m6AOkpSah3shwoWHWn0wGLBTf X7yYyHqp8S9OjAFYIPhc3QrG0AUr7iQoh/FqYciJRtC/TCAFmaJckK+MB/dxA7Z62/ xXXczs18i3CRA== X-Nifty-SrcIP: [209.85.222.52] Received: by mail-ua1-f52.google.com with SMTP id m21so6646308ual.13 for ; Wed, 23 Oct 2019 18:48:03 -0700 (PDT) X-Gm-Message-State: APjAAAXqhaCeoxRxgc0ESYmXbVgvVDmaSK8YOZsPnBkTEgPL8U/ThyJv UBXyk4V19NPdvI6B139gWmYTcC15+3sk/qZyUZ4= X-Google-Smtp-Source: APXvYqx1CqHmDEr3VPRqLGPoMM6fTlsUos2Z4E1CXGQPNl+XNURVhKBiM/jscveAYlAHmW9WHc6ytxEH92P8yvA+VtU= X-Received: by 2002:a9f:3e81:: with SMTP id x1mr7475449uai.121.1571881682588; Wed, 23 Oct 2019 18:48:02 -0700 (PDT) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20191018161033.261971-7-samitolvanen@google.com> <20191022162826.GC699@lakrids.cambridge.arm.com> In-Reply-To: From: Masahiro Yamada Date: Thu, 24 Oct 2019 10:47:26 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 06/18] add support for Clang's Shadow Call Stack (SCS) To: Sami Tolvanen Cc: Mark Rutland , Will Deacon , Catalin Marinas , Steven Rostedt , Ard Biesheuvel , Dave Martin , Kees Cook , Laura Abbott , Nick Desaulniers , clang-built-linux , Kernel Hardening , linux-arm-kernel , LKML 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 On Thu, Oct 24, 2019 at 1:59 AM Sami Tolvanen wrote: > > On Tue, Oct 22, 2019 at 9:28 AM Mark Rutland wrote: > > I think it would be preferable to follow the example of CC_FLAGS_FTRACE > > so that this can be filtered out, e.g. > > > > ifdef CONFIG_SHADOW_CALL_STACK > > CFLAGS_SCS := -fsanitize=shadow-call-stack > > KBUILD_CFLAGS += $(CFLAGS_SCS) > > export CC_FLAGS_SCS > > endif > > > > ... with removal being: > > > > CFLAGS_REMOVE := $(CC_FLAGS_SCS) > > > > ... or: > > > > CFLAGS_REMOVE_obj.o := $(CC_FLAGS_SCS) > > > > That way you only need to define the flags once, so the enable and > > disable falgs remain in sync by construction. > > CFLAGS_REMOVE appears to be only implemented for objects, which means > there's no convenient way to filter out flags for everything in > arch/arm64/kvm/hyp, for example. I could add a CFLAGS_REMOVE > separately for each object file, or we could add something like > ccflags-remove-y to complement ccflags-y, which should be relatively > simple. Masahiro, do you have any suggestions? I am fine with 'ccflags-remove-y'. Thanks. -- Best Regards Masahiro Yamada 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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 8B3CDCA9EB9 for ; Thu, 24 Oct 2019 01:48:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4DC1A20650 for ; Thu, 24 Oct 2019 01:48:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Xj//KgEM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="ofNboEQU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4DC1A20650 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=94NcaNhxhvaYgWd3TYI8/5OUlL5aJNmevY7ARtvH4ic=; b=Xj//KgEMWLK+/U dU8gXPxnkqIAY6wFKEsCECPt8HJQhS64aZDS8WY2lnXRxgV7GGSBHXNQwLGfSCt9eGZ8Y/M7UT2z5 s6A1dNH47gILdY8UuCvEjOzJ3L7sC4yPyTWihKkmZyr1c/UBoXY2QGzn7sdTjE4VNC1HJhmLyeQQ0 pujIRcmKtd87epZfP0C6JO7BAbWTb+/qc3xBoFeBBWMh/OCS5T+UFKYn4cdkNHajF9PQex+jeWwaT rAffcOQxg6e6OtRyZph/2phW8pBEp8GdTIKd7OeOEzPRn6JjVULUnfh7Wb1dgsLb5cC1h8PzJ23rB eX+5ziBH6waSk8Yt44qA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNSEf-0007vT-3l; Thu, 24 Oct 2019 01:48:21 +0000 Received: from conssluserg-06.nifty.com ([210.131.2.91]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iNSEb-0007uO-C4 for linux-arm-kernel@lists.infradead.org; Thu, 24 Oct 2019 01:48:19 +0000 Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) (authenticated) by conssluserg-06.nifty.com with ESMTP id x9O1m3vt024550 for ; Thu, 24 Oct 2019 10:48:03 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com x9O1m3vt024550 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1571881684; bh=Pg0PBlnvPGzMa1Lyb7SgzTssmkI1SxEtJ6FEB1T4F30=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ofNboEQUqp9lsgicKTvUAhaI7rxygS4zx6c0oGCexmwGMPEnMQ2X2tFyof+S6L0J6 v0OmQrC6FYcrzKSBR3CwB375LfzIrrpjUdons4tKy3jNeXm/SD874D9IsRl4EWrzNp AjNjFCpTMcSsJCfcmcotwgHuxmfSEPWVX5uHhVjI3yoONOKjO0dL6pnEoKFQdXWHLL vpvhZaeulMcrd9JVnoaJWAOwCMbJzvw7ZD38JJ4c0m6AOkpSah3shwoWHWn0wGLBTf X7yYyHqp8S9OjAFYIPhc3QrG0AUr7iQoh/FqYciJRtC/TCAFmaJckK+MB/dxA7Z62/ xXXczs18i3CRA== X-Nifty-SrcIP: [209.85.222.48] Received: by mail-ua1-f48.google.com with SMTP id n41so6670665uae.2 for ; Wed, 23 Oct 2019 18:48:03 -0700 (PDT) X-Gm-Message-State: APjAAAWLUmky607WCCBSTE1HrFSetj3DPImtX5zSyQDAFlQvFWrR2NeH YA+UytNPFoKlneIZT9rCTevhMeZ8XOXwFTm9rr4= X-Google-Smtp-Source: APXvYqx1CqHmDEr3VPRqLGPoMM6fTlsUos2Z4E1CXGQPNl+XNURVhKBiM/jscveAYlAHmW9WHc6ytxEH92P8yvA+VtU= X-Received: by 2002:a9f:3e81:: with SMTP id x1mr7475449uai.121.1571881682588; Wed, 23 Oct 2019 18:48:02 -0700 (PDT) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20191018161033.261971-7-samitolvanen@google.com> <20191022162826.GC699@lakrids.cambridge.arm.com> In-Reply-To: From: Masahiro Yamada Date: Thu, 24 Oct 2019 10:47:26 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 06/18] add support for Clang's Shadow Call Stack (SCS) To: Sami Tolvanen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191023_184817_631839_46B461C2 X-CRM114-Status: GOOD ( 14.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kees Cook , Ard Biesheuvel , Catalin Marinas , Kernel Hardening , Nick Desaulniers , LKML , Steven Rostedt , clang-built-linux , Laura Abbott , Will Deacon , Dave Martin , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 24, 2019 at 1:59 AM Sami Tolvanen wrote: > > On Tue, Oct 22, 2019 at 9:28 AM Mark Rutland wrote: > > I think it would be preferable to follow the example of CC_FLAGS_FTRACE > > so that this can be filtered out, e.g. > > > > ifdef CONFIG_SHADOW_CALL_STACK > > CFLAGS_SCS := -fsanitize=shadow-call-stack > > KBUILD_CFLAGS += $(CFLAGS_SCS) > > export CC_FLAGS_SCS > > endif > > > > ... with removal being: > > > > CFLAGS_REMOVE := $(CC_FLAGS_SCS) > > > > ... or: > > > > CFLAGS_REMOVE_obj.o := $(CC_FLAGS_SCS) > > > > That way you only need to define the flags once, so the enable and > > disable falgs remain in sync by construction. > > CFLAGS_REMOVE appears to be only implemented for objects, which means > there's no convenient way to filter out flags for everything in > arch/arm64/kvm/hyp, for example. I could add a CFLAGS_REMOVE > separately for each object file, or we could add something like > ccflags-remove-y to complement ccflags-y, which should be relatively > simple. Masahiro, do you have any suggestions? I am fine with 'ccflags-remove-y'. Thanks. -- Best Regards Masahiro Yamada _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel