On Sat, 21 Nov 2026 09:50:58 GMT, Andrew Haley <[email protected]> wrote:

>> Ashay Rane has updated the pull request with a new target base due to a 
>> merge or a rebase. The incremental webrev excludes the unrelated changes 
>> brought in by the merge/rebase. The pull request contains 10 additional 
>> commits since the last revision:
>> 
>>  - Merge branch 'master' into JDK-8395991-windows-arm64-jit-pac-ret
>>  - Make IO.java less brittle by permitting HotSpot warnings
>>    
>>    Also update DataDumpDcmdTest.java and LoadAgentDcmdTest.java to use
>>    `OutputAnalyzer.stderrShouldBeEmptyIgnoreVMWarnings()`.
>>  - Merge branch 'master' into JDK-8395991-windows-arm64-jit-pac-ret
>>  - Enable branch protection in CI on just Windows/ARM64
>>    
>>    We deliberately do not enable it on Linux/AArch64 so that depending on
>>    whether a failure happens on both Windows/ARM64 and Linux/AArch64 (and
>>    assuming that the failure is unrelated to the OS), we have a better
>>    chance of knowing whether the failure is related to branch protection.
>>  - Merge branch 'master' into JDK-8395991-windows-arm64-jit-pac-ret
>>  - Merge branch 'master' into JDK-8395991-windows-arm64-jit-pac-ret
>>  - Enable branch protection checks in CI build
>>    
>>    The intent behind this change is to make CI catch subtle bugs that
>>    corrupt return addresses.  Whether the protection is actually enforced
>>    depends on whether the GitHub runner uses an AArch64 processor that
>>    supports pointer authentication.
>>  - Merge branch 'master' into JDK-8395991-windows-arm64-jit-pac-ret
>>  - Documentation updates
>>    
>>    - Include section numbers from ARM ISA document
>>    - Mark branch protection on Windows/ARM64 as supported
>>  - Enable pointer authentication for JIT code on Windows/ARM64
>>    
>>    This patch enables PAC and AUT instructions for pointer signing and
>>    authentication in JIT code on Windows/ARM64 when "UseBranchProtection"
>>    flag is set and when the processor supports the feature.
>>    
>>    Specifically, JVM detects hardware support by reading ID_AA64ISAR1_EL1
>>    and ID_AA64ISAR2_EL1 registers via CP4031 and CP4032 keys in the Windows
>>    registry.  Then, if the "UseBranchProtection" flag is set, then HotSpot
>>    emits the signing and authenticating instructions.  Windows uses
>>    AArch64's "B" key, so this patch selects between "paciaz" and "pacibz"
>>    instructions (and similarly, between "autiaz" and "autibz" instructions)
>>    depending on whether HotSpot is being compiled for Linux versus Windows.
>>    Both the MacroAssembler and the Windows' P...
>
> src/hotspot/os_cpu/windows_aarch64/pauth_windows_aarch64.S line 59:
> 
>> 57: 
>> 58:     ALIGN  4
>> 59:     EXPORT pauth_auth_win_arm64
> 
> Does Windows asm not support the `.arch` directive or equivalent?

Unfortunately, no.  
[Here](https://learn.microsoft.com/en-us/cpp/assembler/arm/arm-assembler-directives?view=msvc-170)
 is the full list of supported directives.

I presume that a similar directive would allow us to replace the hint 
instructions with proper mnemonics, but even the Linux port uses hint 
instructions to support older compilers/assemblers:

from 
[src/hotspot/os_cpu/linux_aarch64/pauth_linux_aarch64.inline.hpp](https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/linux_aarch64/pauth_linux_aarch64.inline.hpp#L33-L37):

```c++
// Write these instructions using their alternate "hint" instructions to
// ensure older compilers can still be used.
#define XPACLRI "hint #0x7;"
#define PACIAZ  "hint #0x18;"
#define AUTIAZ  "hint #0x1c;"

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33595#discussion_r4654307255

Reply via email to