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

Tobias Hartmann thartmann at openjdk.org
Tue May 13 10:33:55 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.

Looks good and trivial to me.

>  The fixVersion in this issue is [26] but the fixVersion in .jcheck/conf is 25, a new backport will be created when this pr is integrated.)

Please make sure to set the fixVersion to 25 or tbd before integrating this.

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

Marked as reviewed by thartmann (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25180#pullrequestreview-2836176494
PR Comment: https://git.openjdk.org/jdk/pull/25180#issuecomment-2875945630


More information about the hotspot-dev mailing list