All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huacai Chen <chenhuacai@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Huacai Chen <chenhuacai@loongson.cn>,
	Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Airlie <airlied@linux.ie>, Jonathan Corbet <corbet@lwn.net>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Xuefeng Li <lixuefeng@loongson.cn>,
	Yanteng Si <siyanteng@loongson.cn>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: Re: [PATCH V3 05/22] LoongArch: Add build infrastructure
Date: Sat, 18 Sep 2021 12:35:37 +0800	[thread overview]
Message-ID: <CAAhV-H64VFFGARsrW+uZEwGHTJKoXG66E7-fCjN=0WVSZadwaw@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a0E3fRJU9VCRp7MQz-jBC0nHi1DwjPGtymEg3vJJoDqrg@mail.gmail.com>

Hi, Arnd,

On Fri, Sep 17, 2021 at 3:53 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Fri, Sep 17, 2021 at 5:57 AM Huacai Chen <chenhuacai@loongson.cn>
> 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

  reply	other threads:[~2021-09-18  4:35 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17  3:57 [PATCH V3 00/22] arch: Add basic LoongArch support Huacai Chen
2021-09-17  3:57 ` [PATCH V3 01/22] Documentation: LoongArch: Add basic documentations Huacai Chen
2021-09-23 20:37   ` Pavel Machek
2021-09-24  4:07     ` Huacai Chen
2021-09-23 20:59   ` Pavel Machek
2021-09-24  4:10     ` Huacai Chen
2021-09-24  6:58       ` Pavel Machek
2021-09-24  7:31         ` Huacai Chen
2021-09-17  3:57 ` [PATCH V3 02/22] Documentation/zh_CN: Add basic LoongArch documentations Huacai Chen
2021-09-17  3:57 ` [PATCH V3 03/22] LoongArch: Add elf-related definitions Huacai Chen
2021-09-17  3:57 ` [PATCH V3 04/22] LoongArch: Add writecombine support for drm Huacai Chen
2021-09-17  3:57 ` [PATCH V3 05/22] LoongArch: Add build infrastructure Huacai Chen
2021-09-17  7:53   ` Arnd Bergmann
2021-09-18  4:35     ` Huacai Chen [this message]
2021-09-17  3:57 ` [PATCH V3 06/22] LoongArch: Add CPU definition headers Huacai Chen
2021-09-17  3:57 ` [PATCH V3 07/22] LoongArch: Add atomic/locking headers Huacai Chen
2021-09-17  3:57 ` [PATCH V3 08/22] LoongArch: Add other common headers Huacai Chen
2021-09-17  3:57 ` [PATCH V3 09/22] LoongArch: Add boot and setup routines Huacai Chen
2021-09-17  8:11   ` Arnd Bergmann
2021-09-18  4:54     ` Huacai Chen
2021-09-17  3:57 ` [PATCH V3 10/22] LoongArch: Add exception/interrupt handling Huacai Chen
2021-09-17  3:57 ` [PATCH V3 11/22] LoongArch: Add process management Huacai Chen
2021-09-17  3:57 ` [PATCH V3 12/22] LoongArch: Add memory management Huacai Chen
2021-09-17  3:57 ` [PATCH V3 13/22] LoongArch: Add system call support Huacai Chen
2021-09-17  8:24   ` Arnd Bergmann
2021-09-18  6:55     ` Huacai Chen
2021-09-17  3:57 ` [PATCH V3 14/22] LoongArch: Add signal handling support Huacai Chen
2021-09-17  8:26   ` Arnd Bergmann
2021-09-17 21:10   ` Eric W. Biederman
2021-09-18  7:12     ` Huacai Chen
2021-09-19  9:58       ` Arnd Bergmann
2021-09-20  2:36         ` Huacai Chen
2021-09-20 21:14           ` Richard Henderson
2021-09-22  2:43             ` Huacai Chen
2021-09-17  3:57 ` [PATCH V3 15/22] LoongArch: Add elf and module support Huacai Chen
2021-09-17  8:28   ` Arnd Bergmann
2021-09-18  7:14     ` Huacai Chen
2021-09-17  3:57 ` [PATCH V3 16/22] LoongArch: Add misc common routines Huacai Chen
2021-09-17  6:10   ` Christoph Hellwig
2021-09-17  6:36     ` Huacai Chen
2021-09-17  3:57 ` [PATCH V3 17/22] LoongArch: Add some library functions Huacai Chen
2021-09-17  8:33   ` Arnd Bergmann
2021-09-18  7:16     ` Huacai Chen
2021-09-17  3:57 ` [PATCH V3 18/22] LoongArch: Add PCI controller support Huacai Chen
2021-09-17  9:02   ` Arnd Bergmann
2021-09-18  7:36     ` Huacai Chen
2021-09-21 22:36       ` Bjorn Helgaas
2021-09-22 15:33         ` Arnd Bergmann
2021-09-17  3:57 ` [PATCH V3 19/22] LoongArch: Add VDSO and VSYSCALL support Huacai Chen
2021-09-17  3:57 ` [PATCH V3 20/22] LoongArch: Add multi-processor (SMP) support Huacai Chen
2021-09-17  9:57   ` Arnd Bergmann
2021-09-18  7:22     ` Huacai Chen
2021-09-17  3:57 ` [PATCH V3 21/22] LoongArch: Add Non-Uniform Memory Access (NUMA) support Huacai Chen
2021-09-17  6:15   ` Christoph Hellwig
2021-09-17  6:40     ` Huacai Chen
2021-09-17  3:57 ` [PATCH V3 22/22] LoongArch: Add Loongson-3 default config file Huacai Chen
2021-09-17  9:59 ` [PATCH V3 00/22] arch: Add basic LoongArch support Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAhV-H64VFFGARsrW+uZEwGHTJKoXG66E7-fCjN=0WVSZadwaw@mail.gmail.com' \
    --to=chenhuacai@gmail.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=chenhuacai@loongson.cn \
    --cc=corbet@lwn.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --cc=siyanteng@loongson.cn \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.