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

Kharbas, Kishor kishor.kharbas at intel.com
Fri Sep 2 22:07:44 UTC 2016


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