Skip to content
  1. Dec 21, 2012
    • David Woodhouse's avatar
      x86: Default to ARCH=x86 to avoid overriding CONFIG_64BIT · ffee0de4
      David Woodhouse authored
      
      
      It is easy to waste a bunch of time when one takes a 32-bit .config
      from a test machine and try to build it on a faster 64-bit system, and
      its existing setting of CONFIG_64BIT=n gets *changed* to match the
      build host.  Similarly, if one has an existing build tree it is easy
      to trash an entire build tree that way.
      
      This is because the default setting for $ARCH when discovered from
      'uname' is one of the legacy pre-x86-merge values (i386 or x86_64),
      which effectively force the setting of CONFIG_64BIT to match. We should
      default to ARCH=x86 instead, finally completing the merge that we
      started so long ago.
      
      This patch preserves the behaviour of the legacy ARCH settings for commands
      such as:
      
         make ARCH=x86_64 randconfig
         make ARCH=i386 randconfig
      
      ... since making the value of CONFIG_64BIT actually random in that situation
      is not desirable.
      
      In time, perhaps we can retire this legacy use of the old ARCH= values.
      We already have a way to override values for *any* config option, using
      $KCONFIG_ALLCONFIG, so it could be argued that we don't necessarily need
      to keep ARCH={i386,x86_64} around as a special case just for overriding
      CONFIG_64BIT.
      
      We'd probably at least want to add a way to override config options from
      the command line ('make CONFIG_FOO=y oldconfig') before we talk about doing
      that though.
      
      Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
      Link: http://lkml.kernel.org/r/1356040315.3198.51.camel@shinybook.infradead.org
      
      
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      ffee0de4
  2. Dec 06, 2012
  3. Dec 05, 2012
    • Ralf Baechle's avatar
      MIPS: N32: Fix preadv(2) and pwritev(2) entry points. · d5563715
      Ralf Baechle authored
      By using the native syscall entry point the kernel was also expecting
      64-bit iovec structures.
      
      This is broken since ddd9e91b
      
       [preadv/
      pwritev: MIPS: Add preadv(2) and pwritev(2) syscalls.] which originally
      added these two syscalls.  I walked through piles of code, including
      libc and couldn't find anything that would have worked around the issue
      so this change the API to what it should always have been.
      
      Noticed and patch suggested by Al Viro.
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      d5563715
  4. Dec 04, 2012
    • David Daney's avatar
      MIPS: Avoid mcheck by flushing page range in huge_ptep_set_access_flags() · ac53c4fc
      David Daney authored
      
      
      Problem:
      
      1) Huge page mapping of anonymous memory is initially invalid.  Will be
         faulted in by copy-on-write mechanism.
      
      2) Userspace attempts store at the end of the huge mapping.
      
      3) TLB Refill exception handler fill TLB with a normal (4K sized)
         invalid page at the end of the huge mapping virtual address range.
      
      4) Userspace restarted, and re-attempts the store at the end of the
         huge mapping.
      
      5) Page from #3 is invalid, we get a fault and go to the hugepage
         fault handler.  This tries to map a huge page and calls
         huge_ptep_set_access_flags() to install the mapping.
      
      6) We just call the generic ptep_set_access_flags() to set up the page
         tables, but the flush there assumes a normal (4K sized) page and
         only tries to flush the first part of the huge page virtual address
         out of the TLB, since the existing entry from step #3 doesn't
         conflict, nothing is flushed.
      
      7) We attempt to load the mapping into the TLB, but because it
         conflicts with the entry from step #3, we get a Machine Check
         exception.
      
      The fix: Flush the entire rage covered by the huge page in
      huge_ptep_set_access_flags(), and remove the optimization in
      local_flush_tlb_range() so that the flush actually does the correct
      thing.
      
      Signed-off-by: default avatarDavid Daney <david.daney@cavium.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Cc: Hillf Danton <dhillf@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/4661/
      
      
      Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
      (cherry picked from commit dd617f258cc39d36be26afee9912624a2d23112c)
      ac53c4fc
    • David S. Miller's avatar
      sparc: Fix piggyback with newer binutils. · 0032c857
      David S. Miller authored
      
      
      Newer versions of binutils mark '_end' as 'B' instead of 'A' for
      whatever reason.
      
      To be honest, the piggyback code doesn't actually care what kind
      of symbol _start and _end are, it just wants to find them and
      record the address.
      
      So remove the type from the match strings.
      
      Reported-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0032c857
    • David S. Miller's avatar
    • Al Viro's avatar
      [parisc] open(2) compat bug · 25a3bc6b
      Al Viro authored
      In commit 9d73fc2d
      
       ("open*(2) compat fixes (s390, arm64)") I said:
      >
      > 	The usual rules for open()/openat()/open_by_handle_at() are
      > 1) native 32bit - don't force O_LARGEFILE in flags
      > 2) native 64bit - force O_LARGEFILE in flags
      > 3) compat on 64bit host - as for native 32bit
      > 4) native 32bit ABI for 64bit system (mips/n32, x86/x32) - as for native 64bit
      >
      > There are only two exceptions - s390 compat has open() forcing O_LARGEFILE and
      > arm64 compat has open_by_handle_at() doing the same thing.  The same binaries
      > on native host (s390/31 and arm resp.) will *not* force O_LARGEFILE, so IMO
      > both are emulation bugs.
      
      Three exceptions, actually - parisc open() is another case like that.
      Native 32bit won't force O_LARGEFILE, the same binary on parisc64 will.
      
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      25a3bc6b
  5. Dec 03, 2012
    • Al Viro's avatar
      open*(2) compat fixes (s390, arm64) · 9d73fc2d
      Al Viro authored
      
      
      The usual rules for open()/openat()/open_by_handle_at() are
       1) native 32bit - don't force O_LARGEFILE in flags
       2) native 64bit - force O_LARGEFILE in flags
       3) compat on 64bit host - as for native 32bit
       4) native 32bit ABI for 64bit system (mips/n32, x86/x32) - as for
          native 64bit
      
      There are only two exceptions - s390 compat has open() forcing
      O_LARGEFILE and arm64 compat has open_by_handle_at() doing the same
      thing.  The same binaries on native host (s390/31 and arm resp.) will
      *not* force O_LARGEFILE, so IMO both are emulation bugs.
      
      Objections? The fix is obvious...
      
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9d73fc2d
  6. Dec 01, 2012
    • Vincent Palatin's avatar
      x86, fpu: Avoid FPU lazy restore after suspend · 644c1541
      Vincent Palatin authored
      
      
      When a cpu enters S3 state, the FPU state is lost.
      After resuming for S3, if we try to lazy restore the FPU for a process running
      on the same CPU, this will result in a corrupted FPU context.
      
      Ensure that "fpu_owner_task" is properly invalided when (re-)initializing a CPU,
      so nobody will try to lazy restore a state which doesn't exist in the hardware.
      
      Tested with a 64-bit kernel on a 4-core Ivybridge CPU with eagerfpu=off,
      by doing thousands of suspend/resume cycles with 4 processes doing FPU
      operations running. Without the patch, a process is killed after a
      few hundreds cycles by a SIGFPE.
      
      Cc: Duncan Laurie <dlaurie@chromium.org>
      Cc: Olof Johansson <olofj@chromium.org>
      Cc: <stable@kernel.org> v3.4+ # for 3.4 need to replace this_cpu_write by percpu_write
      Signed-off-by: default avatarVincent Palatin <vpalatin@chromium.org>
      Link: http://lkml.kernel.org/r/1354306532-1014-1-git-send-email-vpalatin@chromium.org
      
      
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      644c1541
  7. Nov 29, 2012
  8. Nov 28, 2012
    • Will Deacon's avatar
      ARM: 7586/1: sp804: set cpumask to cpu_possible_mask for clock event device · ea3aacf5
      Will Deacon authored
      
      
      The SP804 driver statically initialises the cpumask of the clock event
      device to be cpu_all_mask, which is derived from the compile-time
      constant NR_CPUS. This breaks SMP_ON_UP systems where the interrupt
      controller handling the sp804 doesn't have the irq_set_affinity callback
      on the irq_chip, because the common timer code fails to identify the
      device as cpu-local and ends up treating it as a broadcast device
      instead.
      
      This patch fixes the problem by using cpu_possible_mask at runtime,
      which will correctly represent the possible CPUs when SMP_ON_UP is being
      used.
      
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      ea3aacf5
    • H. Peter Anvin's avatar
      x86-32: Unbreak booting on some 486 clones · 6662c34f
      H. Peter Anvin authored
      
      
      There appear to have been some 486 clones, including the "enhanced"
      version of Am486, which have CPUID but not CR4.  These 486 clones had
      only the FPU flag, if any, unlike the Intel 486s with CPUID, which
      also had VME and therefore needed CR4.
      
      Therefore, look at the basic CPUID flags and require at least one bit
      other than bit 0 before we modify CR4.
      
      Thanks to Christian Ludloff of sandpile.org for confirming this as a
      problem.
      
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      6662c34f
  9. Nov 27, 2012
    • H. Peter Anvin's avatar
      x86, kvm: Remove incorrect redundant assembly constraint · cb7cb286
      H. Peter Anvin authored
      
      
      In __emulate_1op_rax_rdx, we use "+a" and "+d" which are input/output
      constraints, and *then* use "a" and "d" as input constraints.  This is
      incorrect, but happens to work on some versions of gcc.
      
      However, it breaks gcc with -O0 and icc, and may break on future
      versions of gcc.
      
      Reported-and-tested-by: default avatarMelanie Blower <melanie.blower@intel.com>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Link: http://lkml.kernel.org/r/B3584E72CFEBED439A3ECA9BCE67A4EF1B17AF90@FMSMSX107.amr.corp.intel.com
      
      
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Acked-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
      cb7cb286
    • Mark Salter's avatar
      c6x: fix misleading comment · 9c0603f4
      Mark Salter authored
      
      
      A comment in entry.S incorrectly stated that interrupt vectors
      called __do_IRQ() and that int6 vector was used for syscalls.
      Both statements are incorrect for the current kernel, so this
      patch cleans up the wording to reflect current reality.
      
      Signed-off-by: default avatarMark Salter <msalter@redhat.com>
      9c0603f4
    • Mark Salter's avatar
      c6x: run do_notify_resume with interrupts enabled · 9d34340e
      Mark Salter authored
      
      
      C6x was mistakenly running do_notify_resume with interrupts disabled.
      This would triggerlead to a warning in local_bh_enable() because interrupts
      were disabled:
      
      ------------[ cut here ]------------
      WARNING: at /es/linux/linux-next/kernel/softirq.c:160 local_bh_enable+0x5c/0x10c()
      Modules linked in:
      
                   e02f384d e002cda8 e02f3469 e02f384d 000000a0 e00363fc e01cce58 e5005c00
                   e0327986 00000000 e63c0aec 00000164 e00363fc 00000000 fffffffe e5005c00
                   e61fde00 e0268184 00000134 e01c91dc 00000001 fffffffe 00000000 10000100
                   e01c80e4 e5005c00 00000000 00000000 00000000 e63c0aec e526ce00 10000100
                   e628f920 e63c0a88 e6010410 e6449750 e5005c20 00000000 00000000 e63c0a80
                   e5005c20 e01c8590 e63c0a80 e5005c20 e63c0aec e00a0554 e009c758 e639e860
       irq_spurious_proc_fops+0x6ad/0x3438
       warn_slowpath_common+0x8c/0xb8
       irq_spurious_proc_fops+0x2c9/0x3438
       irq_spurious_proc_fops+0x6ad/0x3438
       local_bh_enable+0x5c/0x10c
       sk_alloc+0x34/0xa4
       local_bh_enable+0x5c/0x10c
       unix_release_sock+0x5c/0x2a0
       sys_connect+0x94/0xd4
       sock_release+0x38/0x104
       sock_close+0x3c/0x54
       __fput+0x154/0x2ec
       filp_close+0xc0/0xe4
       task_work_run+0xdc/0x12c
       sys_close+0x2c/0x74
       resume_userspace+0x0/0x30
      ---[ end trace a70cbd610ae1f6b4 ]---
      
      This patch enables interrupts before calling do_notify_resume().
      
      Signed-off-by: default avatarMark Salter <msalter@redhat.com>
      9d34340e
  10. Nov 26, 2012
  11. Nov 24, 2012
  12. Nov 23, 2012
  13. Nov 22, 2012