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=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=ham 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 39ACFC4338F for ; Tue, 17 Aug 2021 17:58:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 103BB61038 for ; Tue, 17 Aug 2021 17:58:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232470AbhHQR71 (ORCPT ); Tue, 17 Aug 2021 13:59:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbhHQR70 (ORCPT ); Tue, 17 Aug 2021 13:59:26 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31ECBC061764 for ; Tue, 17 Aug 2021 10:58:52 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id i28so16248197lfl.2 for ; Tue, 17 Aug 2021 10:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jPB5XR4EZE+ryoBMzfC592JqQnRRPIK/l+bH1/q+ypg=; b=g6DRAZ7fttfTmAEadrmjEFAP2o7eAlIKLHw0OwNPJ6hokoxN5yt6XK58EmD28xcS48 Uwqj2+HbVeS8hnfrDeIw093dCNqhk5NnM5cV8ddYFJmCPHf8ngnoeDWN27prPQPJYuUN yN4dp1t1E55YQFwCderI9F5HVLceFAJ1F4lQZR22WXiH409I5wVyeJbPhWDIiXBPEgbX /xSsi+2wialTJGyKp8+TV8qKRNuWre5wbZ/LN8Aeyu3eB2v5cmdSWEWQSbHqjTCa2g/W Ni1WRWL16QjnnQKZCxpdJpOziEorje9StA76rLLXf6zFeRCwIg0g73mWN37oYJBwgdd3 L1OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jPB5XR4EZE+ryoBMzfC592JqQnRRPIK/l+bH1/q+ypg=; b=M73Gl/lMi8Z/JIgUPoGcE+awmVbo4XZ14Dzh5MPGrxItEpyo63foI3aVFY7yixhar8 0J+zCpy5r2wgP9avU9Btbgup6GVW82wItHaMqoyFG+zlBk4nOVJoHtMiA4hVT8781ZLF Gh+rDq9i1enLoCSVau8SFi3Ln65MbFrj9AlA4tdS7lqZUKJSyzTqECkSmGrqyCJdd4wt mFFmdWCEJ6AD0DBlsYC1ikpwfihCyNUq+Bx92ZFy5wymbgpBQ9dWLwW8Ec4UGMXkQcMF 8ZxkWdll9TgiVxk5mXm00NCI4IjUQSW9I6MjDvWlZIlAbJeBWuJCi0ai8IsDVd/nSXmf U0Jg== X-Gm-Message-State: AOAM531ABeM/lvkhtXqBuhJe+sYu3QLEoyi9g7wdaRt8mGklWC8HrjDw Libu5nctDSssFg3QEY4o//C6hMbZwiPbQjNjyaP+mg== X-Google-Smtp-Source: ABdhPJxVUlGuGbwSaSO8q8+rFRfEzz2A+JkKK3IosopyTguc0Ka1OpJQV89/dwXKa8egSHBGOr9MmEYojyPzmWIqDsM= X-Received: by 2002:a19:f017:: with SMTP id p23mr3274062lfc.547.1629223130100; Tue, 17 Aug 2021 10:58:50 -0700 (PDT) MIME-Version: 1.0 References: <269701460.117528.1629210189833@office.mailbox.org> In-Reply-To: <269701460.117528.1629210189833@office.mailbox.org> From: Nick Desaulniers Date: Tue, 17 Aug 2021 10:58:39 -0700 Message-ID: Subject: Re: [PATCH 1/2] x86, Makefile: Move the CPU-specific 64-bit tuning settings to arch/x86/Makefile.cpu To: torvic9@mailbox.org Cc: "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "clang-built-linux@googlegroups.com" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Masahiro Yamada Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tor, Thanks for the patches. One thing I always try to do is use ./scripts/get_maintainer.pl to get the appropriate maintainers and reviewers cc'ed. I prefer to explicitly put the maintainers that I expect to pick up a patch in the To: line. $ ./scripts/get_maintainer.pl arch/x86/Makefile -norolestats Thomas Gleixner Ingo Molnar Borislav Petkov x86@kernel.org "H. Peter Anvin" Nathan Chancellor Nick Desaulniers linux-kernel@vger.kernel.org clang-built-linux@googlegroups.com added them to CC. Probably needs a refresh at this point, but https://nickdesaulniers.github.io/blog/2017/05/16/submitting-your-first-patch-to-the-linux-kernel-and-responding-to-feedback/ is still mostly relevant. On Tue, Aug 17, 2021 at 7:23 AM torvic9 via Clang Built Linux wrote: > > In accordance with the FIXME comment in arch/x86/Makefile, move the > CPU-specific 64-bit tuning settings to arch/x86/Makefile.cpu. > > Signed-off-by: Tor Vic > --- > arch/x86/Makefile | 11 ++--------- > arch/x86/Makefile.cpu | 12 ++++++++++++ > 2 files changed, 14 insertions(+), 9 deletions(-) > create mode 100644 arch/x86/Makefile.cpu > > diff --git a/arch/x86/Makefile b/arch/x86/Makefile > index 307fd0000a83..94105d7ad22c 100644 > --- a/arch/x86/Makefile > +++ b/arch/x86/Makefile > @@ -119,15 +119,8 @@ else > # Use -mskip-rax-setup if supported. > KBUILD_CFLAGS += $(call cc-option,-mskip-rax-setup) > > - # FIXME - should be integrated in Makefile.cpu (Makefile_32.cpu) > - cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) > - cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona) > - > - cflags-$(CONFIG_MCORE2) += \ > - $(call cc-option,-march=core2,$(call cc-option,-mtune=generic)) > - cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \ > - $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic)) > - cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic) > + # CPU-specific tuning (64-bit). > + include arch/x86/Makefile.cpu So we have arch/x86/Makefile_32.cpu, would it be more symmetrical to have a new arch/x86/Makefile_64.cpu (rather than Makefile.cpu)? > KBUILD_CFLAGS += $(cflags-y) > > KBUILD_CFLAGS += -mno-red-zone > diff --git a/arch/x86/Makefile.cpu b/arch/x86/Makefile.cpu > new file mode 100644 > index 000000000000..fb407ae94d90 > --- /dev/null > +++ b/arch/x86/Makefile.cpu > @@ -0,0 +1,12 @@ > +# SPDX-License-Identifier: GPL-2.0 > +# CPU tuning section (64-bit) - shared with UML. > +# Must change only cflags-y (or [yn]), not CFLAGS! That makes a difference for UML. > + > +cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8) > +cflags-$(CONFIG_MPSC) += $(call cc-option,-march=nocona) > + > +cflags-$(CONFIG_MCORE2) += \ > + $(call cc-option,-march=core2,$(call cc-option,-mtune=generic)) > +cflags-$(CONFIG_MATOM) += $(call cc-option,-march=atom) \ > + $(call cc-option,-mtune=atom,$(call cc-option,-mtune=generic)) > +cflags-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=generic) I was going to say we probably don't want to limit -mtune=genric to 64b only, but it seems that arch/x86/Makefile_32.cpu has some duplication here. 47 cflags-$(CONFIG_X86_GENERIC) += $(call tune,generic,$(call tune,i686)) That probably could be hoisted back into arch/x86/Makefile before the CONFIG_X86_32 check, but I'm not sure about the differences between CONFIG_GENERIC_CPU vs CONFIG_X86_GENERIC? -- Thanks, ~Nick Desaulniers