From f0dd2fbc094598c625e96748f6ac64acec8fc725 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Tue, 3 Oct 2023 11:05:22 +0100 Subject: [PATCH] Work around Clang IAS error with XSA-304 Clang complains: :1:19: error: expected assembly-time absolute expression .align 4096;.skip 4096 - (stub_page_boundary - stub_fn); ^ Opencode the je Links: https://github.com/llvm/llvm-project/issues/68086 Signed-off-by: Andrew Cooper --- tests/xsa-304/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/xsa-304/main.c b/tests/xsa-304/main.c index 7f8be08..5d343e9 100644 --- a/tests/xsa-304/main.c +++ b/tests/xsa-304/main.c @@ -46,9 +46,12 @@ asm (".align 4096;" /* * %rsi points at `bool cond = true` on the stack, so this jump won't * actually be taken, but we want speculation to follow it. + * + * Work around https://github.com/llvm/llvm-project/issues/68086 + * Clang IAS can't cope with `je 1f` so opencode it. */ " cmpb $0, (%rsi);" - " je 1f;" + " .byte 0x74, 1f - (. + 1);" // je 1f /* * Write into the top of linear address space. Because no A/D bits are -- 2.39.5