1. 14 9月, 2014 1 次提交
    • L
      Make ARCH_HAS_FAST_MULTIPLIER a real config variable · 72d93104
      Linus Torvalds 提交于
      It used to be an ad-hoc hack defined by the x86 version of
      <asm/bitops.h> that enabled a couple of library routines to know whether
      an integer multiply is faster than repeated shifts and additions.
      
      This just makes it use the real Kconfig system instead, and makes x86
      (which was the only architecture that did this) select the option.
      
      NOTE! Even for x86, this really is kind of wrong.  If we cared, we would
      probably not enable this for builds optimized for netburst (P4), where
      shifts-and-adds are generally faster than multiplies.  This patch does
      *not* change that kind of logic, though, it is purely a syntactic change
      with no code changes.
      
      This was triggered by the fact that we have other places that really
      want to know "do I want to expand multiples by constants by hand or
      not", particularly the hash generation code.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      72d93104
  2. 12 9月, 2014 4 次提交
    • S
      xen/arm: remove mach_to_phys rbtree · d50582e0
      Stefano Stabellini 提交于
      Remove the rbtree used to keep track of machine to physical mappings:
      the frontend can grant the same page multiple times, leading to errors
      inserting or removing entries from the mach_to_phys tree.
      
      Linux only needed to know the physical address corresponding to a given
      machine address in swiotlb-xen. Now that swiotlb-xen can call the
      xen_dma_* functions passing the machine address directly, we can remove
      it.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Tested-by: NDenis Schneider <v1ne2go@gmail.com>
      d50582e0
    • S
      xen/arm: reimplement xen_dma_unmap_page & friends · 340720be
      Stefano Stabellini 提交于
      xen_dma_unmap_page, xen_dma_sync_single_for_cpu and
      xen_dma_sync_single_for_device are currently implemented by calling into
      the corresponding generic ARM implementation of these functions. In
      order to do this, firstly the dma_addr_t handle, that on Xen is a
      machine address, needs to be translated into a physical address.  The
      operation is expensive and inaccurate, given that a single machine
      address can correspond to multiple physical addresses in one domain,
      because the same page can be granted multiple times by the frontend.
      
      To avoid this problem, we introduce a Xen specific implementation of
      xen_dma_unmap_page, xen_dma_sync_single_for_cpu and
      xen_dma_sync_single_for_device, that can operate on machine addresses
      directly.
      
      The new implementation relies on the fact that the hypervisor creates a
      second p2m mapping of any grant pages at physical address == machine
      address of the page for dom0. Therefore we can access memory at physical
      address == dma_addr_r handle and perform the cache flushing there. Some
      cache maintenance operations require a virtual address. Instead of using
      ioremap_cache, that is not safe in interrupt context, we allocate a
      per-cpu PAGE_KERNEL scratch page and we manually update the pte for it.
      
      arm64 doesn't need cache maintenance operations on unmap for now.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Tested-by: NDenis Schneider <v1ne2go@gmail.com>
      340720be
    • S
      xen/arm: introduce XENFEAT_grant_map_identity · 5ebc77de
      Stefano Stabellini 提交于
      The flag tells us that the hypervisor maps a grant page to guest
      physical address == machine address of the page in addition to the
      normal grant mapping address. It is needed to properly issue cache
      maintenance operation at the completion of a DMA operation involving a
      foreign grant.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Tested-by: NDenis Schneider <v1ne2go@gmail.com>
      5ebc77de
    • W
      arm64: flush TLS registers during exec · eb35bdd7
      Will Deacon 提交于
      Nathan reports that we leak TLS information from the parent context
      during an exec, as we don't clear the TLS registers when flushing the
      thread state.
      
      This patch updates the flushing code so that we:
      
        (1) Unconditionally zero the tpidr_el0 register (since this is fully
            context switched for native tasks and zeroed for compat tasks)
      
        (2) Zero the tp_value state in thread_info before clearing the
            tpidrr0_el0 register for compat tasks (since this is only writable
            by the set_tls compat syscall and therefore not fully switched).
      
      A missing compiler barrier is also added to the compat set_tls syscall.
      
      Cc: <stable@vger.kernel.org>
      Acked-by: NNathan Lynch <Nathan_Lynch@mentor.com>
      Reported-by: NNathan Lynch <Nathan_Lynch@mentor.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      eb35bdd7
  3. 11 9月, 2014 1 次提交
  4. 10 9月, 2014 1 次提交
    • S
      x86/xen: don't copy bogus duplicate entries into kernel page tables · 0b5a5063
      Stefan Bader 提交于
      When RANDOMIZE_BASE (KASLR) is enabled; or the sum of all loaded
      modules exceeds 512 MiB, then loading modules fails with a warning
      (and hence a vmalloc allocation failure) because the PTEs for the
      newly-allocated vmalloc address space are not zero.
      
        WARNING: CPU: 0 PID: 494 at linux/mm/vmalloc.c:128
                 vmap_page_range_noflush+0x2a1/0x360()
      
      This is caused by xen_setup_kernel_pagetables() copying
      level2_kernel_pgt into level2_fixmap_pgt, overwriting many non-present
      entries.
      
      Without KASLR, the normal kernel image size only covers the first half
      of level2_kernel_pgt and module space starts after that.
      
      L4[511]->level3_kernel_pgt[510]->level2_kernel_pgt[  0..255]->kernel
                                                        [256..511]->module
                                [511]->level2_fixmap_pgt[  0..505]->module
      
      This allows 512 MiB of of module vmalloc space to be used before
      having to use the corrupted level2_fixmap_pgt entries.
      
      With KASLR enabled, the kernel image uses the full PUD range of 1G and
      module space starts in the level2_fixmap_pgt. So basically:
      
      L4[511]->level3_kernel_pgt[510]->level2_kernel_pgt[0..511]->kernel
                                [511]->level2_fixmap_pgt[0..505]->module
      
      And now no module vmalloc space can be used without using the corrupt
      level2_fixmap_pgt entries.
      
      Fix this by properly converting the level2_fixmap_pgt entries to MFNs,
      and setting level1_fixmap_pgt as read-only.
      
      A number of comments were also using the the wrong L3 offset for
      level2_kernel_pgt.  These have been corrected.
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
      Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: stable@vger.kernel.org
      0b5a5063
  5. 09 9月, 2014 10 次提交
    • M
      microblaze: Fix number of syscalls · 9fc4b7e2
      Michal Simek 提交于
      Number of syscalls have to be updated too.
      Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
      9fc4b7e2
    • M
      microblaze: Rename Advance setup to Kernel features · b408e2c2
      Michal Simek 提交于
      "Advance setup: menu is misleading that's why rename it.
      Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
      b408e2c2
    • M
      microblaze: Add mm/Kconfig to advance menu · 7acdc1cf
      Michal Simek 提交于
      mm/Kconfig is getting too big to be in root menu.
      Move it to submenu.
      Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
      7acdc1cf
    • C
      arch/microblaze/include/asm/uaccess.h: Use pr_devel() instead of pr_debug() · de295cf0
      Chen Gang 提交于
      When DYNAMIC_DEBUG enabled, pr_debug() depends on KBUILD_MODNAME which
      also depends on the modules number in Makefile. The related information
      in "scripts/Makefile.lib" line 94:
      
        # $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will
        # end up in (or would, if it gets compiled in)
        # Note: Files that end up in two or more modules are compiled without the
        #       KBUILD_MODNAME definition. The reason is that any made-up name would
        #       differ in different configs.
      
      For this case, 'radio-si470x-i2c.o' and 'radio-si470x-common.o' are in
      one line, so cause compiling issue. And 'uaccess.h' is a common shared
      header (not specially for drivers), so use pr_devel() instead of is OK.
      
      The related error with allmodconfig:
      
          CC [M]  drivers/media/radio/si470x/radio-si470x-i2c.o
          CC [M]  drivers/media/radio/si470x/radio-si470x-common.o
        In file included from include/linux/printk.h:257:0,
                         from include/linux/kernel.h:13,
                         from drivers/media/radio/si470x/radio-si470x.h:29,
                         from drivers/media/radio/si470x/radio-si470x-common.c:115:
        ./arch/microblaze/include/asm/uaccess.h: In function 'access_ok':
        include/linux/dynamic_debug.h:66:14: error: 'KBUILD_MODNAME' undeclared (first use in this function)
           .modname = KBUILD_MODNAME,   \
                      ^
        include/linux/dynamic_debug.h:76:2: note: in expansion of macro 'DEFINE_DYNAMIC_DEBUG_METADATA'
          DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);  \
          ^
        include/linux/printk.h:263:2: note: in expansion of macro 'dynamic_pr_debug'
          dynamic_pr_debug(fmt, ##__VA_ARGS__)
          ^
        ./arch/microblaze/include/asm/uaccess.h:101:3: note: in expansion of macro 'pr_debug'
           pr_debug("ACCESS fail: %s at 0x%08x (size 0x%x), seg 0x%08x\n",
           ^
      Signed-off-by: NChen Gang <gang.chen.5i5j@gmail.com>
      Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
      de295cf0
    • C
      arch/microblaze/include/asm/entry.h: Include "linux/linkage.h" to avoid compiling issue · dd035246
      Chen Gang 提交于
      "entry.h" needs 'asmlinkage', and "asm/linkage.h" does not provide it.
      So need include "linux/linkage.h" to use generic one instead of.
      
      The related error (with allmodconfig under microblaze):
      
          CC [M]  drivers/net/ethernet/emulex/benet/be_main.o
        In file included from ./arch/microblaze/include/asm/processor.h:17:0,
                         from include/linux/prefetch.h:14,
                         from drivers/net/ethernet/emulex/benet/be_main.c:18:
        ./arch/microblaze/include/asm/entry.h:33:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
         extern asmlinkage void do_notify_resume(struct pt_regs *regs, int in_syscall);
                           ^
      Signed-off-by: NChen Gang <gang.chen.5i5j@gmail.com>
      Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
      dd035246
    • P
      powerpc: Wire up sys_seccomp(), sys_getrandom() and sys_memfd_create() · 7d59deb5
      Pranith Kumar 提交于
      This patch wires up three new syscalls for powerpc. The three
      new syscalls are seccomp, getrandom and memfd_create.
      Signed-off-by: NPranith Kumar <bobby.prani@gmail.com>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      7d59deb5
    • C
      powerpc: Make CONFIG_FHANDLE=y for all 64 bit powerpc defconfigs · d11dfd17
      Cyril Bur 提交于
      CONFIG_FHANDLE is a requirement for systemd and with the increasing
      uptake of systemd within distros it makes sense for 64 bit defconfigs
      to include it.
      Signed-off-by: NCyril Bur <cyril.bur@au1.ibm.com>
      d11dfd17
    • L
      powerpc: use machine_subsys_initcall() for opal_hmi_handler_init() · c1c8a92f
      Li Zhong 提交于
      As opal_message_init() uses machine_early_initcall(powernv, ), and
      opal_hmi_handler_init() depends on that early initcall, so it also needs
      use machine_* to check the machine_id.
      Signed-off-by: NLi Zhong <zhong@linux.vnet.ibm.com>
      c1c8a92f
    • A
      powerpc/perf: Fix ABIv2 kernel backtraces · 85101af1
      Anton Blanchard 提交于
      ABIv2 kernels are failing to backtrace through the kernel. An example:
      
      39.30%  readseek2_proce  [kernel.kallsyms]    [k] find_get_entry
                  |
                  --- find_get_entry
                     __GI___libc_read
      
      The problem is in valid_next_sp() where we check that the new stack
      pointer is at least STACK_FRAME_OVERHEAD below the previous one.
      
      ABIv1 has a minimum stack frame size of 112 bytes consisting of 48 bytes
      and 64 bytes of parameter save area. ABIv2 changes that to 32 bytes
      with no paramter save area.
      
      STACK_FRAME_OVERHEAD is in theory the minimum stack frame size,
      but we over 240 uses of it, some of which assume that it includes
      space for the parameter area.
      
      We need to work through all our stack defines and rationalise them
      but let's fix perf now by creating STACK_FRAME_MIN_SIZE and using
      in valid_next_sp(). This fixes the issue:
      
      30.64%  readseek2_proce  [kernel.kallsyms]    [k] find_get_entry
                  |
                  --- find_get_entry
                     pagecache_get_page
                     generic_file_read_iter
                     new_sync_read
                     vfs_read
                     sys_read
                     syscall_exit
                     __GI___libc_read
      
      Cc: stable@vger.kernel.org # 3.16+
      Reported-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      85101af1
    • T
      powerpc/pseries: Fix endian issues in memory hotplug · c9ac408b
      Thomas Falcon 提交于
      Values acquired from Open Firmware are in 32-bit big endian format
      and need to be handled on little endian architectures.  This patch
      ensures values are in cpu endian when hotplugging memory.
      Signed-off-by: NThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      c9ac408b
  6. 05 9月, 2014 11 次提交
  7. 04 9月, 2014 6 次提交
  8. 03 9月, 2014 3 次提交
    • L
      powerpc/kvm/cma: Fix panic introduces by signed shift operation · 02a68d05
      Laurent Dufour 提交于
      fc95ca72 introduces a memset in
      kvmppc_alloc_hpt since the general CMA doesn't clear the memory it
      allocates.
      
      However, the size argument passed to memset is computed from a signed value
      and its signed bit is extended by the cast the compiler is doing. This lead
      to extremely large size value when dealing with order value >= 31, and
      almost all the memory following the allocated space is cleaned. As a
      consequence, the system is panicing and may even fail spawning the kdump
      kernel.
      
      This fix makes use of an unsigned value for the memset's size argument to
      avoid sign extension. Among this fix, another shift operation which may
      lead to signed extended value too is also fixed.
      
      Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NLaurent Dufour <ldufour@linux.vnet.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      02a68d05
    • T
      video: fix composite video connector compatible string · 32797b3e
      Tomi Valkeinen 提交于
      The quite-recently-added analog-tv-connector bindings say that the
      compatible string for composite video connector is
      "composite-connector". That string is also used in the omap3-n900.dts
      file. However, the connector driver uses "composite-video-connector", so
      this has never worked.
      
      While changing the driver's compatible string to "composite-connector"
      would be safer, as published DT bindings should not be changed, I'd
      rather fix the bindings in this case for two reasons:
      
      * composite-connector is a bit too generic name, as it doesn't even hint
        at video.
      * it's clear that this has never worked, which means no one has used
        those bindings, which should make it safe to change this.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      32797b3e
    • L
      ARM: ux500: disable msp2 node on Snowball · dbd366fd
      Linus Walleij 提交于
      Analogous to commit 8858d88a
      that fixed commit 70b41abc
      "ARM: ux500: move MSP pin control to the device tree"
      accidentally activated MSP2, giving rise to a boot scroll
      scream as the kernel attempts to probe a driver for it and
      fails to obtain DMA channel 14.
      
      For some reason I forgot to fix this on the Snowball. Fix
      this up by marking the node disabled again.
      
      Cc: Lee Jones <lee.jones@linaro.org>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Tested-by: NKevin Hilman <khilman@linaro.org>
      Signed-off-by: NKevin Hilman <khilman@linaro.org>
      dbd366fd
  9. 02 9月, 2014 2 次提交
  10. 01 9月, 2014 1 次提交