================
@@ -459,6 +458,116 @@ In certain cases, guards may be hoisted outside of loops.
 |                       |                               |
 +-----------------------+-------------------------------+
 
+X86-64
+++++++
+
+The X86-64 LFI target is ``x86_64_lfi``.
+
+Reserved Registers
+==================
+
+The X86-64 LFI target reserves the following registers:
+
+* ``r14``: always holds the sandbox base address. Also used as the runtime call
+  table pointer (the runtime call table is stored at the sandbox base).
+* ``gs``: always holds the sandbox base address (used as a segment register for
+  memory access sandboxing).
+* ``rsp``: always holds an address within the sandbox.
+* ``r15``: context register (see `Context Register`_).
+* ``r11``: scratch register.
+
+Assembly Rewrites
+=================
+
+Terminology
+~~~~~~~~~~~
+
+In the following assembly rewrites, some shorthand is used.
+
+* ``%rN`` or ``%eN``: refers to any general-purpose non-reserved register.
+* ``{a,b,c}``: matches any of ``a``, ``b``, or ``c``.
+
+Control flow
+~~~~~~~~~~~~
+
+**Note**: these rewrites have not been implemented.
+
+Memory accesses
+~~~~~~~~~~~~~~~
+
+**Note**: these rewrites have not been implemented.
+
+String instructions
+~~~~~~~~~~~~~~~~~~~
+
+**Note**: these rewrites have not been implemented.
+
+Stack modification
+~~~~~~~~~~~~~~~~~~
+
+**Note**: these rewrites have not been implemented.
+
+System instructions
+~~~~~~~~~~~~~~~~~~~
+
+System calls are rewritten into a sequence that loads the return address into
+the scratch register and jumps to the runtime call handler. The runtime call
+handler table is stored at the address pointed to by ``r14``.
----------------
nickdesaulniers wrote:

So `r11` is an index into `.Ltmp` (perhaps which syscall)? Perhaps make that 
explicit in this comment block.

https://github.com/llvm/llvm-project/pull/189569
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to