On Mon, 7 Feb 2022 11:41:57 GMT, Alan Hayward <d...@openjdk.java.net> wrote:

>> src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 5328:
>> 
>>> 5326: // Uses the FP from the start of the function as the modifier - which 
>>> is stored at the address of
>>> 5327: // the current FP.
>>> 5328: //
>> 
>> Is it? C2 uses FP as a scratch register. I guess we know that this is never 
>> used in C2-generated code? I'm tempted to put an assertion here, just in 
>> case. Or does it not matter?
>
> Allocating FP is disabled for rop protection:
> 
> aarch64.md has:
> // r29 is not allocatable when PreserveFramePointer or ROP protection is on
> if (PreserveFramePointer || VM_Version::use_rop_protection()) {
> 
> I think that covers it.
> What assertion would you want to check?

If `UseROPProtection` is on, is there any reason not to set 
`PreserveFramePointer`, and assert here that it is set? It is a crucial 
assumption, so let's assert it.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6334

Reply via email to