[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-b0b9b014016d16ca7a192da986aa8ebae21bb995@git.kernel.org>
Date: Mon, 20 Mar 2017 09:33:15 -0700
From: tip-bot for Kyle Huey <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: nadav.amit@...il.com, grzegorz.andrejczuk@...el.com,
dave.hansen@...ux.intel.com, andi@...stfloor.org,
pbonzini@...hat.com, viro@...iv.linux.org.uk, robert@...llahan.org,
hpa@...or.com, bp@...e.de, rafael.j.wysocki@...el.com,
dmatlack@...gle.com, peterz@...radead.org, luto@...nel.org,
boris.ostrovsky@...cle.com, me@...ehuey.com, shuah@...nel.org,
richard@....at, linux-kernel@...r.kernel.org, len.brown@...el.com,
khuey@...ehuey.com, rkrcmar@...hat.com, tglx@...utronix.de,
dsafonov@...tuozzo.com, jdike@...toit.com, mingo@...nel.org
Subject: [tip:x86/process] x86/arch_prctl: Add do_arch_prctl_common()
Commit-ID: b0b9b014016d16ca7a192da986aa8ebae21bb995
Gitweb: http://git.kernel.org/tip/b0b9b014016d16ca7a192da986aa8ebae21bb995
Author: Kyle Huey <me@...ehuey.com>
AuthorDate: Mon, 20 Mar 2017 01:16:23 -0700
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Mon, 20 Mar 2017 16:10:33 +0100
x86/arch_prctl: Add do_arch_prctl_common()
Add do_arch_prctl_common() to handle arch_prctls that are not specific to 64
bit mode. Call it from the syscall entry point, but not any of the other
callsites in the kernel, which all want one of the existing 64 bit only
arch_prctls.
Signed-off-by: Kyle Huey <khuey@...ehuey.com>
Cc: Grzegorz Andrejczuk <grzegorz.andrejczuk@...el.com>
Cc: kvm@...r.kernel.org
Cc: Radim Krčmář <rkrcmar@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Andi Kleen <andi@...stfloor.org>
Cc: linux-kselftest@...r.kernel.org
Cc: Nadav Amit <nadav.amit@...il.com>
Cc: Robert O'Callahan <robert@...llahan.org>
Cc: Richard Weinberger <richard@....at>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
Cc: Borislav Petkov <bp@...e.de>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Len Brown <len.brown@...el.com>
Cc: Shuah Khan <shuah@...nel.org>
Cc: user-mode-linux-devel@...ts.sourceforge.net
Cc: Jeff Dike <jdike@...toit.com>
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: user-mode-linux-user@...ts.sourceforge.net
Cc: David Matlack <dmatlack@...gle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@...cle.com>
Cc: Dmitry Safonov <dsafonov@...tuozzo.com>
Cc: linux-fsdevel@...r.kernel.org
Cc: Paolo Bonzini <pbonzini@...hat.com>
Link: http://lkml.kernel.org/r/20170320081628.18952-6-khuey@kylehuey.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
arch/x86/include/asm/proto.h | 3 +++
arch/x86/kernel/process.c | 6 ++++++
arch/x86/kernel/process_64.c | 8 +++++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index 4e276f6..8d3964f 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -31,4 +31,7 @@ void x86_report_nx(void);
extern int reboot_force;
+long do_arch_prctl_common(struct task_struct *task, int option,
+ unsigned long cpuid_enabled);
+
#endif /* _ASM_X86_PROTO_H */
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 366db77..b12e95e 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -545,3 +545,9 @@ out:
put_task_stack(p);
return ret;
}
+
+long do_arch_prctl_common(struct task_struct *task, int option,
+ unsigned long cpuid_enabled)
+{
+ return -EINVAL;
+}
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index e37f764..d81b0a6 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -626,7 +626,13 @@ long do_arch_prctl_64(struct task_struct *task, int option, unsigned long arg2)
SYSCALL_DEFINE2(arch_prctl, int, option, unsigned long, arg2)
{
- return do_arch_prctl_64(current, option, arg2);
+ long ret;
+
+ ret = do_arch_prctl_64(current, option, arg2);
+ if (ret == -EINVAL)
+ ret = do_arch_prctl_common(current, option, arg2);
+
+ return ret;
}
unsigned long KSTK_ESP(struct task_struct *task)
Powered by blists - more mailing lists