Merge tag 'x86-asm-2021-06-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
[linux-2.6-microblaze.git] / arch / x86 / kernel / cpu / common.c
index 212e8bc..a99d003 100644 (file)
@@ -1773,10 +1773,16 @@ void syscall_init(void)
        wrmsrl_safe(MSR_IA32_SYSENTER_EIP, 0ULL);
 #endif
 
-       /* Flags to clear on syscall */
+       /*
+        * Flags to clear on syscall; clear as much as possible
+        * to minimize user space-kernel interference.
+        */
        wrmsrl(MSR_SYSCALL_MASK,
-              X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF|
-              X86_EFLAGS_IOPL|X86_EFLAGS_AC|X86_EFLAGS_NT);
+              X86_EFLAGS_CF|X86_EFLAGS_PF|X86_EFLAGS_AF|
+              X86_EFLAGS_ZF|X86_EFLAGS_SF|X86_EFLAGS_TF|
+              X86_EFLAGS_IF|X86_EFLAGS_DF|X86_EFLAGS_OF|
+              X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_RF|
+              X86_EFLAGS_AC|X86_EFLAGS_ID);
 }
 
 #else  /* CONFIG_X86_64 */