RFR JDK-8194084: Obsolete FastTLABRefill and remove the related code
Andrew Dinn
adinn at redhat.com
Mon Feb 19 15:15:46 UTC 2018
On 19/02/18 14:24, Stuart Monteith wrote:
> I've tried building with Aleksey's patch
> (http://cr.openjdk.java.net/~shade/8198341/fixes.patch), but came
> across a JVM crash when building OpenJDK.
>
> I need to look a bit closer, but the patch "8194084: Obsolete
> FastTLABRefill and remove the related code" is causing SIGBUS
> BUS_ADRALN errors. The stack pointer is becoming unaligned, and so
> breaks on aarch64.
> For example, in your patch you do:
>
> - __ ldp(r5, r19, Address(__ post(sp, 2 * wordSize)));
> + __ ldr(r19, Address(__ post(sp, wordSize)));
>
> You can only have a 16-byte aligned stack pointer, and you replaced
> two loads with one, resulting in an unaligned SP.
Yes, I believe Stuart has diagnosed this correctly. The problem is in
the changes in c1_Runtime1_aarch64.cpp. The original stp with
pre-decrement instruction that save r19+r5 retained 16-byte alignment
for rsp. The replacement single str with pre-decrement instruction
misaligns sp -- and AArch64 hw gets /very/ unhappy when that happens.
Three may be no need to save and restore r5, per se, but there is still
a need to push and restore 16 byte's worth of stack data. The str and
ldr instructions which currently save/restore r19 could simply be
reverted to stp and ldp of r5+r19 (it does no harm to save/restore r5).
However, it would be better to save and restore zr+r19. That would
better indicate the uselessness of the zr stack slot.
regards,
Andrew Dinn
-----------
More information about the hotspot-dev
mailing list