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=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,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 60DCEC433F5 for ; Sat, 18 Sep 2021 04:35:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 282BA61212 for ; Sat, 18 Sep 2021 04:35:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233232AbhIREhN (ORCPT ); Sat, 18 Sep 2021 00:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231951AbhIREhM (ORCPT ); Sat, 18 Sep 2021 00:37:12 -0400 Received: from mail-vs1-xe2f.google.com (mail-vs1-xe2f.google.com [IPv6:2607:f8b0:4864:20::e2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAEABC061574; Fri, 17 Sep 2021 21:35:49 -0700 (PDT) Received: by mail-vs1-xe2f.google.com with SMTP id p24so11447266vsg.0; Fri, 17 Sep 2021 21:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kmFmDpG2OT8NIyYat6UuNAoWRRZJuzBIzLpZ1l0xRDc=; b=Vv6GvD5xs/0pWNwALj7JUXxMMQCj6I6NNpRGiWms3i7Lxg4gNUwuYf+9w+PJbYchLU BgE5EAIWWrTmWtRoni4QaB2QAs93CX7qnyAZvPk6VR9TTYvnDSEie+qz6A5Fe1rsawzS L5i+6mUR1Mn+0SHUBwRis5i7SLhoPgHVZQjqRvuK4ugeikbf/Ub+LTLydYnyZ9OJngoF lG2id4WF+2FnWjNgfIbGlZY829wg3xfvx5LmWQq1aBOwjgnRoyAdUSA5g2f7NVNxW+NF bcff80rQldc7UucNaP9ng0to6VWZyJLRPuUgkkz4Hah2DsTQehaUePjBbL7ahdmzDe7t dPeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kmFmDpG2OT8NIyYat6UuNAoWRRZJuzBIzLpZ1l0xRDc=; b=Uj+wtIW/FfLcGcCmtLM1HsPNDLs3Qh0J+0PjbNgv69/hqxAoGUdz9Md/7UnCnEhhyl BoOWfQ0vFW5JtyOvM/oQtQcC+6iuupL87lTCFpNWZA+zsxwpmux66UyiHh6YMbaKl0yR QRnBdruON2sETo6bT0geU8SL0APglR4AH2dkeGqYLGKxynNnosCKO5En8OUpJYln/ymw v5oDGYyihkw/t4Hp963MNNAxhwWwQ+Y3thd2tWAAefJ0pvFHk5XW0vZk23bxtsoQI3VV Fax2dk/lL456PCHchBWEQeT9sAnB5ItK4CrnBBkoDIU64cOF0M2BiZ5SYJ/pnxSEScrq zAwA== X-Gm-Message-State: AOAM53019gZP7DP6lyoiz2Nk3J/MckFURfrhSabITlz6o+gKfUhQsjfm 1lKsuZxA0PHvY262xLFs+o3GcCOXyabeBOjEcwA= X-Google-Smtp-Source: ABdhPJwV/re0vC2swikaJ0cZG1g3JXe4J21iHG1HhaSIOmr/RfbH1EynzSHUKOfd8ubiL9IILipvvJ3h8DzSTwZJC4c= X-Received: by 2002:a67:ee12:: with SMTP id f18mr11733970vsp.20.1631939748966; Fri, 17 Sep 2021 21:35:48 -0700 (PDT) MIME-Version: 1.0 References: <20210917035736.3934017-1-chenhuacai@loongson.cn> <20210917035736.3934017-6-chenhuacai@loongson.cn> In-Reply-To: From: Huacai Chen Date: Sat, 18 Sep 2021 12:35:37 +0800 Message-ID: Subject: Re: [PATCH V3 05/22] LoongArch: Add build infrastructure To: Arnd Bergmann Cc: Huacai Chen , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , linux-arch , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Xuefeng Li , Yanteng Si , Jiaxun Yang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org Hi, Arnd, On Fri, Sep 17, 2021 at 3:53 PM Arnd Bergmann wrote: > > On Fri, Sep 17, 2021 at 5:57 AM Huacai Chen > wrote:> --- /dev/null > > +++ b/arch/loongarch/.gitignore > > @@ -0,0 +1,9 @@ > > +*.lds > > +*.raw > > +calc_vmlinuz_load_addr > > +elf-entry > > +relocs > > +vmlinux.* > > +vmlinuz.* > > + > > +!kernel/vmlinux.lds.S > > Can you double-check that 'make clean' and/or 'make mrproper' remove all the > generated files? This may already be the case, but I don't see how this is > done in your Makefile The files listed in .gitignore are not generated by the current series (except vmlinux, but it is cleaned, of course). Most of them are generated by the zboot patch (not in this series). So, should I keep the .gitignore file as is, or remove it at present? > > > + > > +choice > > + prompt "Page Table Layout" > > + default 16KB_2LEVEL if 32BIT > > + default 16KB_3LEVEL if 64BIT > > + help > > + Allows choosing the page table layout, which is a combination > > + of page size and page table levels. The virtual memory address > > + space bits are determined by the page table layout. > > + > > +config 4KB_3LEVEL > > + bool "4KB with 3 levels" > > + select PAGE_SIZE_4KB > > + select PGTABLE_3LEVEL > > + help > > + This option selects 4KB page size with 3 level page tables, which > > + support a maximum 39 bits of application virtual memory. > > + ... > > Nice, this choice statement looks a lot better than the version you had before. > > > + > > +cflags-y += -ffreestanding > > I had not noticed this previously, but I think this should not be used here, > as -ffreestanding disables a number of optimizations for compiler builtins. > > Did you just copy this from MIPS or do you have a particular reason this > is used here? If we use zboot (compressed kernel), there are some conflicting if without -ffrestanding. E.g., the built-in malloc() conflicts with the one defined in ./include/linux/decompress/mm.h. > > > +# Some distribution-specific toolchains might pass the -fstack-check > > +# option during the build, which adds a simple stack-probe at the beginning > > +# of every function. This stack probe is to ensure that there is enough > > +# stack space, else a SEGV is generated. This is not desirable for LoongArch > > +# as kernel stacks are small, placed in unmapped virtual memory, and do not > > +# grow when overflowed. > > +# > > +cflags-y += -fno-stack-check > > This is already set in the global Makefile and can be removed as well OK, this will be removed. > > > +cflags-y += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) > > +cflags-y += -U_LOONGARCH_ISA -D_LOONGARCH_ISA=_LOONGARCH_ISA_LOONGARCH64 > > + > > +load-y = 0x9000000000200000 > > + > > +drivers-$(CONFIG_PCI) += arch/loongarch/pci/ > > + > > +KBUILD_AFLAGS += $(cflags-y) > > +KBUILD_CFLAGS += $(cflags-y) > > +KBUILD_CPPFLAGS += -DVMLINUX_LOAD_ADDRESS=$(load-y) > > + > > +bootvars-y = VMLINUX_LOAD_ADDRESS=$(load-y) PLATFORM="$(platform-y)" > > I would argue that VMLINUX_LOAD_ADDRESS should not be configurable > here, instead all kernels should use the same value. VMLINUX_LOAD_ADDRESS is not configurable, it is also used by the later zboot patch (use VMLINUX_LOAD_ADDRESS to calculate the load address of vmlinuz). > > > diff --git a/arch/loongarch/include/asm/Kbuild b/arch/loongarch/include/asm/Kbuild > > new file mode 100644 > > index 000000000000..41a76e675321 > > --- /dev/null > > +++ b/arch/loongarch/include/asm/Kbuild > > @@ -0,0 +1,31 @@ > > +# SPDX-License-Identifier: GPL-2.0 > > +generic-y += dma-contiguous.h > > +generic-y += export.h > > +generic-y += mcs_spinlock.h > > +generic-y += parport.h > > +generic-y += early_ioremap.h > > +generic-y += qrwlock.h > > +generic-y += qspinlock.h > > The list is apparently from an older kernel and no longer needed for > files that are listed in include/asm-generic/Kbuild. > > Please only list the files that are not already there. Emmm, I have checked include/asm-generic/Kbuild and no duplication, but I've found a self duplication (rwsem.h), thanks. Huacai > > Arnd