Integrated: 8356275: TestCodeEntryAlignment fails with "Alignment must be <= CodeEntryAlignment"

Marc Chevalier mchevalier at openjdk.org
Tue May 13 11:29:56 UTC 2025


On Mon, 12 May 2025 10:48:06 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

> In the [original code](https://github.com/intel/intel-ipsec-mb/blob/9b607277c75dc7994615700a7ebd5d02e74b52a7/lib/avx2_t4/sha512_x1_ni_avx2.asm#L153), we have an `align 32` here.
> 
> This alignment is pure optimization: we align the head of the loop to make the CPU happier. But if we set `CodeEntryAlignment` to 16, the 32 alignment makes an assert fail. Let's align to `CodeEntryAlignment` instead. It should be 32 by default, but if someone has a different opinion, it's still fine. Anyway, this alignment doesn't seem useful for correctness, so the consequences of an insufficient alignment are small. On the other hand, if someone wants to set `CodeEntryAlignment` to 64 for instance, it's also ok: 64-bit alignment is also a 32-bit alignment. We just lose a bit of space for no good reason but the user's input stating that we should prefer 64-bit alignment.
> 
> It seems questionable to me whether there is any sense in overriding the alignment when using such advanced features, that only exists on modern enough CPUs, so not with a 16-bit alignment, but for consistency, I suppose.

This pull request has now been integrated.

Changeset: d930dc5d
Author:    Marc Chevalier <mchevalier at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/d930dc5df376268d3d96ac5dcddc47496459f5c0
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

8356275: TestCodeEntryAlignment fails with "Alignment must be <= CodeEntryAlignment"

Reviewed-by: thartmann

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

PR: https://git.openjdk.org/jdk/pull/25180


More information about the hotspot-dev mailing list