[PATCH v3] ARM: tegra124: pmu support

2015-06-16 Thread Kyle Huey
This patch modifies the device tree for tegra124 based devices to enable the Cortex A15 PMU. The interrupt numbers are taken from NVIDIA TRM DP-06905-001_v03p. This patch was tested on a Jetson TK1. Updated for proper ordering and to add interrupt-affinity values. Signed-off-by: Kyle Huey kh

[PATCH v2] ARM: tegra124: pmu support

2015-06-15 Thread Kyle Huey
This patch modifies the device tree for tegra124 based devices to enable the Cortex A15 PMU. The interrupt numbers are taken from NVIDIA TRM DP-06905-001_v03p. This patch was tested on a Jetson TK1. Signed-off-by: Kyle Huey kh...@kylehuey.com --- arch/arm/boot/dts/tegra124.dtsi | 8

Re: [RESEND PATCH v3] ARM: tegra124: pmu support

2015-07-27 Thread Kyle Huey
On Sat, Jul 18, 2015 at 6:54 AM, Kyle Huey m...@kylehuey.com wrote: On Fri, Jul 17, 2015 at 4:59 PM, Thierry Reding thierry.red...@gmail.com wrote: On Mon, Jul 13, 2015 at 10:35:45AM -0700, Kyle Huey wrote: This patch modifies the device tree for tegra124 based devices to enable the Cortex

Re: [RESEND PATCH v3] ARM: tegra124: pmu support

2015-07-18 Thread Kyle Huey
On Fri, Jul 17, 2015 at 4:59 PM, Thierry Reding thierry.red...@gmail.com wrote: On Mon, Jul 13, 2015 at 10:35:45AM -0700, Kyle Huey wrote: This patch modifies the device tree for tegra124 based devices to enable the Cortex A15 PMU. The interrupt numbers are taken from NVIDIA TRM DP-06905

[RESEND PATCH v3] ARM: tegra124: pmu support

2015-07-13 Thread Kyle Huey
This patch modifies the device tree for tegra124 based devices to enable the Cortex A15 PMU. The interrupt numbers are taken from NVIDIA TRM DP-06905-001_v03p. This patch was tested on a Jetson TK1. Updated for proper ordering and to add interrupt-affinity values. Signed-off-by: Kyle Huey kh

[PATCH] ARM: ptrace: Implement PTRACE_SYSEMU

2015-07-21 Thread Kyle Huey
it to be present if PTRACE_SYSEMU is present. Attempting to use PTRACE_SYSEMU_SINGLESTEP will fail at runtime on ARM with EIO since there is no single stepping on ARM. Signed-off-by: Kyle Huey kh...@kylehuey.com --- arch/arm/include/asm/thread_info.h | 8 ++-- arch/arm/include/uapi/asm/ptrace.h | 32

Re: [PATCH] seccomp: Fix tracer exit notifications during fatal signals

2016-08-10 Thread Kyle Huey
at there is a fatal > signal pending and changes its state from TASK_TRACED to TASK_RUNNING. > That prevents the ptracer's waitpid() from returning the ptrace event. > A more detailed analysis is here: > https://github.com/mozilla/rr/issues/1762#issuecomment-237396255. > > R

[PATCH] seccomp: suppress fatal signals that will never be delivered before seccomp forces an exit because of said signals

2016-08-10 Thread Kyle Huey
/khuey/3c43ac247c72cef8c956c does pass. I don't see any obvious way to dequeue only the fatal signal, so instead I dequeue them all. Since none of these signals will ever be delivered it shouldn't affect the executing task. Suggested-by: Robert O'Callahan <rob...@ocallahan.org> Signed-off-by

[PATCH v14 6/9] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID

2017-02-08 Thread Kyle Huey
DEV if CPUID faulting is not supported on this system. The state of the CPUID faulting flag is propagated across forks, but reset upon exec. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/msr-index.h | 3 ++ arch/x86/include/asm/processor.h | 2 + arch/x86/in

[PATCH v14 8/9] KVM: x86: virtualize cpuid faulting

2017-02-08 Thread Kyle Huey
. kvm_require_cpl is even kind enough to inject the GP fault for us. Signed-off-by: Kyle Huey <kh...@kylehuey.com> Reviewed-by: David Matlack <dmatl...@google.com> --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/cpuid.c| 3 +++ arch/x86/kvm/cpuid.h| 11 +++

[PATCH v14 0/9] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2017-02-08 Thread Kyle Huey
rr (http://rr-project.org/), a userspace record-and-replay reverse- execution debugger, would like to trap and emulate the CPUID instruction. This would allow us to a) mask away certain hardware features that rr does not support (e.g. RDRAND) and b) enable trace portability across machines by

[PATCH v14 7/9] x86/arch_prctl: Selftest for ARCH_[GET|SET]_CPUID

2017-02-08 Thread Kyle Huey
Test disabling and reenabling the cpuid instruction via the new arch_prctl ARCH_SET_CPUID, retrieving the current state via ARCH_GET_CPUID, and the expected behaviors across fork() and exec(). Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- tools/testing/selftests/x86/Makefile

[PATCH v14 9/9] x86/arch_prctl: Rename 'code' argument to 'option'

2017-02-08 Thread Kyle Huey
arch_prctl arbitrarily changed prctl's 'option' to 'code'. Now that we're adding additional options, fix that. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/um/include/shared/os.h | 2 +- arch/x86/include/asm/proto.h | 4 ++-- arch/x86/kernel/pro

[PATCH v14 3/9] x86/arch_prctl: Add do_arch_prctl_common

2017-02-08 Thread Kyle Huey
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 <kh...@kylehuey.com> --- ar

[PATCH v14 4/9] x86/syscalls/32: Wire up arch_prctl on x86-32

2017-02-08 Thread Kyle Huey
Hook up arch_prctl to call do_arch_prctl() on x86-32, and in 32 bit compat mode on x86-64. This allows us to have arch_prctls that are not specific to 64 bits. On UML, simply stub out this syscall. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/entry/syscalls/syscall_32.t

[PATCH v14 5/9] x86/cpufeature: Detect CPUID faulting support

2017-02-08 Thread Kyle Huey
ure. It is documented in detail in Section 2.3.2 of https://bugzilla.kernel.org/attachment.cgi?id=243991 Detect support for this feature and expose it as X86_FEATURE_CPUID_FAULT. Signed-off-by: Kyle Huey <kh...@kylehuey.com> Reviewed-by: Borislav Petkov <b...@suse.de> --- arch/

[PATCH v14 1/9] x86/arch_prctl/64: Use SYSCALL_DEFINE2 to define sys_arch_prctl

2017-02-08 Thread Kyle Huey
Use the SYSCALL_DEFINE2 macro instead of manually defining it. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/kernel/process_64.c | 3 ++- arch/x86/um/syscalls_64.c| 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/process_64.c b/ar

[PATCH v14 2/9] x86/arch_prctl/64: Rename do_arch_prctl to do_arch_prctl_64

2017-02-08 Thread Kyle Huey
In order to introduce new arch_prctls that are not 64 bit only, rename the existing 64 bit implementation to do_arch_prctl_64(). Also rename the second argument to arch_prctl(), which will no longer always be an address. Signed-off-by: Kyle Huey <kh...@kylehuey.com> Reviewed-by: Andy Luto

[PATCH v2 2/3] x86/process: Correct and optimize TIF_BLOCKSTEP switch

2017-02-14 Thread Kyle Huey
EBUGCTLMSR. x86_64: arch/x86/kernel/process.o textdatabss dec hex 3024857716 116172d61 Before 3008857716 116012d51 After i386: No change Originally-by: Thomas Gleixner <t...@linutronix.de> Signed-off-by: Kyle Huey <kh...@kylehuey.com>

[PATCH v2 0/3] x86/process: Optimize __switch_to_xtra()

2017-02-14 Thread Kyle Huey
GCC generates lousy code in __switch_to_xtra. This patch series is an updated version of tglx's patches from last year (https://lkml.org/lkml/2016/12/15/432) that address review comments. Since v1: Part 1 - x86/process: Optimize TIF checks in __switch_to_xtra() - READ_ONCE annotations added as

[PATCH v2 3/3] x86/process: Optimize TIF_NOTSC switch

2017-02-14 Thread Kyle Huey
From: Thomas Gleixner Provide and use a toggle helper instead of doing it with a branch. x86_64: arch/x86/kernel/process.o text data bss dec hex 3008 8577 16 116012d51 Before 2976 8577 16 115692d31 After i386:

[PATCH v2 1/3] x86/process: Optimize TIF checks in __switch_to_xtra()

2017-02-14 Thread Kyle Huey
ed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/kernel/process.c | 54 +++ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index b615a1113f58..01ef6f63d5fb 100644 --- a/arc

Re: [PATCH v2 0/3] x86/process: Optimize __switch_to_xtra()

2017-02-28 Thread Kyle Huey
On Tue, Feb 14, 2017 at 12:11 AM, Kyle Huey <m...@kylehuey.com> wrote: > GCC generates lousy code in __switch_to_xtra. This patch series is an > updated version of tglx's patches from last year > (https://lkml.org/lkml/2016/12/15/432) that address review comments. > > Sin

[PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction.

2016-09-11 Thread Kyle Huey
-technology-flexmigration-application-note.pdf. I would like to thank Trevor Saunders <tbsau...@tbsaunde.org> for drafting an earlier version of this patch. Signed-off-by Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/proces

Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction.

2016-09-13 Thread Kyle Huey
On Mon, Sep 12, 2016 at 7:15 AM, Kyle Huey <m...@kylehuey.com> wrote: > On Mon, Sep 12, 2016 at 2:07 AM, Borislav Petkov <b...@suse.de> wrote: >> On Sun, Sep 11, 2016 at 05:29:23PM -0700, Kyle Huey wrote: >>> @@ -2162,6 +2168,12 @@ SYSCALL_DEFINE5(prctl, int, op

[PATCH v2 1/3] syscalls,x86 Expose arch_prctl on x86-32.

2016-09-14 Thread Kyle Huey
Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/kernel/process.c | 80 ++ arch/x86/kernel/process_64.c | 66 3 files changed, 81 insertions(

[PATCH v2 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo

2016-09-14 Thread Kyle Huey
Xen advertises the underlying support for CPUID faulting but not does pass through writes to the relevant MSR, nor does it virtualize it, so it does not actually work. For now mask off the relevant bit on MSR_PLATFORM_INFO. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/inclu

[PATCH v2 3/3] x86,arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-14 Thread Kyle Huey
-flexmigration-application-note.pdf Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/thread_info.h| 4 +- arch/x86/include/uapi/asm/prctl.h | 6 + arch/x86/kernel/process.c | 81 +++

[RESEND][PATCH v2 1/3] syscalls,x86 Expose arch_prctl on x86-32.

2016-09-14 Thread Kyle Huey
Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/kernel/process.c | 80 ++ arch/x86/kernel/process_64.c | 66 3 files changed, 81 insertions(

Re: [PATCH v2 1/3] syscalls,x86 Expose arch_prctl on x86-32.

2016-09-14 Thread Kyle Huey
On Wed, Sep 14, 2016 at 2:29 PM, Dave Hansen <dave.han...@linux.intel.com> wrote: > On 09/14/2016 02:01 PM, Kyle Huey wrote: >> Signed-off-by: Kyle Huey <kh...@kylehuey.com> >> --- >> arch/x86/entry/syscalls/syscall_32.tbl | 1 + >> arch

[RESEND][PATCH v2 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo

2016-09-14 Thread Kyle Huey
Xen advertises the underlying support for CPUID faulting but not does pass through writes to the relevant MSR, nor does it virtualize it, so it does not actually work. For now mask off the relevant bit on MSR_PLATFORM_INFO. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/inclu

[PATCH (man-pages)] arch_prctl.2: Note new support on x86-32, ARCH_[GET|SET]_CPUID.

2016-09-14 Thread Kyle Huey
Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- man2/arch_prctl.2 | 73 +-- 1 file changed, 60 insertions(+), 13 deletions(-) diff --git a/man2/arch_prctl.2 b/man2/arch_prctl.2 index 989d369..c388797 100644 --- a/man2/arch_prctl.2 +++

[RESEND][PATCH v2 3/3] x86,arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-14 Thread Kyle Huey
-flexmigration-application-note.pdf Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/thread_info.h| 4 +- arch/x86/include/uapi/asm/prctl.h | 6 + arch/x86/kernel/process.c | 81 +++

[RESEND][PATCH v2] arch_prctl,x86 Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-14 Thread Kyle Huey
(Resending because I screwed up the cover email, sorry about that.) rr (http://rr-project.org/), a userspace record-and-replay reverse- execution debugger, would like to trap and emulate the CPUID instruction. This would allow us to a) mask away certain hardware features that rr does not support

Re: [PATCH v2 1/3] syscalls,x86 Expose arch_prctl on x86-32.

2016-09-14 Thread Kyle Huey
On Wed, Sep 14, 2016 at 2:46 PM, Dave Hansen <dave.han...@linux.intel.com> wrote: > On 09/14/2016 02:35 PM, Kyle Huey wrote: >> It's not quite a plain move. To leave the existing arch_prctls only >> accessible to 64 bit callers, I added the is_32 bit and the four earl

Re: [RESEND][PATCH v2 1/3] syscalls,x86 Expose arch_prctl on x86-32.

2016-09-14 Thread Kyle Huey
On Wed, Sep 14, 2016 at 3:29 PM, Dmitry Safonov <0x7f454...@gmail.com> wrote: > 2016-09-15 1:08 GMT+03:00 Kyle Huey <m...@kylehuey.com>: >> On Wed, Sep 14, 2016 at 2:59 PM, Dmitry Safonov <0x7f454...@gmail.com> wrote: >>> 2016-09-15 0:08 GMT+03:00 Kyle Huey

Re: [PATCH v2 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo

2016-09-14 Thread Kyle Huey
On Wed, Sep 14, 2016 at 2:35 PM, Dave Hansen <dave.han...@linux.intel.com> wrote: > On 09/14/2016 02:01 PM, Kyle Huey wrote: >> Xen advertises the underlying support for CPUID faulting but not does pass >> through writes to the relevant MSR, nor does it virtualize it, so it

Re: [RESEND][PATCH v2 1/3] syscalls,x86 Expose arch_prctl on x86-32.

2016-09-14 Thread Kyle Huey
On Wed, Sep 14, 2016 at 2:59 PM, Dmitry Safonov <0x7f454...@gmail.com> wrote: > 2016-09-15 0:08 GMT+03:00 Kyle Huey <m...@kylehuey.com>: >> Signed-off-by: Kyle Huey <kh...@kylehuey.com> >> --- >> arch/x86/entry/syscalls/syscall_32.tbl | 1 + >>

Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction.

2016-09-14 Thread Kyle Huey
On Mon, Sep 12, 2016 at 9:56 AM, Andy Lutomirski wrote: > You should explicitly check that, if the > feature is set under Xen PV, then the MSR actually works as > advertised. This may require talking to the Xen folks to make sure > you're testing the right configuration.

Re: [PATCH v2 3/3] x86,arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-14 Thread Kyle Huey
On Wed, Sep 14, 2016 at 6:29 PM, Andy Lutomirski <l...@amacapital.net> wrote: > On Wed, Sep 14, 2016 at 2:01 PM, Kyle Huey <m...@kylehuey.com> wrote: >> Intel supports faulting on the CPUID instruction in newer processors. Bit >> 31 of MSR_PLATFORM_INFO advertis

Re: [Xen-devel] [PATCH v2 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo

2016-09-15 Thread Kyle Huey
On Thu, Sep 15, 2016 at 3:25 AM, Jan Beulich <jbeul...@suse.com> wrote: >>>> On 15.09.16 at 12:05, <david.vra...@citrix.com> wrote: >> On 14/09/16 22:01, Kyle Huey wrote: >>> Xen advertises the underlying support for CPUID faulting but not does pass >>&

[PATCH v3 3/3] x86,arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-15 Thread Kyle Huey
-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/thread_info.h| 5 +- arch/x86/include/uapi/asm/prctl.h | 6 + arch/x86/kernel/process.c | 98 - fs/

[PATCH v3] arch_prctl,x86 Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-15 Thread Kyle Huey
rr (http://rr-project.org/), a userspace record-and-replay reverse- execution debugger, would like to trap and emulate the CPUID instruction. This would allow us to a) mask away certain hardware features that rr does not support (e.g. RDRAND) and b) enable trace portability across machines by

[PATCH v3 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo

2016-09-15 Thread Kyle Huey
Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/msr-index.h | 1 + arch/x86/kernel/cpu/scattered.c| 14 ++ 3 files changed, 16 insertions(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/i

[PATCH v3 1/3] syscalls,x86 Expose arch_prctl on x86-32.

2016-09-15 Thread Kyle Huey
arch_prctl is currently 64-bit only. Wire it up for 32-bits, as a no-op for now. Rename the second arg to a more generic name. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/include/asm/proto.h | 5 - arch/x86/

Re: [Xen-devel] [PATCH v2 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo

2016-09-15 Thread Kyle Huey
On Thu, Sep 15, 2016 at 12:37 PM, Andy Lutomirski <l...@amacapital.net> wrote: > On Thu, Sep 15, 2016 at 12:11 PM, Kyle Huey <m...@kylehuey.com> wrote: >> On Thu, Sep 15, 2016 at 3:25 AM, Jan Beulich <jbeul...@suse.com> wrote: >>>>>> On 15.09

Re: [PATCH v3 3/3] x86,arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-15 Thread Kyle Huey
On Thu, Sep 15, 2016 at 5:07 PM, Andy Lutomirski <l...@amacapital.net> wrote: > On Thu, Sep 15, 2016 at 4:33 PM, Kyle Huey <m...@kylehuey.com> wrote: >> +int get_cpuid_mode(unsigned long adr) >> +{ >> + unsigned int val; >> + >

Re: [PATCH] prctl,x86 Add PR_[GET|SET]_CPUID for controlling the CPUID instruction.

2016-09-12 Thread Kyle Huey
Thanks for the review! On Mon, Sep 12, 2016 at 2:07 AM, Borislav Petkov <b...@suse.de> wrote: > On Sun, Sep 11, 2016 at 05:29:23PM -0700, Kyle Huey wrote: >> rr (http://rr-project.org/), a userspace record-and-replay reverse- >> execution debugger, would like to trap

Re: [PATCH v5 6/6] x86/arch_prctl Add ARCH_[GET|SET]_CPUID

2016-09-26 Thread Kyle Huey
On Thu, Sep 22, 2016 at 3:22 PM, Andy Lutomirski <l...@amacapital.net> wrote: > On Wed, Sep 21, 2016 at 11:58 AM, Kyle Huey <m...@kylehuey.com> wrote: >> Intel supports faulting on the CPUID instruction beginning with Ivy Bridge. >> When enabled, the processor will f

Re: [PATCH v2 3/3] x86,arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-14 Thread Kyle Huey
On Wed, Sep 14, 2016 at 6:54 PM, Andy Lutomirski <l...@amacapital.net> wrote: > On Wed, Sep 14, 2016 at 6:47 PM, Kyle Huey <m...@kylehuey.com> wrote: >> On Wed, Sep 14, 2016 at 6:29 PM, Andy Lutomirski <l...@amacapital.net> wrote: >>> On Wed, Sep 14, 2016 at 2

Re: [PATCH v2 2/3] x86 Test and expose CPUID faulting capabilities in /proc/cpuinfo

2016-09-14 Thread Kyle Huey
On Wed, Sep 14, 2016 at 6:17 PM, Andy Lutomirski <l...@amacapital.net> wrote: > On Wed, Sep 14, 2016 at 3:03 PM, Kyle Huey <m...@kylehuey.com> wrote: >> On Wed, Sep 14, 2016 at 2:35 PM, Dave Hansen >> <dave.han...@linux.intel.com> wrote: >>> On 09/14/20

[PATCH v5 4/6] x86/syscalls/32 Wire up arch_prctl on x86-32

2016-09-21 Thread Kyle Huey
Hook up arch_prctl to call do_arch_prctl on x86-32, and in 32 bit compat mode on x86-64. This allows us to have arch_prctls that are not specific to 64 bits. On UML, simply stub out this syscall. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/entry/syscalls/syscall_32.t

[PATCH v5 5/6] x86/cpufeature Detect CPUID faulting support

2016-09-21 Thread Kyle Huey
ure. It is documented in detail in Section 2.3.2 of http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/virtualization-technology-flexmigration-application-note.pdf Detect support for this feature and expose it as X86_FEATURE_CPUID_FAULT. Signed-off-by: Kyle Huey

[PATCH v5 1/6] x86/arch_prctl/64 Use SYSCALL_DEFINE2 to define sys_arch_prctl

2016-09-21 Thread Kyle Huey
Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/kernel/process_64.c | 3 ++- arch/x86/um/syscalls_64.c| 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 63236d8..4d6363c 100644 --- a/ar

[PATCH v5 6/6] x86/arch_prctl Add ARCH_[GET|SET]_CPUID

2016-09-21 Thread Kyle Huey
rg2 is another value or CPUID faulting is not supported on this system. The state of the CPUID faulting flag is propagated across forks, but reset upon exec. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/thread_info.h

[PATCH v5 3/6] x86/arch_prctl Add a new do_arch_prctl

2016-09-21 Thread Kyle Huey
Add a new do_arch_prctl to handle arch_prctls that are not specific to 64 bits. 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 <kh...@kylehuey.com> --- arch/x86/i

[PATCH v5 0/6] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-21 Thread Kyle Huey
rr (http://rr-project.org/), a userspace record-and-replay reverse- execution debugger, would like to trap and emulate the CPUID instruction. This would allow us to a) mask away certain hardware features that rr does not support (e.g. RDRAND) and b) enable trace portability across machines by

[PATCH v5 2/6] x86/arch_prctl/64 Rename do_arch_prctl to do_arch_prctl_64

2016-09-21 Thread Kyle Huey
In order to introduce new arch_prctls that are not 64 bit only, rename the existing 64 bit implementation to do_arch_prctl_64. Also rename the second argument to arch_prctl, which will no longer always be an address. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/p

[PATCH v4 2/6] x86/arch_prctl/64 Rename do_arch_prctl to do_arch_prctl_64

2016-09-18 Thread Kyle Huey
In order to introduce new arch_prctls that are not 64 bit only, rename the existing 64 bit implementation to do_arch_prctl_64. Also rename the second argument to arch_prctl, which will no longer always be an address. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/p

[PATCH v4 4/6] x86/syscalls/32 Wire up arch_prctl on x86-32

2016-09-18 Thread Kyle Huey
Hook up arch_prctl to call do_arch_prctl on x86-32, and in 32 bit compat mode on x86-64. This allows us to have arch_prctls that are not specific to 64 bits. On UML, simply stub out this syscall. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/entry/syscalls/syscall_32.t

[PATCH v4 6/6] x86/arch_prctl Add ARCH_[GET|SET]_CPUID

2016-09-18 Thread Kyle Huey
rg2 is another value or CPUID faulting is not supported on this system. The state of the CPUID faulting flag is propagated across forks, but reset upon exec. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/thread_info.h

[PATCH v4 3/6] x86/arch_prctl Add a new do_arch_prctl

2016-09-18 Thread Kyle Huey
Add a new do_arch_prctl to handle arch_prctls that are not specific to 64 bits. 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 <kh...@kylehuey.com> --- arch/x86/i

[PATCH v4 5/6] x86/cpufeature Detect CPUID faulting support

2016-09-18 Thread Kyle Huey
ure. It is documented in detail in Section 2.3.2 of http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/virtualization-technology-flexmigration-application-note.pdf Detect support for this feature and expose it as X86_FEATURE_CPUID_FAULT. Signed-off-by: Kyle Huey

[PATCH v4 0/6] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-18 Thread Kyle Huey
rr (http://rr-project.org/), a userspace record-and-replay reverse- execution debugger, would like to trap and emulate the CPUID instruction. This would allow us to a) mask away certain hardware features that rr does not support (e.g. RDRAND) and b) enable trace portability across machines by

[PATCH v4 1/6] x86/arch_prctl/64 Use SYSCALL_DEFINE2 to define sys_arch_prctl

2016-09-18 Thread Kyle Huey
Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/kernel/process_64.c | 3 ++- arch/x86/um/syscalls_64.c| 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 63236d8..4d6363c 100644 --- a/ar

Re: [PATCH v3 1/3] syscalls,x86 Expose arch_prctl on x86-32.

2016-09-16 Thread Kyle Huey
On Fri, Sep 16, 2016 at 12:50 AM, Thomas Gleixner <t...@linutronix.de> wrote: > On Thu, 15 Sep 2016, Kyle Huey wrote: > > First of all, please add a cover letter [PATCH 0/N] to your patch series > and send it with something which provides proper mail threading. > See: git-sen

Re: [PATCH] seccomp: Fix tracer exit notifications during fatal signals

2016-08-22 Thread Kyle Huey
On Thu, Aug 11, 2016 at 11:18 AM, Kees Cook wrote: > On Thu, Aug 11, 2016 at 8:12 AM, Oleg Nesterov wrote: >> On 08/10, Kees Cook wrote: >>> >>> This fixes a ptrace vs fatal pending signals bug as manifested in seccomp >>> now that ptrace was reordered to

[PATCH v6 4/6] x86/syscalls/32: Wire up arch_prctl on x86-32

2016-09-26 Thread Kyle Huey
Hook up arch_prctl to call do_arch_prctl on x86-32, and in 32 bit compat mode on x86-64. This allows us to have arch_prctls that are not specific to 64 bits. On UML, simply stub out this syscall. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/entry/syscalls/syscall_32.t

[PATCH v6 1/6] x86/arch_prctl/64: Use SYSCALL_DEFINE2 to define sys_arch_prctl

2016-09-26 Thread Kyle Huey
Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/kernel/process_64.c | 3 ++- arch/x86/um/syscalls_64.c| 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 63236d8..4d6363c 100644 --- a/ar

[PATCH v6 5/6] x86/cpufeature: Detect CPUID faulting support

2016-09-26 Thread Kyle Huey
ure. It is documented in detail in Section 2.3.2 of http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/virtualization-technology-flexmigration-application-note.pdf Detect support for this feature and expose it as X86_FEATURE_CPUID_FAULT. Signed-off-by: Kyle Huey

[PATCH v6 0/6] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-09-26 Thread Kyle Huey
rr (http://rr-project.org/), a userspace record-and-replay reverse- execution debugger, would like to trap and emulate the CPUID instruction. This would allow us to a) mask away certain hardware features that rr does not support (e.g. RDRAND) and b) enable trace portability across machines by

[PATCH v6 6/6] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID

2016-09-26 Thread Kyle Huey
rg2 is another value or CPUID faulting is not supported on this system. The state of the CPUID faulting flag is propagated across forks, but reset upon exec. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/thread_info.h

[PATCH v6 3/6] x86/arch_prctl: Add do_arch_prctl_common

2016-09-26 Thread Kyle Huey
Add do_arch_prctl_common to handle arch_prctls that are not specific to 64 bits. 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 <kh...@kylehuey.com> --- arch/x86/i

[PATCH v6 2/6] x86/arch_prctl/64: Rename do_arch_prctl to do_arch_prctl_64

2016-09-26 Thread Kyle Huey
In order to introduce new arch_prctls that are not 64 bit only, rename the existing 64 bit implementation to do_arch_prctl_64. Also rename the second argument to arch_prctl, which will no longer always be an address. Signed-off-by: Kyle Huey <kh...@kylehuey.com> Reviewed-by: Andy Lutomir

Re: [PATCH v9 7/7] KVM: x86: virtualize cpuid faulting

2016-11-08 Thread Kyle Huey
On Mon, Nov 7, 2016 at 12:13 PM, David Matlack <dmatl...@google.com> wrote: > On Sun, Nov 6, 2016 at 12:57 PM, Kyle Huey <m...@kylehuey.com> wrote: >> Hardware support for faulting on the cpuid instruction is not required to >> emulate it, because cpuid triggers a V

[PATCH v10 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID

2016-11-08 Thread Kyle Huey
rg2 is another value or CPUID faulting is not supported on this system. The state of the CPUID faulting flag is propagated across forks, but reset upon exec. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/msr-index.h | 3 + arch/x86/include/asm/processor.h

[PATCH v10 2/7] x86/arch_prctl/64: Rename do_arch_prctl to do_arch_prctl_64

2016-11-08 Thread Kyle Huey
In order to introduce new arch_prctls that are not 64 bit only, rename the existing 64 bit implementation to do_arch_prctl_64. Also rename the second argument to arch_prctl, which will no longer always be an address. Signed-off-by: Kyle Huey <kh...@kylehuey.com> Reviewed-by: Andy Lutomir

[PATCH v10 7/7] KVM: x86: virtualize cpuid faulting

2016-11-08 Thread Kyle Huey
. kvm_require_cpl is even kind enough to inject the GP fault for us. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/cpuid.c| 3 +++ arch/x86/kvm/cpuid.h| 10 ++ arch/x86/kvm/x86.c

[PATCH v10 3/7] x86/arch_prctl: Add do_arch_prctl_common

2016-11-08 Thread Kyle Huey
Add do_arch_prctl_common to handle arch_prctls that are not specific to 64 bits. 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 <kh...@kylehuey.com> --- arch/x86/i

[PATCH v10 0/7] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-11-08 Thread Kyle Huey
rr (http://rr-project.org/), a userspace record-and-replay reverse- execution debugger, would like to trap and emulate the CPUID instruction. This would allow us to a) mask away certain hardware features that rr does not support (e.g. RDRAND) and b) enable trace portability across machines by

[PATCH v10 1/7] x86/arch_prctl/64: Use SYSCALL_DEFINE2 to define sys_arch_prctl

2016-11-08 Thread Kyle Huey
Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/kernel/process_64.c | 3 ++- arch/x86/um/syscalls_64.c| 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index b3760b3..2718cf9 100644 --- a/ar

[PATCH v9 7/7] KVM: x86: virtualize cpuid faulting

2016-11-08 Thread Kyle Huey
. kvm_require_cpl is even kind enough to inject the GP fault for us. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/cpuid.c| 3 +++ arch/x86/kvm/x86.c | 26 ++ 3 files changed, 31 insertions(+) diff

Re: [PATCH v9 7/7] KVM: x86: virtualize cpuid faulting

2016-11-08 Thread Kyle Huey
On Tue, Nov 8, 2016 at 9:53 AM, Thomas Gleixner <t...@linutronix.de> wrote: > On Tue, 8 Nov 2016, Kyle Huey wrote: >> > It will simplify the MSR get/set code, and make it easier to plumb >> > support for new bits in these MSRs. >> >> I'm in

[PATCH v9 7/7] KVM: x86: virtualize cpuid faulting

2016-11-08 Thread Kyle Huey
e.g. like this

[PATCH v10 4/7] x86/syscalls/32: Wire up arch_prctl on x86-32

2016-11-08 Thread Kyle Huey
Hook up arch_prctl to call do_arch_prctl on x86-32, and in 32 bit compat mode on x86-64. This allows us to have arch_prctls that are not specific to 64 bits. On UML, simply stub out this syscall. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/entry/syscalls/syscall_32.t

[PATCH v10 5/7] x86/cpufeature: Detect CPUID faulting support

2016-11-08 Thread Kyle Huey
ure. It is documented in detail in Section 2.3.2 of http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/virtualization-technology-flexmigration-application-note.pdf Detect support for this feature and expose it as X86_FEATURE_CPUID_FAULT. Signed-off-by: Kyle Huey

Re: [PATCH v10 5/7] x86/cpufeature: Detect CPUID faulting support

2016-11-08 Thread Kyle Huey
On Tue, Nov 8, 2016 at 11:06 AM, Thomas Gleixner <t...@linutronix.de> wrote: > On Tue, 8 Nov 2016, Kyle Huey wrote: > >> Intel supports faulting on the CPUID instruction beginning with Ivy Bridge. >> When enabled, the processor will fault on attempts to execute the CPUID &

Re: [PATCH v8 7/7] KVM: x86: virtualize cpuid faulting

2016-11-06 Thread Kyle Huey
On Fri, Nov 4, 2016 at 5:09 PM, David Matlack <dmatl...@google.com> wrote: > On Fri, Nov 4, 2016 at 2:57 PM, Paolo Bonzini <pbonz...@redhat.com> wrote: >> >> On 04/11/2016 21:34, David Matlack wrote: >>> On Mon, Oct 31, 2016 at 6:37 PM, Kyle Huey <m...

[PATCH v9 5/7] x86/cpufeature: Detect CPUID faulting support

2016-11-06 Thread Kyle Huey
ure. It is documented in detail in Section 2.3.2 of http://www.intel.com/content/dam/www/public/us/en/documents/application-notes/virtualization-technology-flexmigration-application-note.pdf Detect support for this feature and expose it as X86_FEATURE_CPUID_FAULT. Signed-off-by: Kyle Huey

[PATCH v9 7/7] KVM: x86: virtualize cpuid faulting

2016-11-06 Thread Kyle Huey
. kvm_require_cpl is even kind enough to inject the GP fault for us. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/cpuid.c| 3 +++ arch/x86/kvm/x86.c | 28 3 files changed, 33 insertions(+)

[PATCH v9 1/7] x86/arch_prctl/64: Use SYSCALL_DEFINE2 to define sys_arch_prctl

2016-11-06 Thread Kyle Huey
Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/kernel/process_64.c | 3 ++- arch/x86/um/syscalls_64.c| 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index b3760b3..2718cf9 100644 --- a/ar

[PATCH v9 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID

2016-11-06 Thread Kyle Huey
rg2 is another value or CPUID faulting is not supported on this system. The state of the CPUID faulting flag is propagated across forks, but reset upon exec. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/include/asm/msr-index.h | 3 + arch/x86/include/asm/processor.h

[PATCH v9 3/7] x86/arch_prctl: Add do_arch_prctl_common

2016-11-06 Thread Kyle Huey
Add do_arch_prctl_common to handle arch_prctls that are not specific to 64 bits. 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 <kh...@kylehuey.com> --- arch/x86/i

[PATCH v9 2/7] x86/arch_prctl/64: Rename do_arch_prctl to do_arch_prctl_64

2016-11-06 Thread Kyle Huey
In order to introduce new arch_prctls that are not 64 bit only, rename the existing 64 bit implementation to do_arch_prctl_64. Also rename the second argument to arch_prctl, which will no longer always be an address. Signed-off-by: Kyle Huey <kh...@kylehuey.com> Reviewed-by: Andy Lutomir

[PATCH v9 4/7] x86/syscalls/32: Wire up arch_prctl on x86-32

2016-11-06 Thread Kyle Huey
Hook up arch_prctl to call do_arch_prctl on x86-32, and in 32 bit compat mode on x86-64. This allows us to have arch_prctls that are not specific to 64 bits. On UML, simply stub out this syscall. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/entry/syscalls/syscall_32.t

[PATCH v9 0/7] x86/arch_prctl Add ARCH_[GET|SET]_CPUID for controlling the CPUID instruction

2016-11-06 Thread Kyle Huey
rr (http://rr-project.org/), a userspace record-and-replay reverse- execution debugger, would like to trap and emulate the CPUID instruction. This would allow us to a) mask away certain hardware features that rr does not support (e.g. RDRAND) and b) enable trace portability across machines by

Re: [PATCH v10 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID

2016-11-10 Thread Kyle Huey
On Wed, Nov 9, 2016 at 5:21 AM, Borislav Petkov wrote: > On Tue, Nov 08, 2016 at 09:06:31PM +0100, Thomas Gleixner wrote: >> The upcoming ring3 mwait stuff can add its magic to tweak that MSR into >> this function. >> >> Stick the call at the end of init_scattered_cpuid_features()

Re: [PATCH v11 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID

2016-11-10 Thread Kyle Huey
On Thu, Nov 10, 2016 at 5:25 PM, kbuild test robot <l...@intel.com> wrote: > Hi Kyle, > > [auto build test ERROR on ] > > url: > https://github.com/0day-ci/linux/commits/Kyle-Huey/x86-arch_prctl-64-Use-SYSCALL_DEFINE2-to-define-sys_arch_prctl/2016-074631 > base:

Re: [PATCH v10 6/7] x86/arch_prctl: Add ARCH_[GET|SET]_CPUID

2016-11-10 Thread Kyle Huey
On Wed, Nov 9, 2016 at 5:34 AM, Thomas Gleixner wrote: > On Wed, 9 Nov 2016, Borislav Petkov wrote: >> +static void init_misc_enables(struct cpuinfo_x86 *c) >> +{ >> + u64 val, misc_en; >> + >> + if (rdmsrl_safe(MSR_MISC_FEATURES_ENABLES, _en)) >> + return;

[PATCH v11 4/7] x86/syscalls/32: Wire up arch_prctl on x86-32

2016-11-10 Thread Kyle Huey
Hook up arch_prctl to call do_arch_prctl() on x86-32, and in 32 bit compat mode on x86-64. This allows us to have arch_prctls that are not specific to 64 bits. On UML, simply stub out this syscall. Signed-off-by: Kyle Huey <kh...@kylehuey.com> --- arch/x86/entry/syscalls/syscall_32.t

  1   2   3   4   5   >