OSDN Git Service

Merge branch 'kvm/kvm-sls-fix'
[uclinux-h8/linux.git] / arch / x86 / kvm / emulate.c
index e86d610..d98fb36 100644 (file)
 #define X16(x...) X8(x), X8(x)
 
 #define NR_FASTOP (ilog2(sizeof(ulong)) + 1)
-#define FASTOP_SIZE 8
+#define FASTOP_SIZE (8 * (1 + HAS_KERNEL_IBT))
 
 struct opcode {
        u64 flags;
@@ -311,7 +311,8 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop);
 #define __FOP_FUNC(name) \
        ".align " __stringify(FASTOP_SIZE) " \n\t" \
        ".type " name ", @function \n\t" \
-       name ":\n\t"
+       name ":\n\t" \
+       ASM_ENDBR
 
 #define FOP_FUNC(name) \
        __FOP_FUNC(#name)
@@ -448,6 +449,7 @@ static_assert(SETCC_LENGTH <= SETCC_ALIGN);
        ".align " __stringify(SETCC_ALIGN) " \n\t" \
        ".type " #op ", @function \n\t" \
        #op ": \n\t" \
+       ASM_ENDBR \
        #op " %al \n\t" \
        __FOP_RET(#op)