RFR: 8334999: RISC-V: implement AES single block encryption/decryption intrinsics [v8]
Yanhong Zhu
yzhu at openjdk.org
Sun Oct 20 04:53:45 UTC 2024
On Thu, 17 Oct 2024 22:07:16 GMT, Arseny Bochkarev <duke at openjdk.org> wrote:
>> Hello everyone! Please review this port of vector AES single block encryption/decryption intrinsics. On my QEMU with `Zvkned` extension enabled the `test/hotspot/jtreg/compiler/codegen/aes/TestAESMain.java` test is OK. I know that currently hardware implementing this extension is not available on the market but I suppose this PR can be a good starting point on supporting AES intrinsics for RISC-V in OpenJDK.
>
> Arseny Bochkarev has updated the pull request incrementally with one additional commit since the last revision:
>
> Use same keys for encryption and decryption
src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 2279:
> 2277: }
> 2278:
> 2279: void generate_aes_loadkeys(const Register &key, VectorRegister *working_vregs, int reg_number) {
Hi, maybe `rounds` is more readable than `reg_number` here.
src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 2289:
> 2287:
> 2288: void generate_aes_encrypt(const VectorRegister &res, VectorRegister *working_vregs, int reg_number) {
> 2289: assert(reg_number <= 15, "reg_number should be less than or equal to working_vregs size")
This lacks `;` at the end of statement, which is causing the GHA failure.
src/hotspot/share/opto/library_call.cpp line 7225:
> 7223: //------------------------------get_key_start_from_aescrypt_object-----------------------
> 7224: Node * LibraryCallKit::get_key_start_from_aescrypt_object(Node *aescrypt_object) {
> 7225: #if defined(PPC64) || defined(S390) || defined(RISCV)
Hi, I think RISCV64 is more specific here for now.
src/hotspot/share/opto/library_call.cpp line 7230:
> 7228: // However, ppc64 vncipher processes MixColumns and requires the same round keys with encryption.
> 7229: // The ppc64 stubs of encryption and decryption use the same round keys (sessionK[0]).
> 7230: // The RISC-V stubs of encryption and decryption use the same round keys (sessionK[0]).
`// The ppc64 and riscv64 stubs...` would be better.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19960#discussion_r1807636619
PR Review Comment: https://git.openjdk.org/jdk/pull/19960#discussion_r1807633799
PR Review Comment: https://git.openjdk.org/jdk/pull/19960#discussion_r1807634349
PR Review Comment: https://git.openjdk.org/jdk/pull/19960#discussion_r1807634141
More information about the hotspot-dev
mailing list