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 23 20:32:31 UTC 2016
Ah ok, glad to know it wasn't a regression by this patch.
Thanks
Kishor
-----Original Message-----
From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com]
Sent: Wednesday, September 21, 2016 3:52 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
To close loop on this.
It looks like the machine, on which test failed, had well known XMM saving problem in Linux kernal.
So we decided to push changes. You may saw notification already.
regards,
Vladimir
On 9/8/16 5:46 PM, Kharbas, Kishor wrote:
> Hi Vladimir,
> I couldn't reproduce the error on my 32-bit Linux machine. The test
> was done on a Sandy bridge machine (has AVX instruction set) Please advise how to proceed further.
>
> Thanks
> Kishor
>
>
> -----Original Message-----
> From: Kharbas, Kishor
> Sent: Tuesday, September 6, 2016 5:40 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
>
> Hi Vladimir,
>
> The patch only touches code in _WIN64. I am having hard time to
> understand why the test fails for 32-bit Linux
>
> Btw, that test passes on Windows 64 platform. I am planning to test on Linux too.
>
> Thanks
> Kishor
>
> -----Original Message-----
> From: Vladimir Kozlov [mailto:vladimir.kozlov at oracle.com]
> Sent: Tuesday, September 6, 2016 2:31 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
>
> 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