[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 --- arch/x86/include/asm/proto.h | 1

[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 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 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 --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/kernel

[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 Revie

[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 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 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 --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/thread_info.h| 6 +- arch/

[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 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 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 --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/kernel

[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 --- arch/x86/include/asm/proto.h | 1

[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 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 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 Revie

[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 --- arch/x86/include/asm/proto.h | 4 +++- arch/x86

[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

[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 --- 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/arch/x86/kernel/process_64.c

[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 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

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 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 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-send-email, quilt I did ... s

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 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 wrote: > On Thu, Sep 15, 2016 at 4:33 PM, Kyle Huey wrote: >> +int get_cpuid_mode(unsigned long adr) >> +{ >> + unsigned int val; >> + >> + if (test_thread_flag(TIF_NOCPUID)) >> + va

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: [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 wrote: > On Thu, Sep 15, 2016 at 12:11 PM, Kyle Huey wrote: >> On Thu, Sep 15, 2016 at 3:25 AM, Jan Beulich wrote: >>>>>> On 15.09.16 at 12:05, wrote: >>>> On 14/09/16 22:01, Kyle Huey wrote: >

[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 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 --- 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/exec.c | 6 + tools

[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/

[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 --- 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/include/asm/cpufeatures.h

[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 --- arch/x86/entry/syscalls/syscall_32.tbl | 1 + arch/x86/include/asm/proto.h | 5 - arch/x86/kernel/process.c

[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] 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

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 >>&

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 wrote: >>>> On 15.09.16 at 12:05, wrote: >> On 14/09/16 22:01, Kyle Huey wrote: >>> Xen advertises the underlying support for CPUID faulting but not does pass >>> through writes to the relevant MSR, n

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

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 wrote: > On Wed, Sep 14, 2016 at 3:03 PM, Kyle Huey wrote: >> On Wed, Sep 14, 2016 at 2:35 PM, Dave Hansen >> wrote: >>> On 09/14/2016 02:01 PM, Kyle Huey wrote: > >>> Is any of this useful to optimize a

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 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 wrote: > On Wed, Sep 14, 2016 at 6:47 PM, Kyle Huey wrote: >> On Wed, Sep 14, 2016 at 6:29 PM, Andy Lutomirski wrote: >>> On Wed, Sep 14, 2016 at 2:01 PM, Kyle Huey wrote: > >>>> + >>>> +int set_cpuid

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: [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 wrote: > On Wed, Sep 14, 2016 at 2:01 PM, Kyle Huey wrote: >> Intel supports faulting on the CPUID instruction in newer processors. Bit >> 31 of MSR_PLATFORM_INFO advertises support for this feature. It is >> documented in de

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: [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 : >> 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 : >>>> Signed-

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: [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 : >> Signed-off-by: Kyle Huey >> --- >> arch/x86/entry/syscalls/syscall_32.tbl | 1 + >> arch/x86/k

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: [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 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 does >> not actually w

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: [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 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 early >> returns for each existing AR

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

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 wrote: > On 09/14/2016 02:01 PM, Kyle Huey wrote: >> Signed-off-by: Kyle Huey >> --- >> arch/x86/entry/syscalls/syscall_32.tbl | 1 + >> arch/x86/kernel/process.c | 80 >> +

[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 +++

[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 --- 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 +++ b/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 --- 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 +++ tools/testing/selftests/x86

[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

[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 --- arch/x86/include/asm/cpufeatures.h | 1

[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(

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

2016-09-14 Thread Kyle Huey
Signed-off-by: Kyle Huey --- 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(+), 66 deletions(-) diff --git

[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

[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

[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 +++

[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 --- 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 +++ tools/testing/selftests/x86

[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 1/3] syscalls,x86 Expose arch_prctl on x86-32.

2016-09-14 Thread Kyle Huey
Signed-off-by: Kyle Huey --- 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(+), 66 deletions(-) diff --git

[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 --- arch/x86/include/asm/cpufeatures.h | 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] 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. This is interesting.

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

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 wrote: > On Mon, Sep 12, 2016 at 2:07 AM, Borislav Petkov wrote: >> On Sun, Sep 11, 2016 at 05:29:23PM -0700, Kyle Huey wrote: >>> @@ -2162,6 +2168,12 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, >>> arg2, unsigned

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] 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 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 and emulate the CP

[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

[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 for drafting an earlier version of this patch. Signed-off-by Kyle Huey --- arch/x86/include/asm/msr-index.h | 1 + arch/x86/include/asm/processor.h | 7 arch/x86/include/asm/thread_info.h | 4

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

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 happen after ptrace. The short version

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

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

2016-08-10 Thread Kyle Huey
l > 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. > > Reported-by: Robert O'Callahan >

[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] 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 Signed-off-by: Kyle Huey --- kernel

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 wrote: > On Fri, Jul 17, 2015 at 4:59 PM, Thierry Reding > 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 A

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

[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 --- arch/arm/include/asm/thread_info.h | 8 ++-- arch/arm/include/uapi/asm/ptrace.h | 32

[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: [RESEND PATCH v3] ARM: tegra124: pmu support

2015-07-18 Thread Kyle Huey
On Fri, Jul 17, 2015 at 4:59 PM, Thierry Reding 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-

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

[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 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

[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 --- arch/arm/boot/dts/tegra124.dtsi | 8 1 file changed, 8

[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

<    1   2   3   4   5