RFR(M) 8078122 : YMM registers upper 128 bits may get clobbered by a JNI call on windows

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Sep 6 21:31:16 UTC 2016


Next jtreg test failed on 32-bit Linux:

hotspot/test/compiler/runtime/Test7196199.java

----------System.err:(57/2416)----------
test_incrc: [41] = 8.081506E20 != 150000.0
test_incrc: [42] = 1.8632992E31 != 150000.0
test_incrc: [43] = 2.8397877E29 != 150000.0
...

https://bugs.openjdk.java.net/browse/JDK-7196199

was related to Upper bits (64-255) of XMM (YMM) registers are not 
saved/restored in interrupt handle code during safepoint.

Looks like your changes are not enough.

Vladimir


On 9/6/16 10:12 AM, Vladimir Kozlov wrote:
> Good. I start testing these changes. I will push it if testing pass.
>
> Thanks,
> Vladimir
>
> On 9/2/16 3:07 PM, Kharbas, Kishor wrote:
>> Thanks Vladimir,
>>
>> I have updated the patch :
>> http://cr.openjdk.java.net/~vdeshpande/8078122/webrev.02/
>>
>> I looked for other places in src/cpu/x86/vm. I feel every case is
>> covered.
>>
>> - Kishor
>>
>> -----Original Message-----
>> From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com]
>> Sent: Thursday, September 1, 2016 11:39 AM
>> To: Kharbas, Kishor <kishor.kharbas at intel.com>;
>> hotspot-compiler-dev at openjdk.java.net
>> Subject: Re: RFR(M) 8078122 : YMM registers upper 128 bits may get
>> clobbered by a JNI call on windows
>>
>> Good. But looks like some code relied on old stack layout in stubs,
>> for example sha256_AVX2():
>>
>> #ifndef _WIN64
>>    _XMM_SAVE_SIZE = 0,
>> #else
>>    _XMM_SAVE_SIZE = 8*16,
>> #endif
>>
>> Please, check that all other related code is fixed too. (I looked on
>> all cases of _WIN64 in src/cpu/x86/vm/).
>>
>> Thanks,
>> Vladimir
>>
>> On 8/31/16 10:17 PM, Kharbas, Kishor wrote:
>>> Hello,
>>>
>>> I removed the unwanted save and restore of registers in the range
>>> XMM6-XMM31 from the x64_64 stubs.
>>> I also removed the #ifdef _WIN64 block from x86.ad file.
>>>
>>> Link to the new patch :
>>> http://cr.openjdk.java.net/~vdeshpande/8078122/webrev.01/
>>>
>>> Thanks
>>> Kishor
>>>
>>>
>>> -----Original Message-----
>>> From: Kharbas, Kishor
>>> Sent: Wednesday, August 24, 2016 6:24 PM
>>> To: Vladimir Kozlov <vladimir.kozlov at oracle.com>;
>>> hotspot-compiler-dev at openjdk.java.net
>>> Cc: Kharbas, Kishor <kishor.kharbas at intel.com>
>>> Subject: RE: RFR(M) 8078122 : YMM registers upper 128 bits may get
>>> clobbered by a JNI call on windows
>>>
>>> Thanks Vladimir for quick feedback.
>>> I will look into the stubs which save the registers in the range
>>> XMM6-XMM31. Also the first comment makes perfect sense.
>>>
>>> Thanks
>>> Kishor
>>>
>>> -----Original Message-----
>>> From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com]
>>> Sent: Wednesday, August 24, 2016 3:08 PM
>>> To: Kharbas, Kishor <kishor.kharbas at intel.com>;
>>> hotspot-compiler-dev at openjdk.java.net
>>> Subject: Re: RFR(M) 8078122 : YMM registers upper 128 bits may get
>>> clobbered by a JNI call on windows
>>>
>>> Hi Kishor,
>>>
>>> First, #ifdef _WIN64 is not needed anymore since calling convention
>>> is similat to unix now.
>>>
>>> Second, I would like you to look more broadly. With this change we
>>> don't need to preserve XMM6-XMM31 in our stubs for WIN64. I am not
>>> sure that we can remove all #ifdef _WIN64 there but for most of them
>>> I think we can do. Please, look.
>>>
>>> Thanks,
>>> Vladimir
>>>
>>> On 8/24/16 2:40 PM, Kharbas, Kishor wrote:
>>>> Requesting the community to review the patch for
>>>> https://bugs.openjdk.java.net/browse/JDK-8078122
>>>>
>>>> Webrev : http://cr.openjdk.java.net/~vdeshpande/8078122/webrev.00
>>>>
>>>> The patch changes the definitions of registers XMM6-XMM31 for WIN64.
>>>>
>>>> Thank you.
>>>>
>>>> Kishor
>>>>


More information about the hotspot-compiler-dev mailing list