On Sun, Mar 25, 2012 at 2:34 PM, H. Peter Anvin [off-list ref] wrote:
On 03/14/2012 08:11 PM, Will Drewry wrote:
quoted
+static inline int syscall_get_arch(struct task_struct *task,
+ struct pt_regs *regs)
+{
+#ifdef CONFIG_IA32_EMULATION
+ /*
+ * TS_COMPAT is set for 32-bit syscall entries and then
+ * remains set until we return to user mode.
+ *
+ * TIF_IA32 tasks should always have TS_COMPAT set at
+ * system call time.
+ */
+ if (task_thread_info(task)->status & TS_COMPAT)
+ return AUDIT_ARCH_I386;
+#endif
+ return AUDIT_ARCH_X86_64;
+}
#endif /* CONFIG_X86_32 */
#endif /* _ASM_X86_SYSCALL_H */
Just one FYI on this: after the x32 changes are upstream this can be
implemented in terms of is_ia32_task().
Now that I've seen is_ia32_task(), it appears to be exactly the same as above:
(1) If we're x86_32, it's ia32
(2) If we're x86_64, ia32 == !!(status & TS_COMPAT)
(3) Otherwise, it's x86_64, including x32
Am I missing something? Should is_ia32_task(void) take a task_struct?
Right now, I don't see any reason to change the code, as posted, but
maybe I am mis-reading?
thanks!
will