]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
Work around Clang IAS error with XSA-304
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 3 Oct 2023 10:05:22 +0000 (11:05 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 3 Oct 2023 10:44:51 +0000 (11:44 +0100)
Clang complains:

  <inline asm>: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 <andrew.cooper3@citrix.com>
tests/xsa-304/main.c

index 7f8be08ef410a92a7502275ed0c8edd153c5b48e..5d343e9720b1b3fc51819b0b6934b815d74ac996 100644 (file)
@@ -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