File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 24
24
#include <linux/stringify.h>
25
25
#include <asm/debugreg.h>
26
26
#include <asm/nospec-branch.h>
27
+ #include <asm/ibt.h>
27
28
28
29
#include "x86.h"
29
30
#include "tss.h"
@@ -434,15 +435,16 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
434
435
/*
435
436
* Depending on .config the SETcc functions look like:
436
437
*
438
+ * ENDBR [4 bytes; CONFIG_X86_KERNEL_IBT]
437
439
* SETcc %al [3 bytes]
438
440
* RET [1 byte]
439
441
* INT3 [1 byte; CONFIG_SLS]
440
442
*
441
- * Which gives possible sizes 4 or 5 . When rounded up to the
442
- * next power-of-two alignment they become 4 or 8 .
443
+ * Which gives possible sizes 4, 5, 8 or 9 . When rounded up to the
444
+ * next power-of-two alignment they become 4, 8 or 16 resp .
443
445
*/
444
- #define SETCC_LENGTH (4 + IS_ENABLED(CONFIG_SLS))
445
- #define SETCC_ALIGN (4 << IS_ENABLED(CONFIG_SLS))
446
+ #define SETCC_LENGTH (ENDBR_INSN_SIZE + 4 + IS_ENABLED(CONFIG_SLS))
447
+ #define SETCC_ALIGN (4 << IS_ENABLED(CONFIG_SLS) << HAS_KERNEL_IBT )
446
448
static_assert (SETCC_LENGTH <= SETCC_ALIGN );
447
449
448
450
#define FOP_SETCC (op ) \
You can’t perform that action at this time.
0 commit comments