diff --cc arch/x86/include/asm/disabled-features.h index fafe9be7a6f4,652e366b68a0..000000000000 --- a/arch/x86/include/asm/disabled-features.h +++ b/arch/x86/include/asm/disabled-features.h @@@ -120,8 -126,8 +132,13 @@@ #define DISABLED_MASK9 (DISABLE_SGX) #define DISABLED_MASK10 0 #define DISABLED_MASK11 (DISABLE_RETPOLINE|DISABLE_RETHUNK|DISABLE_UNRET| \ ++<<<<<<< HEAD + DISABLE_CALL_DEPTH_TRACKING) +#define DISABLED_MASK12 (DISABLE_LAM) ++======= + DISABLE_CALL_DEPTH_TRACKING|DISABLE_USER_SHSTK) + #define DISABLED_MASK12 0 ++>>>>>>> tip/x86/shstk #define DISABLED_MASK13 0 #define DISABLED_MASK14 0 #define DISABLED_MASK15 0 diff --cc arch/x86/include/uapi/asm/prctl.h index eb290d89cb32,1b85bc876c2d..000000000000 --- a/arch/x86/include/uapi/asm/prctl.h +++ b/arch/x86/include/uapi/asm/prctl.h @@@ -20,9 -20,16 +20,23 @@@ #define ARCH_MAP_VDSO_32 0x2002 #define ARCH_MAP_VDSO_64 0x2003 ++<<<<<<< HEAD +#define ARCH_GET_UNTAG_MASK 0x4001 +#define ARCH_ENABLE_TAGGED_ADDR 0x4002 +#define ARCH_GET_MAX_TAG_BITS 0x4003 +#define ARCH_FORCE_TAGGED_SVA 0x4004 ++======= + /* Don't use 0x3001-0x3004 because of old glibcs */ + + #define ARCH_SHSTK_ENABLE 0x5001 + #define ARCH_SHSTK_DISABLE 0x5002 + #define ARCH_SHSTK_LOCK 0x5003 + #define ARCH_SHSTK_UNLOCK 0x5004 + #define ARCH_SHSTK_STATUS 0x5005 + + /* ARCH_SHSTK_ features bits */ + #define ARCH_SHSTK_SHSTK (1ULL << 0) + #define ARCH_SHSTK_WRSS (1ULL << 1) ++>>>>>>> tip/x86/shstk #endif /* _ASM_X86_PRCTL_H */ diff --cc arch/x86/kernel/process.c index 50d950771371,8bf13cff0141..000000000000 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@@ -48,7 -48,7 +48,11 @@@ #include #include #include ++<<<<<<< HEAD +#include ++======= + #include ++>>>>>>> tip/x86/shstk #include "process.h" diff --cc arch/x86/kernel/process_64.c index b46924c9e46d,31241930b60c..000000000000 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@@ -876,21 -832,12 +878,30 @@@ long do_arch_prctl_64(struct task_struc case ARCH_MAP_VDSO_64: return prctl_map_vdso(&vdso_image_64, arg2); #endif ++<<<<<<< HEAD +#ifdef CONFIG_ADDRESS_MASKING + case ARCH_GET_UNTAG_MASK: + return put_user(task->mm->context.untag_mask, + (unsigned long __user *)arg2); + case ARCH_ENABLE_TAGGED_ADDR: + return prctl_enable_tagged_addr(task->mm, arg2); + case ARCH_FORCE_TAGGED_SVA: + set_bit(MM_CONTEXT_FORCE_TAGGED_SVA, &task->mm->context.flags); + return 0; + case ARCH_GET_MAX_TAG_BITS: + if (!cpu_feature_enabled(X86_FEATURE_LAM)) + return put_user(0, (unsigned long __user *)arg2); + else + return put_user(LAM_U57_BITS, (unsigned long __user *)arg2); +#endif ++======= + case ARCH_SHSTK_ENABLE: + case ARCH_SHSTK_DISABLE: + case ARCH_SHSTK_LOCK: + case ARCH_SHSTK_UNLOCK: + case ARCH_SHSTK_STATUS: + return shstk_prctl(task, option, arg2); ++>>>>>>> tip/x86/shstk default: ret = -EINVAL; break; diff --cc fs/proc/array.c index 6daea628bc76,3e1a33dcd0d0..000000000000 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@@ -424,9 -423,9 +424,15 @@@ static inline void task_thp_status(stru seq_printf(m, "THP_enabled:\t%d\n", thp_enabled); } ++<<<<<<< HEAD +static inline void task_untag_mask(struct seq_file *m, struct mm_struct *mm) +{ + seq_printf(m, "untag_mask:\t%#lx\n", mm_untag_mask(mm)); ++======= + __weak void arch_proc_pid_thread_features(struct seq_file *m, + struct task_struct *task) + { ++>>>>>>> tip/x86/shstk } int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, diff --cc tools/testing/selftests/x86/Makefile index 598135d3162b,cfc8a26ad151..000000000000 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@@ -18,7 -18,7 +18,11 @@@ TARGETS_C_32BIT_ONLY := entry_from_vm8 test_FCMOV test_FCOMI test_FISTTP \ vdso_restorer TARGETS_C_64BIT_ONLY := fsgsbase sysret_rip syscall_numbering \ ++<<<<<<< HEAD + corrupt_xstate_header amx lam ++======= + corrupt_xstate_header amx test_shadow_stack ++>>>>>>> tip/x86/shstk # Some selftests require 32bit support enabled also on 64bit systems TARGETS_C_32BIT_NEEDED := ldt_gdt ptrace_syscall