[jdk16] RFR: 8258384: AArch64: SVE verify_ptrue fails on some tests [v2]
Ningsheng Jian
njian at openjdk.java.net
Tue Jan 5 02:57:15 UTC 2021
> After applying [1], some Vector API tests fail with SIGILL on SVE
> system. The SIGILL was triggered by verify_ptrue before c2 compiled
> function returns, which means that the preserved p7 register (as ptrue)
> has been clobbered before returning to c2 compiled code. (p7 is not
> preserved cross function calls, and system calls [2]).
>
> Currently we try to reinitialize ptrue at each entrypoint of returning
> from non-c2 compiled code, which indicating possible C or system calls.
> However, there's still one entrypoint missing, exception handling, as
> we may jump to c2 compiled code for exception handler. See
> OptoRuntime::generate_exception_blob().
>
> Adding reinitialize_ptrue before jumping back to c2 compiled code in
> generate_exception_blob() could solve those Vector API test failures.
> Actually I had that in my initial test patch [3], I don't know why I
> missed that in final patch... I reran tests with the same approach of
> [3] and found that there's still something missing, the
> nmethod_entry_barrier() in c2 function prolog. The barrier may call to
> runtime code (see generate_method_entry_barrier()). To reduce the risk
> of missing such reinitialize_ptrue in newly added code in future, I
> think it would be better to do the reinitialize in
> pop_call_clobbered_registers().
>
> P.S. the SIGILL message is also not clear, it should print detailed
> message as indicated by MacroAssembler::stop() call. This is caused by
> JDK-8255711 removing the message printing code. This patch also adds it
> back, so that it could print detailed message for abort.
>
> Tested with tier1-3 on SVE hardware. Also verified with the same
> approach of patch [3] with jtreg tests hotspot_all_no_apps and
> jdk:tier1-3 passed without incorrect ptrue value assertion failure.
>
> [1] https://github.com/openjdk/jdk/pull/1621
> [2] https://github.com/torvalds/linux/blob/master/Documentation/arm64/sve.rst
> [3] http://cr.openjdk.java.net/~njian/8231441/0001-RFC-Block-one-caller-save-register-for-C2.patch
Ningsheng Jian has updated the pull request incrementally with one additional commit since the last revision:
Update copyright year to 2021.
-------------
Changes:
- all: https://git.openjdk.java.net/jdk16/pull/50/files
- new: https://git.openjdk.java.net/jdk16/pull/50/files/a5754c7d..873c2506
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk16&pr=50&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk16&pr=50&range=00-01
Stats: 12 lines in 7 files changed: 0 ins; 0 del; 12 mod
Patch: https://git.openjdk.java.net/jdk16/pull/50.diff
Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/50/head:pull/50
PR: https://git.openjdk.java.net/jdk16/pull/50
More information about the hotspot-dev
mailing list