openjdk 20 crash on linux kernel 5.19, because it can not support huge VM?

yangfei at iscas.ac.cn yangfei at iscas.ac.cn
Thu Nov 24 10:16:02 UTC 2022


I think at this stage we should do some detection for sv57+ at JVM startup time and explicitly issue a warning and stop early. 


That would be better and more elegant than simply crashing the JVM afterwards.

I see this kind of information is availble on linux-riscv64 at /proc/cpuinfo: 




$ cat /proc/cpuinfo
processor       : 0
hart            : 1
isa             : rv64imafdc
mmu             : sv39
uarch           : sifive,u74-mc


Regards,

Fei

-----Original Messages-----
From:"Ludovic Henry" <ludovic at rivosinc.com>
Sent Time:2022-11-24 07:25:19 (Thursday)
To: "Vladimir Kempik" <vladimir.kempik at gmail.com>
Cc: "Zixian Cai" <zixian.cai at anu.edu.au>, "riscv-port-dev at openjdk.org" <riscv-port-dev at openjdk.org>, "Ze Zhang" <zhangze.linux at gmail.com>
Subject: Re: openjdk 20 crash on linux kernel 5.19, because it can not support huge VM?


Hi,


We are currently working on contributing to Qemu a command-line option to disable/enable certain modes in Qemu. I'll keep you posted as soon as I've anything material to share.


The solution on the OpenJDK should IMO to probe at startup for the satp mode (sv39/sv48/sv57/sv64) and generate the appropriate and cheapest movptr according to this value. I wouldn't want to pay the full cost of sv57 or sv64 while no existing boards or hardware even support anything more than sv48. Especially given the current discussions in RISC-V on reducing the cost of auipc/jalr, movptr, and trampolines.


Thanks,
Ludovic


On Wed, Nov 23, 2022 at 9:33 AM Vladimir Kempik <vladimir.kempik at gmail.com> wrote:

Hello


A kind of workaround for this case


disable sv57 csr and rebuild qemu - https://github.com/qemu/qemu/blob/master/target/riscv/csr.c#L1027 put 0 here


Regards, Vladimir



23 нояб. 2022 г., в 04:08, Zixian Cai <zixian.cai at anu.edu.au> написал(а):


This has been discussed in a previous thread. https://mail.openjdk.org/pipermail/riscv-port-dev/2022-September/000636.html
 
I agree that it would be nice to support different modes. Although with the patches in QEMU/Kernel that can restrict the OS to run with sv39/sv48 only, and the fact that there are not enough real hardware board supporting above sv48, I don’t know whether there will be sufficient motivation to fix the problem in the short term.
 
Also worth noting until very recently (Intel implemented 5-level paging around the release of Ice Lake), x86_64 has been staying 48 bits a for long time.
 
Sincerely,
Zixian
 

On 23/11/2022, 11:58, "riscv-port-dev" <riscv-port-dev-retn at openjdk.org> wrote:

 
hi, 
   openjdk 20 crash on linux kernel 5.19, because it can not support huge VM?
 
but I think openjdk as a application, it should not has any limitation on virtual address length,
 
even if it has very close relationship with hardware, just as qemu should not depend on hardware VM size, it's none of business for an application, because all other apps can run very well.
 
when will it support the newest kernel and qemu? 
 
https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/pILY0WGHhOs

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/riscv-port-dev/attachments/20221124/ae711f4c/attachment.htm>


More information about the riscv-port-dev mailing list