From: Alan Kao <alankao@andestech.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Eric Lin <tesheng@andestech.com>, Borislav Petkov <bp@suse.de>,
Albert Ou <aou@eecs.berkeley.edu>,
Thomas Gleixner <tglx@linutronix.de>, <zong.li@sifive.com>,
<alex@ghiti.fr>,
David Abdurachmanov <david.abdurachmanov@gmail.com>,
Anup Patel <Anup.Patel@wdc.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Steven Price <steven.price@arm.com>, <atish.patra@wdc.com>,
<yash.shah@sifive.com>, "Palmer Dabbelt" <palmer@dabbelt.com>,
Greentime Hu <green.hu@gmail.com>, Gary Guo <gary@garyguo.net>,
Paul Walmsley <paul.walmsley@sifive.com>,
<linux-riscv@lists.infradead.org>,
Mike Rapoport <rppt@linux.ibm.com>,
"Logan Gunthorpe" <logang@deltatee.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 0/3] Highmem support for 32-bit RISC-V
Date: Wed, 8 Apr 2020 11:51:18 +0800 [thread overview]
Message-ID: <20200408035118.GA1451@andestech.com> (raw)
In-Reply-To: <CAK8P3a3LokurC0n9XiwtPQh9ZgQcswMKY4b+TEsQh1VgYDNeWA@mail.gmail.com>
On Thu, Apr 02, 2020 at 11:31:37AM +0200, Arnd Bergmann wrote:
> On Tue, Mar 31, 2020 at 11:34 AM Eric Lin <tesheng@andestech.com> wrote:
> >
> > With Highmem support, the kernel can map more than 1GB physical memory.
> >
> > This patchset implements Highmem for RV32, referencing to mostly nds32
> > and others like arm and mips, and it has been tested on Andes A25MP platform.
>
> I would much prefer to not see highmem added to new architectures at all
> if possible, see https://lwn.net/Articles/813201/ for some background.
>
Understood.
> For the arm32 architecture, we are thinking about implementing a
> VMPLIT_4G_4G option to replace highmem in the long run. The most
> likely way this would turn out at the moment looks like:
>
Thanks for sharing the status from ARM32. Is there any available branch
already? It would be good to have a reference implementation.
> - have a 256MB region for vmalloc space at the top of the 4GB address
> space, containing vmlinux, module, mmio mappings and vmalloc
> allocations
>
> - have 3.75GB starting at address zero for either user space or the
> linear map.
>
> - reserve one address space ID for kernel mappings to avoid tlb flushes
> during normal context switches
>
> - On any kernel entry, switch the page table to the one with the linear
> mapping, and back to the user page table before returning to user space
>
After some survey I found previous disccusion
(https://lkml.org/lkml/2019/4/24/2110). The 5.2-based patch ended up not
being merged. But at least we will have something to start if we want to.
Also interestingly, there was a PR for privileged spec that separates
addressing modes (https://github.com/riscv/riscv-isa-manual/pull/128) as
Sdas extension, but there was no progress afterwards.
Not very related to this thread, but there were some discussion about
ASID design in RISC-V (https://github.com/riscv/riscv-isa-manual/issues/348).
It is now in ratified 1.11 privileged spec.
> - add a generic copy_from_user/copy_to_user implementation based
> on get_user_pages() in asm-generic/uaccess.h, using memcpy()
> to copy from/to the page in the linear map.
>
> - possible have architectures override get_user/put_user to use a
> cheaper access based on a page table switch to read individual
> words if that is cheaper than get_user_pages().
>
> There was an implementation of this for x86 a long time ago, but
> it never got merged, mainly because there were no ASIDs on x86
> at the time and the TLB flushing during context switch were really
> expensive. As far as I can tell, all of the modern embedded cores
> do have ASIDs, and unlike x86, most do not support more than 4GB
> of physical RAM, so this scheme can work to replace highmem
> in most of the remaining cases, and provide additional benefits
> (larger user address range, higher separate of kernel/user addresses)
> at a relatively small performance cost.
>
> Arnd
>
It seems to me that VMSPLIT_4G_4G is quite different from other VMSPLITs,
because it requires much more changes.
Thanks for showing the stance of kernel community against HIGHMEM support.
The cited discussion thread is comprehensive and clear. Despite that RV32
users cannot get upstream support for their large memory, mechnisms like
VMSPLIT_4G_4G seems to be a promising way to go. That being said, to
support the theoretical 16G physical memory, eventually kmap* will still
be needed.
Alan
next prev parent reply other threads:[~2020-04-08 4:19 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-31 9:32 [PATCH 0/3] Highmem support for 32-bit RISC-V Eric Lin
2020-03-31 9:32 ` [PATCH 1/3] riscv/mm: Add pkmap region and CONFIG_HIGHMEM Eric Lin
2020-03-31 9:32 ` [PATCH 2/3] riscv/mm: Implement kmap() and kmap_atomic() Eric Lin
2020-03-31 9:32 ` [PATCH 3/3] riscv/mm: Add pkmap in print_vm_layout() Eric Lin
2020-04-02 9:31 ` [PATCH 0/3] Highmem support for 32-bit RISC-V Arnd Bergmann
2020-04-08 3:51 ` Alan Kao [this message]
2020-04-08 14:40 ` Arnd Bergmann
2020-04-14 15:17 ` afzal mohammed
2020-04-14 19:29 ` Arnd Bergmann
2020-04-15 13:54 ` afzal mohammed
2020-05-03 14:50 ` afzal mohammed
2020-05-03 20:20 ` Arnd Bergmann
2020-05-04 9:10 ` afzal mohammed
2020-05-04 11:27 ` Arnd Bergmann
2020-05-11 14:21 ` ARM: static kernel in vmalloc space (was Re: [PATCH 0/3] Highmem support for 32-bit RISC-V) afzal mohammed
2020-05-11 15:29 ` Arnd Bergmann
2020-05-12 10:47 ` ARM: static kernel in vmalloc space afzal mohammed
2020-05-12 19:49 ` Arnd Bergmann
2020-05-14 11:17 ` afzal mohammed
2020-05-14 12:41 ` Arnd Bergmann
2020-05-14 13:35 ` afzal mohammed
2020-05-14 14:44 ` afzal mohammed
2020-05-14 15:32 ` Arnd Bergmann
2020-05-16 6:06 ` afzal mohammed
2020-05-16 7:35 ` Arnd Bergmann
2020-06-07 12:59 ` ARM: vmsplit 4g/4g afzal mohammed
2020-06-07 16:11 ` Russell King - ARM Linux admin
2020-06-08 11:09 ` afzal mohammed
2020-06-10 10:10 ` Linus Walleij
2020-06-12 10:25 ` afzal mohammed
2020-06-15 9:11 ` Linus Walleij
2020-06-15 10:01 ` afzal mohammed
2020-06-07 19:26 ` Arnd Bergmann
2020-06-08 11:18 ` afzal mohammed
2020-06-08 14:43 ` Arnd Bergmann
2020-06-08 15:17 ` afzal mohammed
2020-06-09 12:15 ` afzal mohammed
2020-06-09 14:22 ` Arnd Bergmann
2020-05-14 16:25 ` ARM: static kernel in vmalloc space Russell King - ARM Linux admin
2020-05-14 21:12 ` Arnd Bergmann
2020-05-14 23:40 ` Russell King - ARM Linux admin
2020-05-15 15:41 ` Arnd Bergmann
2020-07-30 9:33 ` Linus Walleij
2020-07-30 10:17 ` 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=20200408035118.GA1451@andestech.com \
--to=alankao@andestech.com \
--cc=Anup.Patel@wdc.com \
--cc=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--cc=atish.patra@wdc.com \
--cc=bp@suse.de \
--cc=david.abdurachmanov@gmail.com \
--cc=gary@garyguo.net \
--cc=green.hu@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=logang@deltatee.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=rppt@linux.ibm.com \
--cc=steven.price@arm.com \
--cc=tesheng@andestech.com \
--cc=tglx@linutronix.de \
--cc=yash.shah@sifive.com \
--cc=zong.li@sifive.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox