Re: [8u] RFR(XXS): 8165231: java.nio.Bits.unaligned() doesn't return true on ppc

2016-09-26 Thread Volker Simonis
Hi,

I've been a little busy with JavaOne but now I've finally pushed this change.

Thanks to everybody,
Volker


On Thu, Sep 15, 2016 at 8:08 AM, Hiroshi H Horii <ho...@jp.ibm.com> wrote:
> Hi Volker, and Sean,
>
> Thank you for your comments and suggestion.
>
> I and Gustavo created a webrev that includes Bits and ByteArrayAccess.
>
> http://cr.openjdk.java.net/~gromero/8165231/02/
>
> I believe there is no other similar methods in jdk.
>
> Regards,
> Hiroshi
> ---
> Hiroshi Horii, Ph.D.
> IBM Research - Tokyo
>
>
>
>
> From:Sean Coffey <sean.cof...@oracle.com>
> To:Volker Simonis <volker.simo...@gmail.com>
> Cc:"jdk8u-...@openjdk.java.net" <jdk8u-...@openjdk.java.net>, Java
> Core Libs <core-libs-dev@openjdk.java.net>, Hiroshi H Horii/Japan/IBM@IBMJP,
> "ppc-aix-port-...@openjdk.java.net" <ppc-aix-port-...@openjdk.java.net>,
> Gustavo Bueno Romero <grom...@br.ibm.com>, "Doerr, Martin"
> <martin.do...@sap.com>
> Date:09/13/2016 21:46
> Subject:Re: [8u] RFR(XXS): 8165231: java.nio.Bits.unaligned()
> doesn't return true on ppc
> 
>
>
>
> Sounds good Volker. Good catch.
>
> regards,
> Sean.
>
> On 13/09/2016 13:09, Volker Simonis wrote:
>> Hi Sean,
>>
>> thanks a lot for the fast response. I've updated the bug entry as
>> requested and will push the change - maybe with the following
>> potential improvement:
>>
>> @Hiroshi: also maybe not that performance relevant, I think we should
>> we also fix sun/security/provider/ByteArrayAccess.java which contains
>> the same construct:
>>
>>  // Return whether this platform supports full speed int/long memory
>> access
>>  // at unaligned addresses.
>>  // This code was copied from java.nio.Bits because there is no
>> equivalent
>>  // public API.
>>  private static boolean unaligned() {
>>  String arch = java.security.AccessController.doPrivileged
>>  (new sun.security.action.GetPropertyAction("os.arch", ""));
>>  return arch.equals("i386") || arch.equals("x86") ||
>> arch.equals("amd64")
>>  || arch.equals("x86_64");
>>  }
>>
>> Regards,
>> Volker
>
>
>
>


Re: [8u] RFR(XXS): 8165231: java.nio.Bits.unaligned() doesn't return true on ppc

2016-09-15 Thread Hiroshi H Horii
Hi Volker, and Sean,

Thank you for your comments and suggestion.

I and Gustavo created a webrev that includes Bits and ByteArrayAccess.

http://cr.openjdk.java.net/~gromero/8165231/02/

I believe there is no other similar methods in jdk.

Regards,
Hiroshi
---
Hiroshi Horii, Ph.D.
IBM Research - Tokyo




From:   Sean Coffey <sean.cof...@oracle.com>
To: Volker Simonis <volker.simo...@gmail.com>
Cc: "jdk8u-...@openjdk.java.net" <jdk8u-...@openjdk.java.net>, Java 
Core Libs <core-libs-dev@openjdk.java.net>, Hiroshi H 
Horii/Japan/IBM@IBMJP, "ppc-aix-port-...@openjdk.java.net" 
<ppc-aix-port-...@openjdk.java.net>, Gustavo Bueno Romero 
<grom...@br.ibm.com>, "Doerr, Martin" <martin.do...@sap.com>
Date:   09/13/2016 21:46
Subject:    Re: [8u] RFR(XXS): 8165231: java.nio.Bits.unaligned() 
doesn't return true on ppc



Sounds good Volker. Good catch.

regards,
Sean.

On 13/09/2016 13:09, Volker Simonis wrote:
> Hi Sean,
>
> thanks a lot for the fast response. I've updated the bug entry as
> requested and will push the change - maybe with the following
> potential improvement:
>
> @Hiroshi: also maybe not that performance relevant, I think we should
> we also fix sun/security/provider/ByteArrayAccess.java which contains
> the same construct:
>
>  // Return whether this platform supports full speed int/long memory 
access
>  // at unaligned addresses.
>  // This code was copied from java.nio.Bits because there is no 
equivalent
>  // public API.
>  private static boolean unaligned() {
>  String arch = java.security.AccessController.doPrivileged
>  (new sun.security.action.GetPropertyAction("os.arch", ""));
>  return arch.equals("i386") || arch.equals("x86") || 
arch.equals("amd64")
>  || arch.equals("x86_64");
>  }
>
> Regards,
> Volker







Re: [8u] RFR(XXS): 8165231: java.nio.Bits.unaligned() doesn't return true on ppc

2016-09-13 Thread Sean Coffey

Sounds good Volker. Good catch.

regards,
Sean.

On 13/09/2016 13:09, Volker Simonis wrote:

Hi Sean,

thanks a lot for the fast response. I've updated the bug entry as
requested and will push the change - maybe with the following
potential improvement:

@Hiroshi: also maybe not that performance relevant, I think we should
we also fix sun/security/provider/ByteArrayAccess.java which contains
the same construct:

 // Return whether this platform supports full speed int/long memory access
 // at unaligned addresses.
 // This code was copied from java.nio.Bits because there is no equivalent
 // public API.
 private static boolean unaligned() {
 String arch = java.security.AccessController.doPrivileged
 (new sun.security.action.GetPropertyAction("os.arch", ""));
 return arch.equals("i386") || arch.equals("x86") || 
arch.equals("amd64")
 || arch.equals("x86_64");
 }

Regards,
Volker




Re: [8u] RFR(XXS): 8165231: java.nio.Bits.unaligned() doesn't return true on ppc

2016-09-13 Thread Volker Simonis
Hi Sean,

thanks a lot for the fast response. I've updated the bug entry as
requested and will push the change - maybe with the following
potential improvement:

@Hiroshi: also maybe not that performance relevant, I think we should
we also fix sun/security/provider/ByteArrayAccess.java which contains
the same construct:

// Return whether this platform supports full speed int/long memory access
// at unaligned addresses.
// This code was copied from java.nio.Bits because there is no equivalent
// public API.
private static boolean unaligned() {
String arch = java.security.AccessController.doPrivileged
(new sun.security.action.GetPropertyAction("os.arch", ""));
return arch.equals("i386") || arch.equals("x86") || arch.equals("amd64")
|| arch.equals("x86_64");
}

Regards,
Volker


Re: [8u] RFR(XXS): 8165231: java.nio.Bits.unaligned() doesn't return true on ppc

2016-09-13 Thread Sean Coffey

Hi Volker,

The fix looks fine to me. Please add the '9-na' label to the bug report. 
Also add a suitable noreg- label. It would also be useful to link the 
issue to JDK-8158260


Approved for jdk8u-dev.

regards,
Sean.

On 13/09/2016 09:37, Volker Simonis wrote:

Hi Alan, Sean,

can we please get a review for this rather trivial change?


jira: https://bugs.openjdk.java.net/browse/JDK-8165231
webrev: http://cr.openjdk.java.net/~gromero/8165231/

As outlined in Hiroshi's initial mail, we can not simply downport the
solution used in jdk9 for querying the unaligned access support in nio
because of differences in Unsafe. So this is a jsk8u-only change. But
I think it is simple enough and doesn't affect any other platform
except ppc to justify it.

As nobody from the ppc porting team is jdk8u reviewer, I kindly ask
you for a review and the permission to integrate into jdk8u.

Thanks a lot and best regards,
Volker


On Thu, Sep 1, 2016 at 5:06 PM, Doerr, Martin  wrote:

Hi Hiroshi,



thanks for providing a fix.



The fix

8158260: PPC64: unaligned Unsafe.getInt can lead to the generation of
illegal instructions

was downported to 8, so I think your change is good.



Best regards,

Martin





From: Hiroshi H Horii [mailto:ho...@jp.ibm.com]
Sent: Donnerstag, 1. September 2016 16:27
To: jdk8u-...@openjdk.java.net; ppc-aix-port-...@openjdk.java.net
Cc: Gustavo Bueno Romero ; Volker Simonis
(volker.simo...@gmail.com) ; Doerr, Martin

Subject: RFR(m): java.nio.Bits.unaligned() doesn't return true on ppc



Dear all:

Can I please request reviews for the following change?
This change was created for JDK 8.

Some open sources (such as Spark 2.0) check java.nio.Bits.unaligned()
to recognize support of unaligned memory access in platform.
Though ppc64 and ppc64le support it, unaligned() returns false.

In JDK 9, this method returns unalignedAccess() of jdk.internal.misc.Unsafe
that doesn't exist in JDK8.

jira: https://bugs.openjdk.java.net/browse/JDK-8165231
webrev: http://cr.openjdk.java.net/~gromero/8165231/
(Due to my login issue to the cs.openjdk.java.net, Gustavo thankfully
created this webrev.)

Regards,
Hiroshi
---
Hiroshi Horii, Ph.D.
IBM Research - Tokyo