RFR(L): 8002074: Support for AES on SPARC
Shrinivas Joshi
shrinivas.joshi at oracle.com
Fri Nov 15 11:47:09 PST 2013
Hi Vitaly,
Thanks for looking into this. I did miss adding string format. I will
address that. Also, I should add a check for UseVIS > 0 while setting
UseAES and UseAESIntrinsics flags since AES stubs use FXOR instructions
which are VIS 1 extension instructions.
-Shrinivas
On 11/14/2013 8:15 PM, Vitaly Davidovich wrote:
>
> Hi Shrinivas,
>
> In vm_version_sparc.cpp line 253 you added aes printing but the string
> format is missing a new corresponding %s? Also, is the 512 buf size
> still sufficient if all features are present? I didn't attempt to
> count :).
>
> Sent from my phone
>
> On Nov 14, 2013 9:36 PM, "Shrinivas Joshi" <shrinivas.joshi at oracle.com
> <mailto:shrinivas.joshi at oracle.com>> wrote:
>
> Hi,
>
> Can I please request reviews for the following change? Target JDK
> release for this change would be the next update of JDK 8 / JDK 9.
>
> Thanks,
> -Shrinivas
>
> RFE: https://bugs.openjdk.java.net/browse/JDK-8002074
> Webrev: http://cr.openjdk.java.net/~kvn/8002074/webrev.02/
> <http://cr.openjdk.java.net/%7Ekvn/8002074/webrev.02/>
>
> Summary: This change adds intrinsics/stub routines support for
> single-block and multi-block (as used by Cipher Block Chaining
> mode) AES encryption and decryption operations on the SPARC
> platform. These intrinsics are available only when the application
> is configured to use SunJCE crypto provider. These stubs make use
> of efficient hardware AES instructions and thus offer significant
> performance improvements over JITed code. AES intrinsics are
> enabled by default on SPARC platforms that support AES
> instructions. They can be explicitly enabled or disabled on the
> command-line using UseAES and UseAESIntrinsics JVM flags.
>
> Summary of source code changes:
> * src/cpu/sparc/vm/assembler_sparc.hpp
> - Adds support for all 3-operand and 4-operand SPARC AES
> instructions. Also adds support for floating-point XOR
> (FXORs/FXORd) instructions. FXOR instructions are used in the AES
> stub routines
> * src/cpu/sparc/vm/stubGenerator_sparc.cpp
> - Defines stubs for single-block and multi-block AES
> encryption and decryption routines supporting all key sizes
> (128-bit, 192-bit and 256-bit).
> - Current SPARC AES decryption instructions are not
> compatible with SunJCE expanded decryption key format. Thus
> decryption stubs read the original key (passed as an input
> parameter) and perform decryption key expansion using hardware
> instructions.
> - Multi-block decryption stub can perform decryption for 2 *
> 16-byte blocks at a time.
> - Encryption stubs use SunJCE expanded encryption key as
> their is no incompatibility issue between SPARC AES encryption
> instructions and SunJCE expanded encryption keys.
> * src/cpu/sparc/vm/sparc.ad <http://sparc.ad>,
> src/cpu/x86/vm/x86.ad <http://x86.ad> and
> src/share/vm/opto/matcher.hpp
> - The additional original key array reference parameter is
> required only on the SPARC platform. This code guards it from
> being passed to the x86 AES stub routines.
> * src/cpu/sparc/vm/vm_version_sparc.cpp,
> src/cpu/sparc/vm/vm_version_sparc.hpp and
> src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
> - Detect AES capabilities of the underlying CPU.
> - Enable UseAES and UseAESIntrinsics flags if the underlying
> CPU supports AES instructions and neither of them is explicitly
> disabled on the command-line. Generate warning message if either
> of these flags are enabled on the command-line whereas the
> underlying CPU does not support AES instructions.
> * src/share/vm/classfile/vmSymbols.hpp
> - Fix for "8012900: CICO ignores AAD in GCM mode" changes
> return type of
> com.sun.crypto.provider.CipherBlockChaining.encrypt() and
> com.sun.crypto.provider.CipherBlockChaining.decrypt() from void to
> int. Method signature in intrinsics definition had to be changed
> accordingly.
> * src/share/vm/opto/library_call.cpp
> - Adds a new method to read 'lastKey' field of
> com.sun.crypto.provider.AESCrypt class which holds the original key.
> - Passes additional input parameter, original key array
> reference, to the AES stubs only on the SPARC platform.
> - Addresses change in return value from 'void' to 'int' in
> case of multi-block CBC stubs.
> * src/share/vm/opto/runtime.cpp
> - Reads the additional input parameter (original key
> reference) only on SPARC platform.
> - Addresses change in return value from 'void' to 'int' in
> case of multi-block CBC stubs.
> * hotspot/test/compiler/7184394/TestAESMain.java
> - This test case was contributed as part of the x86 AES
> intrinsics work by Tom Deneau @AMD. Fixed incorrect nano-second to
> milli-second conversion code. Added warm-up phase since this test
> case can also be used for performance testing.
>
> Testing: jtreg, ctw, nsk and JPRT
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20131115/3a028201/attachment-0001.html
More information about the hotspot-compiler-dev
mailing list