All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Huacai Chen <chenhuacai@gmail.com>
Cc: Huacai Chen <chenhuacai@loongson.cn>,
	Arnd Bergmann <arnd@arndb.de>, 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>,
	LKML <linux-kernel@vger.kernel.org>,
	Xuefeng Li <lixuefeng@loongson.cn>,
	Yanteng Si <siyanteng@loongson.cn>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	linux-efi <linux-efi@vger.kernel.org>
Subject: Re: [PATCH V6 09/22] LoongArch: Add boot and setup routines
Date: Mon, 7 Mar 2022 19:37:14 +0200	[thread overview]
Message-ID: <YiZCypeuJ+0FCJ+w@kernel.org> (raw)
In-Reply-To: <CAAhV-H6z3H3QbzvG6=fgVJF1z2qEvKVGnyqb--bkqomH3jTXJQ@mail.gmail.com>

Hi,

On Fri, Mar 04, 2022 at 08:43:03PM +0800, Huacai Chen wrote:
> Hi, Mike,
> 
> On Fri, Mar 4, 2022 at 6:49 PM Mike Rapoport <rppt@kernel.org> wrote:
> >
> > Hi,
> >
> >
> > So ideally, the physical memory detection and registration should follow
> > something like:
> >
> > * memblock_reserve() the memory used by firmware, kernel and initrd
> > * detect NUMA topology
> > * add memory regions along with their node ids to memblock.
> >
> > s390::setup_arch() is a good example of doing early reservations:
> >
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/s390/kernel/setup.c#n988
> I have a fast reading of S390, and I think we can do some adjust:
> 1, call memblock_set_node(0, ULONG_MAX, &memblock.memory, 0) in
> early_memblock_init().
> 2, move memblock_reserve(PHYS_OFFSET, 0x200000) and
> memblock_reserve(__pa_symbol(&_text), __pa_symbol(&_end) -
> __pa_symbol(&_text)) to early_memblock_init().
> 3, Reserve initrd memory in the first place.
> It is nearly the same as the S390, then.

It does not have to look like the same as s390 :)
The important thing is to reserve all the memory before memblock
allocations are possible. 

> > > > > +early_param("memmap", early_parse_memmap);
> > > >
> > > > The memmap= processing is a hack indented to workaround bugs in firmware
> > > > related to the memory detection. Please don't copy if over unless there is
> > > > really strong reason.
> > >
> > > Hmmm, I have read the documents, most archs only support mem=limit,
> > > but MIPS support mem=limit@base. memmap not only supports
> > > memmap=limit@base, but also a lot of advanced syntax. LoongArch needs
> > > both limit and limit@base syntax. So can we make our code to support
> > > only mem=limit and memmap=limit@base, and remove all other syntax
> > > here?
> >
> > The documentation describes what was there historically and both these
> > options tend not to play well with complex memory layouts.
> >
> > If you must have them it's better to use x86 as an example rather than
> > MIPS, just take into the account that on x86 memory always starts from 0,
> > so they never needed to have a different base.
> >
> > For what use-cases LoongArch needs options?
>
> The use-case of limit@base syntax is kdump, because our kernel is not
> relocatable. I'll use X86 as an example.

I missed that mem= can be used several times, so with MIPS implementation
it's possible to define something like "mem=limit0@base0 mem=limit1@base1"
and this will create two contiguous memory regions.
 
> Huacai

-- 
Sincerely yours,
Mike.

  reply	other threads:[~2022-03-07 17:37 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26 11:03 [PATCH V6 00/22] arch: Add basic LoongArch support Huacai Chen
2022-02-26 11:03 ` [PATCH V6 01/22] Documentation: LoongArch: Add basic documentations Huacai Chen
2022-02-26 11:03 ` [PATCH V6 02/22] Documentation/zh_CN: Add basic LoongArch documentations Huacai Chen
2022-02-26 11:03 ` [PATCH V6 03/22] LoongArch: Add elf-related definitions Huacai Chen
2022-02-26 11:03 ` [PATCH V6 04/22] LoongArch: Add writecombine support for drm Huacai Chen
2022-02-26 11:03 ` [PATCH V6 05/22] LoongArch: Add build infrastructure Huacai Chen
2022-02-26 11:03 ` [PATCH V6 06/22] LoongArch: Add CPU definition headers Huacai Chen
2022-02-26 11:03 ` [PATCH V6 07/22] LoongArch: Add atomic/locking headers Huacai Chen
2022-02-26 11:03 ` [PATCH V6 08/22] LoongArch: Add other common headers Huacai Chen
2022-02-26 11:03 ` [PATCH V6 09/22] LoongArch: Add boot and setup routines Huacai Chen
2022-02-27 14:14   ` Ard Biesheuvel
2022-02-27 16:40     ` Greg Kroah-Hartman
2022-02-28  6:34       ` Huacai Chen
2022-02-28  8:09         ` Ard Biesheuvel
2022-02-28  8:38           ` Huacai Chen
2022-02-28  8:51             ` Ard Biesheuvel
2022-02-28 10:42               ` Huacai Chen
2022-02-28 11:24                 ` Arnd Bergmann
2022-02-28 11:35                   ` Ard Biesheuvel
2022-03-01  4:17                     ` Huacai Chen
2022-03-01 10:18                       ` Arnd Bergmann
2022-03-02  8:56                         ` Huacai Chen
2022-03-02  8:58                           ` Ard Biesheuvel
2022-03-02  9:20                             ` Huacai Chen
2022-03-03  7:26                               ` Huacai Chen
2022-03-03  9:54                                 ` Ard Biesheuvel
2022-03-04 10:23                                   ` Huacai Chen
2022-03-03 11:41   ` Mike Rapoport
2022-03-03 14:47     ` Huacai Chen
2022-03-04 10:49       ` Mike Rapoport
2022-03-04 12:43         ` Huacai Chen
2022-03-07 17:37           ` Mike Rapoport [this message]
2022-03-08  5:01             ` Huacai Chen
2022-02-26 11:03 ` [PATCH V6 10/22] LoongArch: Add exception/interrupt handling Huacai Chen
2022-02-26 11:03 ` [PATCH V6 11/22] LoongArch: Add process management Huacai Chen
2022-02-26 11:03 ` [PATCH V6 12/22] LoongArch: Add memory management Huacai Chen
2022-03-03 16:16   ` Mike Rapoport
2022-03-04 10:12     ` Huacai Chen
2022-02-26 11:03 ` [PATCH V6 13/22] LoongArch: Add system call support Huacai Chen
2022-02-26 11:03 ` [PATCH V6 14/22] LoongArch: Add signal handling support Huacai Chen
2022-02-26 11:03 ` [PATCH V6 15/22] LoongArch: Add elf and module support Huacai Chen
2022-02-26 11:03 ` [PATCH V6 16/22] LoongArch: Add misc common routines Huacai Chen
2022-02-26 11:03 ` [PATCH V6 17/22] LoongArch: Add some library functions Huacai Chen
2022-02-26 11:03 ` [PATCH V6 18/22] LoongArch: Add PCI controller support Huacai Chen
2022-02-26 11:03 ` [PATCH V6 19/22] LoongArch: Add VDSO and VSYSCALL support Huacai Chen
2022-02-26 11:03 ` [PATCH V6 20/22] LoongArch: Add multi-processor (SMP) support Huacai Chen
2022-02-26 11:03 ` [PATCH V6 21/22] LoongArch: Add Non-Uniform Memory Access (NUMA) support Huacai Chen
2022-02-26 11:03 ` [PATCH V6 22/22] LoongArch: Add Loongson-3 default config file Huacai Chen

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=YiZCypeuJ+0FCJ+w@kernel.org \
    --to=rppt@kernel.org \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=chenhuacai@gmail.com \
    --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-efi@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.