From faeea07fe5d27e0c18c26f99705cc552e5ab9bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Jeli=C5=84ski?= Date: Thu, 16 Nov 2023 08:55:18 +0000 Subject: [PATCH] 8319747: galoisCounterMode_AESCrypt stack walking broken Reviewed-by: kvn, sviswanathan --- src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp b/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp index 322cf296949..1a256d0913d 100644 --- a/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64_aes.cpp @@ -260,9 +260,6 @@ address StubGenerator::generate_galoisCounterMode_AESCrypt() { #endif __ movptr(subkeyHtbl, subkeyH_mem); __ movptr(counter, counter_mem); -// Save rbp and rsp - __ push(rbp); - __ movq(rbp, rsp); // Align stack __ andq(rsp, -64); __ subptr(rsp, 96 * longSize); // Create space on the stack for htbl entries @@ -272,12 +269,12 @@ address StubGenerator::generate_galoisCounterMode_AESCrypt() { __ vzeroupper(); - __ movq(rsp, rbp); - __ pop(rbp); - // Restore state before leaving routine #ifdef _WIN64 + __ lea(rsp, Address(rbp, -6 * wordSize)); __ pop(rsi); +#else + __ lea(rsp, Address(rbp, -5 * wordSize)); #endif __ pop(rbx); __ pop(r15);