RFR: 8346706: RISC-V: Add available registers to hs_err

Hamlin Li mli at openjdk.org
Fri Dec 20 13:07:35 UTC 2024


On Fri, 20 Dec 2024 11:17:54 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

> Hi please consider.
> 
> This adds below to hs_err:
> 
> Floating point state:
> fcsr=1
> Floating point registers:
> f0=0xffffffff44a72000 | 1.84467e+19
> f1=0xffffffff44a72000 | 1.84467e+19
> ....
> f31=0xffffffff44a72000 | 1.84467e+19
> 
> Vector state:
> vstart=0x0000000000000000
> vl=0x0000000000000020
> vtype=0x0000000000000000
> vcsr=0x0000000000000000
> vlenb=0x0000000000000020
> Vector registers:
> v0=0x0101010101010101010101010101010101010101010101010101010101010101
> ....
> v31=0x0101010101010101010101010101010101010101010101010101010101010101
> 
> 
> To get vector the headers need to include those structures, hence build files hackery.
> This means if you compile on a kernel without RVV support the error handler will lack support for it.
> We don't care about RVV option as carshing in native may still use vector even if the jit do not.
> 
> I'm doubt full about the printing as double for fp regs, maybe that should be removed.
> 
> Local testing, running t1 over weekend.
> 
> Thanks, Robbin

Thanks for adding this, it's helpful!

Some minor comments on riscv code.

src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp line 360:

> 358:   for (int r = 0; r < 32; r++) {
> 359:     st->print_cr("f%d=" INTPTR_FORMAT " | %g", r, (intptr_t)f_ext_state->__f[r], (double)f_ext_state->__f[r]);
> 360:   }

single float is also common, it's helpful to print them too if we already print double.

src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp line 364:

> 362: 
> 363: #ifdef NO_RVV_SIGCONTEXT
> 364:     st->print_cr("Vector state: JVM compiled without vector sigcontext support");

indent

src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp line 383:

> 381:   }
> 382: 
> 383:   // size = sizeof(struct __riscv_ctx_hdr) + sizeof(struct __sc_riscv_v_state) + riscv_v_vsize;

no use?

src/hotspot/os_cpu/linux_riscv/os_linux_riscv.cpp line 420:

> 418:   }
> 419:   st->cr();
> 420: #endif

Suggestion:

#endif // #ifdef NO_RVV_SIGCONTEXT

-------------

PR Review: https://git.openjdk.org/jdk/pull/22845#pullrequestreview-2517478603
PR Review Comment: https://git.openjdk.org/jdk/pull/22845#discussion_r1893897029
PR Review Comment: https://git.openjdk.org/jdk/pull/22845#discussion_r1893895913
PR Review Comment: https://git.openjdk.org/jdk/pull/22845#discussion_r1893904487
PR Review Comment: https://git.openjdk.org/jdk/pull/22845#discussion_r1893898238


More information about the hotspot-runtime-dev mailing list