[PATCH 3/5] x86: Remove sys32_vm86_warning

2015-03-03 Thread Brian Gerst
The check against lastcomm is racy, and the message it produces isn't necessary. vm86 support can be disabled on a 32-bit kernel also, and doesn't have this message. Switch to sys_ni_syscall instead. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/ia32/sys_ia32.c | 14

[PATCH 1/5] x86: Remove compat_ni_syscall()

2015-03-03 Thread Brian Gerst
compat_ni_syscall() does the same thing as sys_ni_syscall(). Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/ia32/Makefile | 2 +- arch/x86/ia32/nosyscall.c| 7 --- arch/x86/ia32/syscall_ia32.c | 4 ++-- 3 files changed, 3 insertions(+), 10 deletions(-) delete mode

[PATCH 2/5] x86: Merge native and compat 32-bit syscall tables

2015-03-03 Thread Brian Gerst
Combine the 32-bit syscall tables into one file. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/ia32/Makefile | 1 - arch/x86/ia32/syscall_ia32.c | 25 - arch/x86/kernel/Makefile | 1 + arch/x86/kernel/syscall_32.c | 16 4 files

[PATCH 5/5] x86: Clean up ia32/Makefile

2015-03-03 Thread Brian Gerst
The ia32/ subdirectory is only entered if CONFIG_IA32_EMULATION is set. There is no need to depend on it in ia32/Makefile. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/ia32/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/ia32/Makefile b/arch

Re: [PATCH 3.2 055/152] x86_64, switch_to(): Load TLS descriptors before switching DS and ES

2015-02-26 Thread Brian Gerst
On Thu, Feb 26, 2015 at 10:32 AM, Andy Lutomirski l...@amacapital.net wrote: On Tue, Feb 24, 2015 at 7:23 PM, Brian Gerst brge...@gmail.com wrote: On Tue, Feb 24, 2015 at 3:08 PM, Denys Vlasenko vda.li...@googlemail.com wrote: On Tue, Feb 24, 2015 at 9:02 PM, Andy Lutomirski l

Re: [PATCH 3.2 055/152] x86_64, switch_to(): Load TLS descriptors before switching DS and ES

2015-02-24 Thread Brian Gerst
a kernel entry (with a few exceptions, like signals). If the test is failing, then it is a different issue from what this patch addresses. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo

Re: ia32_sysenter_target does not preserve EFLAGS

2015-03-27 Thread Brian Gerst
but does support sysret to compatibility mode. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org

Re: [PATCH 7/9] x86/asm/entry/32: tidy up some instructions

2015-04-01 Thread Brian Gerst
, the processor zero-extends the 16-bit selector to 64 bits. So I think it's safe to assume zero-extension on 64-bit, but not 32-bit. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH urgent v2] x86, asm: Disable opportunistic SYSRET if regs-flags has TF set

2015-04-02 Thread Brian Gerst
the opportunistic check for those cases (ptrace, audit, exec, sigreturn, etc.), and skip it for interrupts. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

Re: [PATCH 3/9] x86/asm/entry/64: do not SAVE_EXTRA_REGS in stub_sigreturn

2015-04-02 Thread Brian Gerst
On Thu, Apr 2, 2015 at 11:20 AM, Denys Vlasenko dvlas...@redhat.com wrote: On 04/02/2015 05:01 PM, Brian Gerst wrote: On Thu, Apr 2, 2015 at 10:36 AM, Denys Vlasenko dvlas...@redhat.com wrote: stub_sigreturn ignores old values of pt_regs-REG for all general-purpose registers, it sets them

Re: [PATCH] x86/asm/entry/32: Restore %ss before SYSRETL if necessary

2015-04-23 Thread Brian Gerst
of exposure so far. It only affects AMD cpus, and it was just merged. Wine is probably the most common 32-bit app people will run on a 64-bit kernel. I'll test something other than Wine that is 32-bit when I get home tonight. -- Brian Gerst -- To unsubscribe from this list: send the line

Re: [PATCH] x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue

2015-04-23 Thread Brian Gerst
impacting 64-bit processes at all. It works with Wine. Tested on an AMD Phenom II. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please

Re: [PATCH] x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue

2015-04-24 Thread Brian Gerst
on interrupt entry if it's NULL. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v2] x86/asm/entry/64: 32-bit execve stubs are identical to x32 ones, merge them.

2015-04-22 Thread Brian Gerst
On Tue, Apr 21, 2015 at 12:03 PM, Denys Vlasenko dvlas...@redhat.com wrote: Siggested by Brian Gerst. Suggested Run-tested. Signed-off-by: Denys Vlasenko dvlas...@redhat.com CC: Linus Torvalds torva...@linux-foundation.org CC: Steven Rostedt rost...@goodmis.org CC: Ingo Molnar mi

Re: [PATCH] x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue

2015-04-24 Thread Brian Gerst
On Fri, Apr 24, 2015 at 1:41 PM, Linus Torvalds torva...@linux-foundation.org wrote: On Fri, Apr 24, 2015 at 10:33 AM, Brian Gerst brge...@gmail.com wrote: To clarify, I was thinking of the CONFIG_PREEMPT case. A nested interrupt wouldn't change SS, and IST interrupts can't schedule. It has

Re: [PATCH] x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue

2015-04-24 Thread Brian Gerst
On Fri, Apr 24, 2015 at 12:25 PM, Linus Torvalds torva...@linux-foundation.org wrote: On Fri, Apr 24, 2015 at 5:00 AM, Brian Gerst brge...@gmail.com wrote: So actually this isn't a preemption issue, as the NULL SS is coming from an interrupt from userspace (timer tick, etc

Re: [tip:x86/vdso] x86/vdso32/syscall.S: Do not load __USER32_DS to %ss

2015-04-23 Thread Brian Gerst
state left by sysretl. Unfortunately we may have to put it back in, and then NOP it out on Intel. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo

Re: [tip:x86/vdso] x86/vdso32/syscall.S: Do not load __USER32_DS to %ss

2015-04-23 Thread Brian Gerst
and cannot reproduce it there. Note that on Intel CPUs, we use the sysenter VDSO but return with sysret. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

Re: [tip:x86/vdso] x86/vdso32/syscall.S: Do not load __USER32_DS to %ss

2015-04-23 Thread Brian Gerst
On Thu, Apr 23, 2015 at 5:20 AM, Denys Vlasenko dvlas...@redhat.com wrote: On 04/23/2015 09:37 AM, Brian Gerst wrote: On Tue, Mar 31, 2015 at 8:38 AM, tip-bot for Denys Vlasenko tip...@zytor.com wrote: Commit-ID: e7d6eefaaa443130079d73cd05039d90b3db7a4a Gitweb: http://git.kernel.org

Re: [tip:x86/vdso] x86/vdso32/syscall.S: Do not load __USER32_DS to %ss

2015-04-23 Thread Brian Gerst
On Thu, Apr 23, 2015 at 7:46 AM, Denys Vlasenko dvlas...@redhat.com wrote: On 04/23/2015 01:28 PM, Brian Gerst wrote: Looking at the error message: Unhandled exception: stack overflow in 32-bit code (0xf779bc07). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:f779bc07

Re: [PATCH] x86_64, asm: Work around AMD SYSRET SS descriptor attribute issue

2015-04-27 Thread Brian Gerst
could revert it. --Andy Another alternative is to do the canonical check in the paths that can set user RIP with an untrusted value, ie, sigreturn and exec. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org

[PATCH 2/4] x86: Remove unused invalidate_interrupt prototypes

2015-05-09 Thread Brian Gerst
The invalidate_interrupt* functions no longer exist. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/hw_irq.h | 35 --- 1 file changed, 35 deletions(-) diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h index e9571dd

[PATCH 1/4] x86: Merge irq_regs irq_stat

2015-05-09 Thread Brian Gerst
Move irq_regs and irq_stat definitions to irq.c. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/kernel/irq.c| 6 ++ arch/x86/kernel/irq_32.c | 6 -- arch/x86/kernel/irq_64.c | 6 -- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/irq.c b

[PATCH 4/4] x86: Clean up IRQn_VECTOR macros

2015-05-09 Thread Brian Gerst
Since the ISA irqs are in a single block, use ISA_IRQ_VECTOR(irq) instead of individual macros. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/irq_vectors.h | 18 +- arch/x86/kernel/apic/io_apic.c | 4 ++-- arch/x86/kernel/apic/vector.c | 2

[PATCH 0/4] x86: IRQ cleanups

2015-05-09 Thread Brian Gerst
The following are a few simple cleanups to the x86 IRQ code. arch/x86/include/asm/hw_irq.h | 35 --- arch/x86/include/asm/irq_vectors.h | 21 + arch/x86/kernel/apic/io_apic.c | 4 ++-- arch/x86/kernel/apic/vector.c | 2 +-

[PATCH 3/4] x86: Remove SYSCALL_VECTOR

2015-05-09 Thread Brian Gerst
Use IA32_SYSCALL_VECTOR for both compat and native. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/irq_vectors.h | 3 --- arch/x86/kernel/traps.c| 4 ++-- arch/x86/lguest/boot.c | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git

Re: [PATCH] x86, cpuinfo fix cpu_data(0) x86_model_id field truncation

2015-05-18 Thread Brian Gerst
is to do the trimming in get_model_name(). It already trims leading spaces for Intel. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please

[PATCH 1/2] x86: Merge common 32-bit values in asm-offsets.c

2015-04-12 Thread Brian Gerst
Merge common values for 32-bit native and compat. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/kernel/asm-offsets.c| 19 +++ arch/x86/kernel/asm-offsets_32.c | 15 --- arch/x86/kernel/asm-offsets_64.c | 21 - 3 files changed, 19

[PATCH 2/2] x86: Remove unused TI_cpu

2015-04-12 Thread Brian Gerst
Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/kernel/asm-offsets_32.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c index 628bfd4c..6ce3902 100644 --- a/arch/x86/kernel/asm-offsets_32.c +++ b/arch/x86/kernel

Re: [PATCH] x86: clear EXTRA_REGS for all executable formats

2015-04-06 Thread Brian Gerst
of these are supported on x86-64. The first two are for embedded MMU-less systems. a.out is only supported for a few old arches (x86-32, alpha, m68k). ia32_aout.c does explicitly clear the extra registers. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel

Re: [PATCH] x86/signal: Remove pax argument from restore_sigcontext

2015-04-06 Thread Brian Gerst
On Mon, Apr 6, 2015 at 3:03 AM, Ingo Molnar mi...@kernel.org wrote: * Brian Gerst brge...@gmail.com wrote: I'm wondering what the original reason for adding the extra handling of regs-ax was. Maybe something changed regs-ax - but I cannot find such code path anymore. It would be nice

Re: [PATCH 3/8] x86/asm/entry: Zero EXTRA_REGS for stub32_execve[at] too

2015-04-07 Thread Brian Gerst
to restore all registers on return. * This cannot be done with SYSRET, so use the IRET return path instead. The X32 and IA32 stubs are now identical and should be merged. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

[PATCH] x86/signal: Remove pax argument from restore_sigcontext

2015-04-04 Thread Brian Gerst
The pax argument is unnecesary. Instead, store the RAX value directly in regs. Signed-off-by: Brian Gerst brge...@gmail.com Cc: Ingo Molnar mi...@kernel.org Cc: H. Peter Anvin h...@zytor.com Cc: Andy Lutomirski l...@amacapital.net Cc: Denys Vlasenko dvlas...@redhat.com Cc: Linus Torvalds torva

Re: [PATCH] x86/signal: Remove pax argument from restore_sigcontext

2015-04-04 Thread Brian Gerst
On Sat, Apr 4, 2015 at 10:14 AM, Ingo Molnar mi...@kernel.org wrote: * Brian Gerst brge...@gmail.com wrote: The pax argument is unnecesary. Instead, store the RAX value directly in regs. Signed-off-by: Brian Gerst brge...@gmail.com Cc: Ingo Molnar mi...@kernel.org Cc: H. Peter Anvin h

Re: [PATCH 3/9] x86/asm/entry/64: do not SAVE_EXTRA_REGS in stub_sigreturn

2015-04-02 Thread Brian Gerst
the syscall will not return there and will go off into the weeds. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http

Re: [PATCH] x86/signal: Remove pax argument from restore_sigcontext

2015-04-04 Thread Brian Gerst
On Sat, Apr 4, 2015 at 10:14 AM, Ingo Molnar mi...@kernel.org wrote: * Brian Gerst brge...@gmail.com wrote: The pax argument is unnecesary. Instead, store the RAX value directly in regs. Signed-off-by: Brian Gerst brge...@gmail.com Cc: Ingo Molnar mi...@kernel.org Cc: H. Peter Anvin h

Re: [PATCH] x86, cpuinfo x86_model_id whitespace cleanup

2015-05-19 Thread Brian Gerst
dave.han...@linux.intel.com Cc: Igor Mammedov imamm...@redhat.com Cc: Fenghua Yu fenghua...@intel.com Cc: Brian Gerst brge...@gmail.com --- arch/x86/kernel/cpu/common.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch

Re: [PATCH] x86/asm/entry/64/compat: Rename ia32entry.S - entry_64_compat_32.S

2015-06-05 Thread Brian Gerst
# 64-bit binaries on 64-bit kernels entry_64_compat_32.S # 32-bit binaries on 64-bit kernels That's too long. How about just merging it into entry_64.S? That could also allow moving some of the obscure macros from calling.h into entry_64.S where they are more visible. -- Brian Gerst

Re: [PATCH] x86/asm/entry: (Re-)rename __NR_entry_INT80_compat_max to __NR_syscall_compat_max

2015-06-08 Thread Brian Gerst
On Mon, Jun 8, 2015 at 3:25 PM, Ingo Molnar mi...@kernel.org wrote: * Brian Gerst brge...@gmail.com wrote: diff --git a/arch/x86/entry/syscall_32.c b/arch/x86/entry/syscall_32.c index 3777189..e398d03 100644 --- a/arch/x86/entry/syscall_32.c +++ b/arch/x86/entry/syscall_32.c @@ -10,7

Re: [tip:x86/asm] x86/asm/entry: Rename compat syscall entry points

2015-06-08 Thread Brian Gerst
__NR_ia32_syscall_max __NR_syscall_max +#define __NR_entry_INT80_compat_max __NR_syscall_max #endif This change doesn't look intended. __NR_ia32_syscall_max is used by all compat entry points, not just INT80, -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel

Re: [PATCH] x86/asm/entry/32: Rename labels in INT 0x80 code path

2015-06-08 Thread Brian Gerst
(or CONFIG_COMPAT_X86_32) as a new name. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH 07/12] x86/compat: get_gate_vma should check for both 32-bit compat and x32

2015-06-22 Thread Brian Gerst
On Mon, Jun 22, 2015 at 12:19 PM, Andy Lutomirski l...@amacapital.net wrote: On Mon, Jun 22, 2015 at 4:55 AM, Brian Gerst brge...@gmail.com wrote: Change this to CONFIG_COMPAT so both 32-bit compat and x32 will do the check. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/entry

[PATCH 03/12] x86/compat: Move ucontext_x32 to sigframe.h

2015-06-22 Thread Brian Gerst
ia32.h should only contain the code for 32-bit compatability. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/ia32.h | 9 - arch/x86/include/asm/sigframe.h | 10 ++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm

[PATCH 10/12] x86/compat: define ARCH_WANT_OLD_COMPAT_IPC only for 32-bit compat

2015-06-22 Thread Brian Gerst
x32 does not need ARCH_WANT_OLD_COMPAT_IPC. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index c4f27a8..94afa69 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig

[PATCH 04/12] x86/compat: Rename start_thread_ia32 to compat_start_thread

2015-06-22 Thread Brian Gerst
This function is shared between the 32-bit compat and x32 ABIs. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/elf.h | 4 ++-- arch/x86/kernel/process_64.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/elf.h b/arch/x86

[PATCH 12/12] x86/compat: Separate ia32 and x32 compat ABIs

2015-06-22 Thread Brian Gerst
The x32 ABI is now independent of the ia32 compat ABI. Common code is now conditional on CONFIG_COMPAT, but unshared code like syscall entry, signal handling, and the VDSO are under separate config options. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/Kconfig | 2 +- 1 file changed

[PATCH 11/12] x86/compat: clean up HAVE_UID16 config

2015-06-22 Thread Brian Gerst
Merge the 32-bit compat config setting for HAVE_UID16 with the 32-bit native one. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 94afa69..9236bed 100644 --- a/arch

[PATCH 02/12] x86/compat: Make mmap_is_ia32() common compat

2015-06-22 Thread Brian Gerst
TIF_ADDR32 is set for both ia32 and x32 tasks, so change from CONFIG_IA32_EMULATION to CONFIG_COMPAT. Use config_enabled() to make the function more readable. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/elf.h | 11 +++ 1 file changed, 3 insertions(+), 8

[PATCH 05/12] x86/compat: Move ia32 compat code from compat_arch_ptrace()

2015-06-22 Thread Brian Gerst
Move the ia32-specific code in compat_arch_ptrace() into its own function. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/kernel/ptrace.c | 138 +-- 1 file changed, 74 insertions(+), 64 deletions(-) diff --git a/arch/x86/kernel/ptrace.c b

[PATCH 08/12] x86/compat/perf: perf_callchain_user32 is only for 32-bit compat

2015-06-22 Thread Brian Gerst
perf_callchain_user32() is not needed for x32. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/kernel/cpu/perf_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 5801a14..1924fad 100644

[PATCH 06/12] x86/compat: Don't build 32-bit vdso if not needed.

2015-06-22 Thread Brian Gerst
Build the 32-bit vdso only for native 32-bit or 32-bit compat is enabled. x32 should not force it to build. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/entry/vdso/Makefile | 6 +++--- arch/x86/entry/vdso/vma.c| 7 +-- arch/x86/include/asm/elf.h | 2 +- 3 files changed, 9

[PATCH 07/12] x86/compat: get_gate_vma should check for both 32-bit compat and x32

2015-06-22 Thread Brian Gerst
Change this to CONFIG_COMPAT so both 32-bit compat and x32 will do the check. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/entry/vsyscall/vsyscall_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/entry/vsyscall/vsyscall_64.c b/arch/x86/entry

[PATCH 09/12] x86/compat: Remove unneeded include

2015-06-22 Thread Brian Gerst
Including sys_ia32.h is not needed in signal.c. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/kernel/signal.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 206996c..6c22aad 100644 --- a/arch/x86/kernel/signal.c +++ b/arch

[PATCH 01/12] x86/compat: Move copy_siginfo_*_user32() to signal_compat.c

2015-06-22 Thread Brian Gerst
copy_siginfo_to_user32() and copy_siginfo_from_user32() are used by both the 32-bit compat and x32 ABIs. Move them to signal_compat.c. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/ia32/ia32_signal.c | 93 arch/x86/kernel/Makefile

[PATCH 00/12] x86/compat: Separate X32 from 32-bit compat

2015-06-22 Thread Brian Gerst
This patch series makes it possible to enable the X32 ABI support without the dependency on 32-bit compatability. Code that is shared between X32 and 32-bit compat is marked with CONFIG_COMPAT, but non-shared code like syscall entries, signal handling, and the VDSO are kept under separate config

Re: [RFC] Rename various 'IA32' uses in arch/x86/ code

2015-06-18 Thread Brian Gerst
/bace7117d3fb59a6ed7ea1aa6c8994df6a28a72a Author: Ingo Molnar mi...@kernel.org AuthorDate: Mon, 8 Jun 2015 21:20:26 +0200 Committer: Ingo Molnar mi...@kernel.org CommitDate: Mon, 8 Jun 2015 23:43:38 +0200 x86/asm/entry: (Re-)rename __NR_entry_INT80_compat_max to __NR_syscall_compat_max Brian Gerst noticed

Re: [RFC] Rename various 'IA32' uses in arch/x86/ code

2015-06-18 Thread Brian Gerst
On Thu, Jun 18, 2015 at 5:13 PM, Ingo Molnar mi...@kernel.org wrote: * Brian Gerst brge...@gmail.com wrote: The original one wasn't really a misnomer, as it referred to the ia32 system calls specifically, but this works too. It was a misnomer, because what are the 'ia32 system calls

Re: [PATCH] x86, msr: Allow read access to /dev/cpu/X/msr

2015-06-26 Thread Brian Gerst
unrestricted read access to all MSRs is wrong. Some MSRs contain addresses of kernel data structures, which can be used in security exploits. The proper way to do this is to write a driver to only expose the MSRs that the user tools need, and nothing else. -- Brian Gerst -- To unsubscribe from

Re: [PATCH] x86: General protection fault after STR (32 bit systems only)

2015-06-13 Thread Brian Gerst
On Sat, Jun 13, 2015 at 2:23 PM, Andy Lutomirski l...@amacapital.net wrote: On Sat, Jun 13, 2015 at 12:03 AM, Ingo Molnar mi...@kernel.org wrote: * Brian Gerst brge...@gmail.com wrote: On Fri, Jun 12, 2015 at 4:36 AM, Ingo Molnar mi...@kernel.org wrote: * H. Peter Anvin h...@zytor.com

Re: [PATCH] x86: General protection fault after STR (32 bit systems only)

2015-06-12 Thread Brian Gerst
we are in the kernel, fs is fixed at __KERNEL_PERCPU, and gs is either __KERNEL_STACK_CANARY or user's gs. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

Re: [PATCH 4/8] x86/vm86: Use the normal pt_regs area for vm86

2015-07-29 Thread Brian Gerst
On Wed, Jul 29, 2015 at 11:50 AM, Andy Lutomirski l...@amacapital.net wrote: On Tue, Jul 28, 2015 at 10:41 PM, Brian Gerst brge...@gmail.com wrote: Change to use the normal pt_regs area to enter and exit vm86 mode. This is done by increasing the padding at the top of the stack to make room

Re: [PATCH 4/8] x86/vm86: Use the normal pt_regs area for vm86

2015-07-29 Thread Brian Gerst
On Wed, Jul 29, 2015 at 1:16 PM, Linus Torvalds torva...@linux-foundation.org wrote: On Wed, Jul 29, 2015 at 10:14 AM, Brian Gerst brge...@gmail.com wrote: I think it was causing signal handling to fail, but I can't remember exactly. Ugh. If that hunk made a difference

Re: [PATCH 5/8] x86/vm86: Add a separate config option for hardware IRQ handling

2015-07-31 Thread Brian Gerst
On Fri, Jul 31, 2015 at 9:50 AM, Ingo Molnar mi...@kernel.org wrote: * Brian Gerst brge...@gmail.com wrote: On Fri, Jul 31, 2015 at 4:57 AM, Ingo Molnar mi...@kernel.org wrote: * Brian Gerst brge...@gmail.com wrote: Allow disabling hardware interrupt support for vm86. Signed-off

Re: [PATCH 4/8] x86/vm86: Use the normal pt_regs area for vm86

2015-07-31 Thread Brian Gerst
: ‘CPU_586’ undeclared (first use in this function) due to the include file changes. I fixed this up too. Thanks, Ingo I'll admit that I forgot to test the 64-bit build, but the SCSI driver... WTF is it doing with the cpu type? -- Brian Gerst -- To unsubscribe from this list: send

Re: [PATCH 5/8] x86/vm86: Add a separate config option for hardware IRQ handling

2015-07-31 Thread Brian Gerst
On Fri, Jul 31, 2015 at 4:57 AM, Ingo Molnar mi...@kernel.org wrote: * Brian Gerst brge...@gmail.com wrote: Allow disabling hardware interrupt support for vm86. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/Kconfig | 8 arch/x86/include/asm

Re: [tip:x86/asm] x86/vm86: Clean up vm86.h includes

2015-07-31 Thread Brian Gerst
On Fri, Jul 31, 2015 at 10:04 AM, tip-bot for Brian Gerst tip...@zytor.com wrote: Commit-ID: ba3e127ec105e790eeec4034d9769e018e4a1b54 Gitweb: http://git.kernel.org/tip/ba3e127ec105e790eeec4034d9769e018e4a1b54 Author: Brian Gerst brge...@gmail.com AuthorDate: Wed, 29 Jul 2015 01:41:21

Re: Dealing with the NMI mess

2015-07-30 Thread Brian Gerst
opcode map with no explanation at all. Thanks, CPU vendors. --Andy Some Windows programs (running in Wine) use this opcode for anti-debugging code. See commit a1e80fafc9f0742a1776a0490258cb64912411b0. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel

[PATCH 6/8] x86/vm86: Clean up vm86.h includes

2015-07-28 Thread Brian Gerst
vm86.h was being implicitly included in alot of places via processor.h, which in turn got it from math_emu.h. Break that chain and explicitly include vm86.h in all files that need it. Also remove unused vm86 field from math_emu_info. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86

[PATCH v4] x86: vm86 cleanups

2015-07-28 Thread Brian Gerst
The goal of this set of patches is to change vm86 support to return to userspace with the normal exit paths instead of leaving data on the kernel stack and jumping directly into the exit asm routines. This fixes issues like ptrace and syscall auditing not working with vm86, and makes possible

[PATCH 1/8] x86/vm86: Move vm86 fields out of thread_struct

2015-07-28 Thread Brian Gerst
Allocate a separate structure for the vm86 fields. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/processor.h | 11 +++--- arch/x86/include/asm/vm86.h | 19 - arch/x86/kernel/process.c| 3 +++ arch/x86/kernel/vm86_32.c| 46

[PATCH 7/8] x86/vm86: Rename vm86-vm86_info to user_vm86

2015-07-28 Thread Brian Gerst
Make it clearer that this is the pointer to the userspace vm86 state area. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/vm86.h | 2 +- arch/x86/kernel/vm86_32.c | 70 +++-- 2 files changed, 37 insertions(+), 35 deletions

[PATCH 4/8] x86/vm86: Use the normal pt_regs area for vm86

2015-07-28 Thread Brian Gerst
to 32-bit mode does the reverse. This allows removing the hacks to jump directly into the exit asm code due to having to change the stack pointer. Returning normally from the vm86 syscall and the exception handlers allows things like ptrace and auditing to work properly. Signed-off-by: Brian

[PATCH 3/8] x86/vm86: Eliminate kernel_vm86_struct

2015-07-28 Thread Brian Gerst
Now there is no vm86-specific data left on the kernel stack while in userspace, except for the 32-bit regs. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/vm86.h | 25 +--- arch/x86/kernel/vm86_32.c | 95 +++-- 2 files

[PATCH 5/8] x86/vm86: Add a separate config option for hardware IRQ handling

2015-07-28 Thread Brian Gerst
Allow disabling hardware interrupt support for vm86. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/Kconfig | 8 arch/x86/include/asm/irq_vectors.h | 10 -- arch/x86/include/asm/vm86.h| 20 ++-- arch/x86/kernel/vm86_32.c

[PATCH 2/8] x86/vm86: Move fields from kernel_vm86_struct

2015-07-28 Thread Brian Gerst
Move the non-regs fields to the off-stack data. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/vm86.h | 16 arch/x86/kernel/vm86_32.c | 42 ++ 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/arch

[PATCH 8/8] x86/vm86: Rename vm86-v86flags and v86mask

2015-07-28 Thread Brian Gerst
Rename v86flags to veflags, and v86mask to veflags_mask. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/vm86.h | 4 ++-- arch/x86/kernel/vm86_32.c | 20 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arch/x86/include/asm/vm86.h b

Re: [regression] x86/signal/64: Fix SS handling for signals delivered to 64-bit programs breaks dosemu

2015-08-13 Thread Brian Gerst
, at least how it is currently set up. 16-bit support is only in the 32-bit build. The 64-bit build only supports Win64 apps, and will call the 32-bit version (installed in parallel) to run 32 and 16-bit apps. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel

Re: [PATCH 4/7] x86/vm86: Move vm86 fields out of thread_struct

2015-07-21 Thread Brian Gerst
On Tue, Jul 21, 2015 at 3:11 AM, Ingo Molnar mi...@kernel.org wrote: * Brian Gerst brge...@gmail.com wrote: --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -110,6 +110,13 @@ void exit_thread(void) kfree(bp); } +#ifdef CONFIG_VM86 + if (t-vm86

Re: [PATCH v2 1/3] x86/ldt: Make modify_ldt synchronous

2015-07-21 Thread Brian Gerst
if the LDT is reallocated, but on every update seems unnecessary. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ

Re: [PATCH v2 1/3] x86/ldt: Make modify_ldt synchronous

2015-07-21 Thread Brian Gerst
On Tue, Jul 21, 2015 at 10:12 PM, Andy Lutomirski l...@amacapital.net wrote: On Tue, Jul 21, 2015 at 7:01 PM, Brian Gerst brge...@gmail.com wrote: On Tue, Jul 21, 2015 at 3:59 PM, Andy Lutomirski l...@kernel.org wrote: modify_ldt has questionable locking and does not synchronize threads

Re: [PATCH v2 2/3] x86/ldt: Make modify_ldt optional

2015-07-21 Thread Brian Gerst
On Tue, Jul 21, 2015 at 4:34 PM, Andy Lutomirski l...@amacapital.net wrote: On Tue, Jul 21, 2015 at 1:28 PM, Brian Gerst brge...@gmail.com wrote: On Tue, Jul 21, 2015 at 3:59 PM, Andy Lutomirski l...@kernel.org wrote: The modify_ldt syscall exposes a large attack surface and is unnecessary

Re: [PATCH v2 2/3] x86/ldt: Make modify_ldt optional

2015-07-21 Thread Brian Gerst
still uses the LDT for thread-local data, even for 32 and 64-bit programs. This is separate from the Linux runtime TLS. -- Brian Gerst -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http

Re: [PATCH 1/5] x86/entry/32: Clean up enable_sep_cpu to prepare for 64-bit merge

2015-07-23 Thread Brian Gerst
it? Another option would be to remove the _safe from the 32-bit version. There is an erratum with SEP being advertised but not available on early P6 models, but we already check for that in the cpu setup code. There shouldn't be a problem with a fault. -- Brian Gerst -- To unsubscribe from

Re: [PATCH] x86/entry/32: Initialize ss1 (SYSENTER_CS shadow) even on non-SEP CPUs

2015-07-23 Thread Brian Gerst
On Thu, Jul 23, 2015 at 2:56 PM, Andy Lutomirski l...@kernel.org wrote: native_load_sp0 relies on this. I'm not sure why we haven't seen reports of crashes. Maybe no one tests new kernels on non-SEP CPUs. It's already statically initialized in cpu_tss. -- Brian Gerst -- To unsubscribe from

[PATCH 4/7] x86/vm86: Move vm86 fields out of thread_struct

2015-07-16 Thread Brian Gerst
Allocate a separate structure for the vm86 fields. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/processor.h | 12 ++ arch/x86/include/asm/vm86.h | 11 + arch/x86/kernel/process.c| 7 ++ arch/x86/kernel/vm86_32.c| 51

[PATCH 3/7] x86/vm86: Move userspace accesses to do_sys_vm86()

2015-07-16 Thread Brian Gerst
Move the userspace accesses down into the common function in preparation for the next set of patches. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/processor.h | 2 +- arch/x86/kernel/vm86_32.c| 176 +++ 2 files changed, 89

[PATCH 5/7] x86/vm86: Move fields from kernel_vm86_struct

2015-07-16 Thread Brian Gerst
Move the non-regs fields to the off-stack data. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/vm86.h | 16 arch/x86/kernel/vm86_32.c | 40 +--- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/arch/x86

[PATCH 6/7] x86/vm86: Eliminate kernel_vm86_struct

2015-07-16 Thread Brian Gerst
Now there is no vm86-specific data left on the kernel stack while in userspace, except for the 32-bit regs. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/vm86.h | 25 + arch/x86/kernel/vm86_32.c | 91 +++-- 2 files

[PATCH 2/7] x86/vm86: Preserve orig_ax

2015-07-16 Thread Brian Gerst
There is no legitimate reason for usermode to modify the orig_ax field on entry to vm86 mode, so copy it from the 32-bit regs. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/kernel/vm86_32.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86

[PATCH 7/7] x86/vm86: Use the normal pt_regs area for vm86

2015-07-16 Thread Brian Gerst
to 32-bit mode does the reverse. This allows removing the hacks to jump directly into the exit asm code due to having to change the stack pointer. Returning normally from the vm86 syscall and the exception handlers allows things like ptrace and auditing to work properly. Signed-off-by: Brian

[PATCH v2] x86: vm86 cleanups

2015-07-16 Thread Brian Gerst
The goal of this set of patches is to change vm86 support to return to userspace with the normal exit paths instead of leaving data on the kernel stack and jumping directly into the exit asm routines. This fixes issues like ptrace and syscall auditing not working with vm86, and makes possible

[PATCH 1/7] x86/vm86: Clean up saved_fs/gs

2015-07-16 Thread Brian Gerst
There is no need to save FS and non-lazy GS outside the 32-bit regs. Lazy GS still needs to be saved because it wasn't saved on syscall entry. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/processor.h | 3 ++- arch/x86/kernel/vm86_32.c| 6 ++ 2 files changed

Re: [PATCH 1/7] x86/vm86: Clean up saved_fs/gs

2015-07-16 Thread Brian Gerst
On Thu, Jul 16, 2015 at 11:45 AM, Andy Lutomirski l...@amacapital.net wrote: On Thu, Jul 16, 2015 at 4:46 AM, Brian Gerst brge...@gmail.com wrote: There is no need to save FS and non-lazy GS outside the 32-bit regs. Lazy GS still needs to be saved because it wasn't saved on syscall entry. I

Re: [PATCH 3/7] x86/vm86: Move userspace accesses to do_sys_vm86()

2015-07-16 Thread Brian Gerst
On Thu, Jul 16, 2015 at 11:42 AM, Andy Lutomirski l...@amacapital.net wrote: On Thu, Jul 16, 2015 at 4:46 AM, Brian Gerst brge...@gmail.com wrote: Move the userspace accesses down into the common function in preparation for the next set of patches. Nice! Could you improve the changelog

[PATCH 7/7] x86/vm86: Use the normal pt_regs area for vm86

2015-07-19 Thread Brian Gerst
to 32-bit mode does the reverse. This allows removing the hacks to jump directly into the exit asm code due to having to change the stack pointer. Returning normally from the vm86 syscall and the exception handlers allows things like ptrace and auditing to work properly. Signed-off-by: Brian

[PATCH 6/7] x86/vm86: Eliminate kernel_vm86_struct

2015-07-19 Thread Brian Gerst
Now there is no vm86-specific data left on the kernel stack while in userspace, except for the 32-bit regs. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/vm86.h | 25 +--- arch/x86/kernel/vm86_32.c | 93 +++-- 2 files

[PATCH 5/7] x86/vm86: Move fields from kernel_vm86_struct

2015-07-19 Thread Brian Gerst
Move the non-regs fields to the off-stack data. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm/vm86.h | 16 arch/x86/kernel/vm86_32.c | 42 ++ 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/arch

[PATCH v3] x86: vm86 cleanups

2015-07-19 Thread Brian Gerst
The goal of this set of patches is to change vm86 support to return to userspace with the normal exit paths instead of leaving data on the kernel stack and jumping directly into the exit asm routines. This fixes issues like ptrace and syscall auditing not working with vm86, and makes possible

[PATCH 2/7] x86/vm86: Preserve orig_ax

2015-07-19 Thread Brian Gerst
There is no legitimate reason for usermode to modify the orig_ax field on entry to vm86 mode, so copy it from the 32-bit regs. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/kernel/vm86_32.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86

[PATCH 3/7] x86/vm86: Move userspace accesses to do_sys_vm86()

2015-07-19 Thread Brian Gerst
Move the userspace accesses down into the common function in preparation for the next set of patches. Also change to copying the fields explicitly instead of assuming a fixed order in pt_regs and the kernel data structures. Signed-off-by: Brian Gerst brge...@gmail.com --- arch/x86/include/asm

<    1   2   3   4   5   6   7   8   9   10   >