[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <556bebad-3150-4fd5-8725-e4973fd6edd1@app.fastmail.com>
Date: Thu, 18 May 2023 20:29:09 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Palmer Dabbelt" <palmer@...osinc.com>, guoren <guoren@...nel.org>
Cc: "Thomas Gleixner" <tglx@...utronix.de>,
"Peter Zijlstra" <peterz@...radead.org>,
"Andy Lutomirski" <luto@...nel.org>,
"Conor.Dooley" <conor.dooley@...rochip.com>,
Heiko Stübner <heiko@...ech.de>,
"Jisheng Zhang" <jszhang@...nel.org>,
"Huacai Chen" <chenhuacai@...nel.org>,
"Anup Patel" <apatel@...tanamicro.com>,
"Atish Patra" <atishp@...shpatra.org>,
"Mark Rutland" <mark.rutland@....com>,
Björn Töpel <bjorn@...nel.org>,
"Paul Walmsley" <paul.walmsley@...ive.com>,
"Catalin Marinas" <catalin.marinas@....com>,
"Will Deacon" <will@...nel.org>, "Mike Rapoport" <rppt@...nel.org>,
"Anup Patel" <anup@...infault.org>, shihua@...as.ac.cn,
jiawei@...as.ac.cn, liweiwei@...as.ac.cn, luxufan@...as.ac.cn,
chunyu@...as.ac.cn, tsu.yubo@...il.com, wefu@...hat.com,
wangjunqiang@...as.ac.cn, kito.cheng@...ive.com,
"Andy Chiu" <andy.chiu@...ive.com>,
"Vincent Chen" <vincent.chen@...ive.com>,
"Greentime Hu" <greentime.hu@...ive.com>,
"Jonathan Corbet" <corbet@....net>, wuwei2016@...as.ac.cn,
"Jessica Clarke" <jrtc27@...c27.com>,
Linux-Arch <linux-arch@...r.kernel.org>,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
"Guo Ren" <guoren@...ux.alibaba.com>
Subject: Re: [RFC PATCH 00/22] riscv: s64ilp32: Running 32-bit Linux kernel on 64-bit
supervisor mode
On Thu, May 18, 2023, at 17:38, Palmer Dabbelt wrote:
> On Thu, 18 May 2023 06:09:51 PDT (-0700), guoren@...nel.org wrote:
>> From: Guo Ren <guoren@...ux.alibaba.com>
>>
>> This patch series adds s64ilp32 support to riscv. The term s64ilp32
>> means smode-xlen=64 and -mabi=ilp32 (ints, longs, and pointers are all
>> 32-bit), i.e., running 32-bit Linux kernel on pure 64-bit supervisor
>> mode. There have been many 64ilp32 abis existing, such as mips-n32 [1],
>> arm-aarch64ilp32 [2], and x86-x32 [3], but they are all about userspace.
>> Thus, this should be the first time running a 32-bit Linux kernel with
>> the 64ilp32 ABI at supervisor mode (If not, correct me).
>
> Does anyone actually want this? At a bare minimum we'd need to add it
> to the psABI, which would presumably also be required on the compiler
> side of things.
>
> It's not even clear anyone wants rv64/ilp32 in userspace, the kernel
> seems like it'd be even less widely used.
We have had long discussions about supporting ilp32 userspace on
arm64, and I think almost everyone is glad we never merged it into
the mainline kernel, so we don't have to worry about supporting it
in the future. The cost of supporting an extra user space ABI
is huge, and I'm sure you don't want to go there. The other two
cited examples (mips-n32 and x86-x32) are pretty much unused now
as well, but still have a maintenance burden until they can finally
get removed.
If for some crazy reason you'd still want the 64ilp32 ABI in user
space, running the kernel this way is probably still a bad idea,
but that one is less clear. There is clearly a small memory
penalty of running a 64-bit kernel for larger data structures
(page, inode, task_struct, ...) and vmlinux, and there is no
huge additional maintenance cost on top of the ABI itself
that you'd need either way, but using a 64-bit address space
in the kernel has some important advantages even when running
32-bit userland: processes can use the entire 4GB virtual
space, while the kernel can address more than 768MB of lowmem,
and KASLR has more bits to work with for randomization. On
RISCV, some additional features (VMAP_STACK, KASAN, KFENCE,
...) depend on 64-bit kernels even though they don't
strictly need that.
Arnd
Powered by blists - more mailing lists