mbox series

[0/4] riscv: 64-bit NOMMU fixes and enhancements

Message ID 20240227003630.3634533-1-samuel.holland@sifive.com (mailing list archive)
Headers show
Series riscv: 64-bit NOMMU fixes and enhancements | expand

Message

Samuel Holland Feb. 27, 2024, 12:34 a.m. UTC
This series aims to improve support for NOMMU, specifically by making it
easier to test NOMMU kernels in QEMU and on various widely-available
hardware (errata permitting). After all, everything supports Svbare...

After applying this series, a NOMMU kernel based on defconfig (changing
only the three options below*) boots to userspace on QEMU when passed as
-kernel.

  # CONFIG_RISCV_M_MODE is not set
  # CONFIG_MMU is not set
  CONFIG_NONPORTABLE=y

*if you are using LLD, you must also disable BPF_SYSCALL and KALLSYMS,
because LLD bails on out-of-range references to undefined weak symbols.


Samuel Holland (4):
  riscv: Fix TASK_SIZE on 64-bit NOMMU
  riscv: Fix loading 64-bit NOMMU kernels past the start of RAM
  riscv: Remove MMU dependency from Zbb and Zicboz
  riscv: Allow NOMMU kernels to run in S-mode

 arch/riscv/Kconfig               | 17 ++++++++++-------
 arch/riscv/include/asm/page.h    |  2 +-
 arch/riscv/include/asm/pgtable.h |  2 +-
 arch/riscv/mm/init.c             |  2 +-
 4 files changed, 13 insertions(+), 10 deletions(-)

Comments

Conor Dooley Feb. 27, 2024, 12:13 p.m. UTC | #1
On Mon, Feb 26, 2024 at 04:34:45PM -0800, Samuel Holland wrote:
> This series aims to improve support for NOMMU, specifically by making it
> easier to test NOMMU kernels in QEMU and on various widely-available
> hardware (errata permitting). After all, everything supports Svbare...
> 
> After applying this series, a NOMMU kernel based on defconfig (changing
> only the three options below*) boots to userspace on QEMU when passed as
> -kernel.
> 
>   # CONFIG_RISCV_M_MODE is not set
>   # CONFIG_MMU is not set
>   CONFIG_NONPORTABLE=y
> 
> *if you are using LLD, you must also disable BPF_SYSCALL and KALLSYMS,
> because LLD bails on out-of-range references to undefined weak symbols.

That's not new to these patches though, right? IIRC that's an existing
issue.

Cheers,
Conor.

> 
> 
> Samuel Holland (4):
>   riscv: Fix TASK_SIZE on 64-bit NOMMU
>   riscv: Fix loading 64-bit NOMMU kernels past the start of RAM
>   riscv: Remove MMU dependency from Zbb and Zicboz
>   riscv: Allow NOMMU kernels to run in S-mode
> 
>  arch/riscv/Kconfig               | 17 ++++++++++-------
>  arch/riscv/include/asm/page.h    |  2 +-
>  arch/riscv/include/asm/pgtable.h |  2 +-
>  arch/riscv/mm/init.c             |  2 +-
>  4 files changed, 13 insertions(+), 10 deletions(-)
> 
> -- 
> 2.43.0
>
Samuel Holland Feb. 27, 2024, 6:51 p.m. UTC | #2
Hi Conor,

On 2024-02-27 6:13 AM, Conor Dooley wrote:
> On Mon, Feb 26, 2024 at 04:34:45PM -0800, Samuel Holland wrote:
>> This series aims to improve support for NOMMU, specifically by making it
>> easier to test NOMMU kernels in QEMU and on various widely-available
>> hardware (errata permitting). After all, everything supports Svbare...
>>
>> After applying this series, a NOMMU kernel based on defconfig (changing
>> only the three options below*) boots to userspace on QEMU when passed as
>> -kernel.
>>
>>   # CONFIG_RISCV_M_MODE is not set
>>   # CONFIG_MMU is not set
>>   CONFIG_NONPORTABLE=y
>>
>> *if you are using LLD, you must also disable BPF_SYSCALL and KALLSYMS,
>> because LLD bails on out-of-range references to undefined weak symbols.
> 
> That's not new to these patches though, right? IIRC that's an existing
> issue.

Yes, that's correct. I see that arch/riscv/configs/nommu_* have KALLSYMS
disabled already; this may be the reason.

Regards,
Samuel
patchwork-bot+linux-riscv@kernel.org April 10, 2024, 2 p.m. UTC | #3
Hello:

This series was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Mon, 26 Feb 2024 16:34:45 -0800 you wrote:
> This series aims to improve support for NOMMU, specifically by making it
> easier to test NOMMU kernels in QEMU and on various widely-available
> hardware (errata permitting). After all, everything supports Svbare...
> 
> After applying this series, a NOMMU kernel based on defconfig (changing
> only the three options below*) boots to userspace on QEMU when passed as
> -kernel.
> 
> [...]

Here is the summary with links:
  - [1/4] riscv: Fix TASK_SIZE on 64-bit NOMMU
    https://git.kernel.org/riscv/c/6065e736f82c
  - [2/4] riscv: Fix loading 64-bit NOMMU kernels past the start of RAM
    https://git.kernel.org/riscv/c/aea702dde7e9
  - [3/4] riscv: Remove MMU dependency from Zbb and Zicboz
    (no matching commit)
  - [4/4] riscv: Allow NOMMU kernels to run in S-mode
    (no matching commit)

You are awesome, thank you!
patchwork-bot+linux-riscv@kernel.org April 10, 2024, 2:20 p.m. UTC | #4
Hello:

This series was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Mon, 26 Feb 2024 16:34:45 -0800 you wrote:
> This series aims to improve support for NOMMU, specifically by making it
> easier to test NOMMU kernels in QEMU and on various widely-available
> hardware (errata permitting). After all, everything supports Svbare...
> 
> After applying this series, a NOMMU kernel based on defconfig (changing
> only the three options below*) boots to userspace on QEMU when passed as
> -kernel.
> 
> [...]

Here is the summary with links:
  - [1/4] riscv: Fix TASK_SIZE on 64-bit NOMMU
    (no matching commit)
  - [2/4] riscv: Fix loading 64-bit NOMMU kernels past the start of RAM
    (no matching commit)
  - [3/4] riscv: Remove MMU dependency from Zbb and Zicboz
    https://git.kernel.org/riscv/c/9c4319d69744
  - [4/4] riscv: Allow NOMMU kernels to run in S-mode
    https://git.kernel.org/riscv/c/f862bbf4cdca

You are awesome, thank you!