1. 23 12月, 2013 5 次提交
  2. 20 12月, 2013 1 次提交
    • W
      arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events · cdc27c27
      Will Deacon 提交于
      Commit 8f34a1da ("arm64: ptrace: use HW_BREAKPOINT_EMPTY type for
      disabled breakpoints") fixed an issue with GDB trying to zero breakpoint
      control registers. The problem there is that the arch hw_breakpoint code
      will attempt to create a (disabled), execute breakpoint of length 0.
      
      This will fail validation and report unexpected failure to GDB. To avoid
      this, we treated disabled breakpoints as HW_BREAKPOINT_EMPTY, but that
      seems to have broken with recent kernels, causing watchpoints to be
      treated as TYPE_INST in the core code and returning ENOSPC for any
      further breakpoints.
      
      This patch fixes the problem by prioritising the `enable' field of the
      breakpoint: if it is cleared, we simply update the perf_event_attr to
      indicate that the thing is disabled and don't bother changing either the
      type or the length. This reinforces the behaviour that the breakpoint
      control register is essentially read-only apart from the enable bit
      when disabling a breakpoint.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: NAaron Liu <liucy214@gmail.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      cdc27c27
  3. 19 12月, 2013 4 次提交
    • V
      ARC: Allow conditional multiple inclusion of uapi/asm/unistd.h · 1e01c7eb
      Vineet Gupta 提交于
      Commit 97bc386f "ARC: Add guard macro to uapi/asm/unistd.h"
      inhibited multiple inclusion of ARCH unistd.h. This however hosed the system
      since Generic syscall table generator relies on it being included twice,
      and in lack-of an empty table was emitted by C preprocessor.
      
      Fix that by allowing one exception to rule for the special case (just
      like Xtensa)
      Suggested-by: NChen Gang <gang.chen.5i5j@gmail.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      1e01c7eb
    • G
      sh: always link in helper functions extracted from libgcc · 84ed8a99
      Geert Uytterhoeven 提交于
      E.g. landisk_defconfig, which has CONFIG_NTFS_FS=m:
      
        ERROR: "__ashrdi3" [fs/ntfs/ntfs.ko] undefined!
      
      For "lib-y", if no symbols in a compilation unit are referenced by other
      units, the compilation unit will not be included in vmlinux.  This
      breaks modules that do reference those symbols.
      
      Use "obj-y" instead to fix this.
      
      http://kisskb.ellerman.id.au/kisskb/buildresult/8838077/
      
      This doesn't fix all cases. There are others, e.g. udivsi3.
      This is also not limited to sh, many architectures handle this in the
      same way.
      
      A simple solution is to unconditionally include all helper functions.
      A more complex solution is to make the choice of "lib-y" or "obj-y" depend
      on CONFIG_MODULES:
      
        obj-$(CONFIG_MODULES) += ...
        lib-y($CONFIG_MODULES) += ...
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Tested-by: NNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Reviewed-by: NNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      84ed8a99
    • R
      mm: fix TLB flush race between migration, and change_protection_range · 20841405
      Rik van Riel 提交于
      There are a few subtle races, between change_protection_range (used by
      mprotect and change_prot_numa) on one side, and NUMA page migration and
      compaction on the other side.
      
      The basic race is that there is a time window between when the PTE gets
      made non-present (PROT_NONE or NUMA), and the TLB is flushed.
      
      During that time, a CPU may continue writing to the page.
      
      This is fine most of the time, however compaction or the NUMA migration
      code may come in, and migrate the page away.
      
      When that happens, the CPU may continue writing, through the cached
      translation, to what is no longer the current memory location of the
      process.
      
      This only affects x86, which has a somewhat optimistic pte_accessible.
      All other architectures appear to be safe, and will either always flush,
      or flush whenever there is a valid mapping, even with no permissions
      (SPARC).
      
      The basic race looks like this:
      
      CPU A			CPU B			CPU C
      
      						load TLB entry
      make entry PTE/PMD_NUMA
      			fault on entry
      						read/write old page
      			start migrating page
      			change PTE/PMD to new page
      						read/write old page [*]
      flush TLB
      						reload TLB from new entry
      						read/write new page
      						lose data
      
      [*] the old page may belong to a new user at this point!
      
      The obvious fix is to flush remote TLB entries, by making sure that
      pte_accessible aware of the fact that PROT_NONE and PROT_NUMA memory may
      still be accessible if there is a TLB flush pending for the mm.
      
      This should fix both NUMA migration and compaction.
      
      [mgorman@suse.de: fix build]
      Signed-off-by: NRik van Riel <riel@redhat.com>
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Cc: Alex Thorlton <athorlton@sgi.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      20841405
    • M
      mm: numa: serialise parallel get_user_page against THP migration · 2b4847e7
      Mel Gorman 提交于
      Base pages are unmapped and flushed from cache and TLB during normal
      page migration and replaced with a migration entry that causes any
      parallel NUMA hinting fault or gup to block until migration completes.
      
      THP does not unmap pages due to a lack of support for migration entries
      at a PMD level.  This allows races with get_user_pages and
      get_user_pages_fast which commit 3f926ab9 ("mm: Close races between
      THP migration and PMD numa clearing") made worse by introducing a
      pmd_clear_flush().
      
      This patch forces get_user_page (fast and normal) on a pmd_numa page to
      go through the slow get_user_page path where it will serialise against
      THP migration and properly account for the NUMA hinting fault.  On the
      migration side the page table lock is taken for each PTE update.
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Reviewed-by: NRik van Riel <riel@redhat.com>
      Cc: Alex Thorlton <athorlton@sgi.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2b4847e7
  4. 18 12月, 2013 3 次提交
    • P
      KVM: PPC: Book3S HV: Don't drop low-order page address bits · df9059bb
      Paul Mackerras 提交于
      Commit caaa4c80 ("KVM: PPC: Book3S HV: Fix physical address
      calculations") unfortunately resulted in some low-order address bits
      getting dropped in the case where the guest is creating a 4k HPTE
      and the host page size is 64k.  By getting the low-order bits from
      hva rather than gpa we miss out on bits 12 - 15 in this case, since
      hva is at page granularity.  This puts the missing bits back in.
      Reported-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      df9059bb
    • A
      powerpc: book3s: kvm: Don't abuse host r2 in exit path · 36e7bb38
      Aneesh Kumar K.V 提交于
      We don't use PACATOC for PR. Avoid updating HOST_R2 with PR
      KVM mode when both HV and PR are enabled in the kernel. Without this we
      get the below crash
      
      (qemu)
      Unable to handle kernel paging request for data at address 0xffffffffffff8310
      Faulting instruction address: 0xc00000000001d5a4
      cpu 0x2: Vector: 300 (Data Access) at [c0000001dc53aef0]
          pc: c00000000001d5a4: .vtime_delta.isra.1+0x34/0x1d0
          lr: c00000000001d760: .vtime_account_system+0x20/0x60
          sp: c0000001dc53b170
         msr: 8000000000009032
         dar: ffffffffffff8310
       dsisr: 40000000
        current = 0xc0000001d76c62d0
        paca    = 0xc00000000fef1100   softe: 0        irq_happened: 0x01
          pid   = 4472, comm = qemu-system-ppc
      enter ? for help
      [c0000001dc53b200] c00000000001d760 .vtime_account_system+0x20/0x60
      [c0000001dc53b290] c00000000008d050 .kvmppc_handle_exit_pr+0x60/0xa50
      [c0000001dc53b340] c00000000008f51c kvm_start_lightweight+0xb4/0xc4
      [c0000001dc53b510] c00000000008cdf0 .kvmppc_vcpu_run_pr+0x150/0x2e0
      [c0000001dc53b9e0] c00000000008341c .kvmppc_vcpu_run+0x2c/0x40
      [c0000001dc53ba50] c000000000080af4 .kvm_arch_vcpu_ioctl_run+0x54/0x1b0
      [c0000001dc53bae0] c00000000007b4c8 .kvm_vcpu_ioctl+0x478/0x730
      [c0000001dc53bca0] c0000000002140cc .do_vfs_ioctl+0x4ac/0x770
      [c0000001dc53bd80] c0000000002143e8 .SyS_ioctl+0x58/0xb0
      [c0000001dc53be30] c000000000009e58 syscall_exit+0x0/0x98
      Signed-off-by: NAlexander Graf <agraf@suse.de>
      36e7bb38
    • T
      Revert "ARM: OMAP2+: Remove legacy mux code for display.c" · 130f769e
      Tomi Valkeinen 提交于
      Commit e30b06f4 (ARM: OMAP2+: Remove
      legacy mux code for display.c) removed non-DT DSI and HDMI pinmuxing.
      However, DSI pinmuxing is still needed, and removing that caused DSI
      displays not to work.
      
      This reverts the DSI parts of the commit.
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      130f769e
  5. 14 12月, 2013 2 次提交
    • T
      ARM: s3c64xx: dt: Fix boot failure due to double clock initialization · cb120572
      Tomasz Figa 提交于
      Commit
      
      4178bac4 ARM: call of_clk_init from default time_init handler
      
      added implicit call to of_clk_init() from default time_init callback,
      but it did not change platforms calling it from other callbacks, despite
      of not having custom time_init callbacks. This caused double clock
      initialization on such platforms, leading to boot failures. An example
      of such platform is mach-s3c64xx.
      
      This patch fixes boot failure on s3c64xx by dropping custom init_irq
      callback, which had a call to of_clk_init() and moving system reset
      initialization to init_machine callback. This allows us to have
      clocks initialized properly without a need to have custom init_time or
      init_irq callbacks.
      Signed-off-by: NTomasz Figa <tomasz.figa@gmail.com>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      cb120572
    • R
      ARM: fix asm/memory.h build error · b713aa0b
      Russell King 提交于
      Jason Gunthorpe reports a build failure when ARM_PATCH_PHYS_VIRT is
      not defined:
      
      In file included from arch/arm/include/asm/page.h:163:0,
                       from include/linux/mm_types.h:16,
                       from include/linux/sched.h:24,
                       from arch/arm/kernel/asm-offsets.c:13:
      arch/arm/include/asm/memory.h: In function '__virt_to_phys':
      arch/arm/include/asm/memory.h:244:40: error: 'PHYS_OFFSET' undeclared (first use in this function)
      arch/arm/include/asm/memory.h:244:40: note: each undeclared identifier is reported only once for each function it appears in
      arch/arm/include/asm/memory.h: In function '__phys_to_virt':
      arch/arm/include/asm/memory.h:249:13: error: 'PHYS_OFFSET' undeclared (first use in this function)
      
      Fixes: ca5a45c0 ("ARM: mm: use phys_addr_t appropriately in p2v and v2p conversions")
      Tested-By: NJason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      b713aa0b
  6. 13 12月, 2013 13 次提交
  7. 12 12月, 2013 7 次提交
    • M
      ARM: sun6i: dt: Fix interrupt trigger types · 6f97dc8d
      Maxime Ripard 提交于
      The Allwinner A31 uses the ARM GIC as its internal interrupts controller. The
      GIC can work on several interrupt triggers, and the A31 was actually setting it
      up to use a rising edge as a trigger, while it was actually a level high
      trigger, leading to some interrupts that would be completely ignored if the
      edge was missed.
      Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
      Acked-by: NHans de Goede <hdegoede@redhat.com>
      Cc: stable@vger.kernel.org # 3.12+
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      6f97dc8d
    • M
      ARM: sun7i: dt: Fix interrupt trigger types · 378d0aee
      Maxime Ripard 提交于
      The Allwinner A20 uses the ARM GIC as its internal interrupts controller. The
      GIC can work on several interrupt triggers, and the A20 was actually setting it
      up to use a rising edge as a trigger, while it was actually a level high
      trigger, leading to some interrupts that would be completely ignored if the
      edge was missed.
      Signed-off-by: NMaxime Ripard <maxime.ripard@free-electrons.com>
      Acked-by: NHans de Goede <hdegoede@redhat.com>
      Cc: stable@vger.kernel.org #3.12+
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      378d0aee
    • S
      ARM: tegra: add missing break to fuse initialization code · b988ba1b
      Stephen Warren 提交于
      Add a missing break to the switch in tegra_init_fuse() which determines
      which SoC the code is running on. This prevents the Tegra30+ fuse
      handling code from running on Tegra20.
      
      Fixes: 3bd1ae57 ("ARM: tegra: add fuses as device randomness")
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      b988ba1b
    • S
      ARM: pxa: prevent PXA270 occasional reboot freezes · ff88b472
      Sergei Ianovich 提交于
      Erratum 71 of PXA270M Processor Family Specification Update
      (April 19, 2010) explains that watchdog reset time is just
      8us insead of 10ms in EMTS.
      
      If SDRAM is not reset, it causes memory bus congestion and
      the device hangs. We put SDRAM in selfresh mode before watchdog
      reset, removing potential freezes.
      
      Without this patch PXA270-based ICP DAS LP-8x4x hangs after up to 40
      reboots. With this patch it has successfully rebooted 500 times.
      Signed-off-by: NSergei Ianovich <ynvich@gmail.com>
      Tested-by: NMarek Vasut <marex@denx.de>
      Signed-off-by: NHaojian Zhuang <haojian.zhuang@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      ff88b472
    • D
      ARM: pxa: tosa: fix keys mapping · 506cac15
      Dmitry Eremin-Solenikov 提交于
      When converting from tosa-keyboard driver to matrix keyboard, tosa keys
      received extra 1 column shift. Replace that with correct values to make
      keyboard work again.
      
      Fixes: f69a6548 ('[ARM] pxa/tosa: make use of the matrix keypad driver')
      Signed-off-by: NDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Signed-off-by: NHaojian Zhuang <haojian.zhuang@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      506cac15
    • I
      arm: xen: foreign mapping PTEs are special. · a7892f32
      Ian Campbell 提交于
      These mappings are in fact special and require special handling in privcmd,
      which already exists. Failure to mark the PTE as special on arm64 causes all
      sorts of bad PTE fun. e.g.
      
      e.g.:
      
      BUG: Bad page map in process xl  pte:e0004077b33f53 pmd:4079575003
      page:ffffffbce1a2f328 count:1 mapcount:-1 mapping:          (null) index:0x0
      page flags: 0x4000000000000014(referenced|dirty)
      addr:0000007fb5259000 vm_flags:040644fa anon_vma:          (null) mapping:ffffffc03a6fda58 index:0
      vma->vm_ops->fault: privcmd_fault+0x0/0x38
      vma->vm_file->f_op->mmap: privcmd_mmap+0x0/0x2c
      CPU: 0 PID: 2657 Comm: xl Not tainted 3.12.0+ #102
      Call trace:
      [<ffffffc0000880f8>] dump_backtrace+0x0/0x12c
      [<ffffffc000088238>] show_stack+0x14/0x1c
      [<ffffffc0004b67e0>] dump_stack+0x70/0x90
      [<ffffffc000125690>] print_bad_pte+0x12c/0x1bc
      [<ffffffc0001268f4>] unmap_single_vma+0x4cc/0x700
      [<ffffffc0001273b4>] unmap_vmas+0x68/0xb4
      [<ffffffc00012c050>] unmap_region+0xcc/0x1d4
      [<ffffffc00012df20>] do_munmap+0x218/0x314
      [<ffffffc00012e060>] vm_munmap+0x44/0x64
      [<ffffffc00012ed78>] SyS_munmap+0x24/0x34
      
      Where unmap_single_vma contains inlined -> unmap_page_range -> zap_pud_range
      -> zap_pmd_range -> zap_pte_range -> print_bad_pte.
      
      Or:
      
      BUG: Bad page state in process xl  pfn:4077b4d
      page:ffffffbce1a2f8d8 count:0 mapcount:-1 mapping:          (null) index:0x0
      page flags: 0x4000000000000014(referenced|dirty)
      Modules linked in:
      CPU: 0 PID: 2657 Comm: xl Tainted: G    B        3.12.0+ #102
      Call trace:
      [<ffffffc0000880f8>] dump_backtrace+0x0/0x12c
      [<ffffffc000088238>] show_stack+0x14/0x1c
      [<ffffffc0004b67e0>] dump_stack+0x70/0x90
      [<ffffffc00010f798>] bad_page+0xc4/0x110
      [<ffffffc00010f8b4>] free_pages_prepare+0xd0/0xd8
      [<ffffffc000110e94>] free_hot_cold_page+0x28/0x178
      [<ffffffc000111460>] free_hot_cold_page_list+0x38/0x60
      [<ffffffc000114cf0>] release_pages+0x190/0x1dc
      [<ffffffc00012c0e0>] unmap_region+0x15c/0x1d4
      [<ffffffc00012df20>] do_munmap+0x218/0x314
      [<ffffffc00012e060>] vm_munmap+0x44/0x64
      [<ffffffc00012ed78>] SyS_munmap+0x24/0x34
      
      x86 already gets this correct. 32-bit arm gets away with this because there is
      not PTE_SPECIAL bit in the PTE there and the vm_normal_page fallback path does
      the right thing.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      a7892f32
    • S
      xen/arm64: do not call the swiotlb functions twice · 02ab71cd
      Stefano Stabellini 提交于
      On arm64 the dma_map_ops implementation is based on the swiotlb.
      swiotlb-xen, used by default in dom0 on Xen, is also based on the
      swiotlb.
      
      Avoid calling into the default arm64 dma_map_ops functions from
      xen_dma_map_page, xen_dma_unmap_page, xen_dma_sync_single_for_cpu, and
      xen_dma_sync_single_for_device otherwise we end up calling into the
      swiotlb twice.
      
      When arm64 gets a non-swiotlb based implementation of dma_map_ops, we'll
      probably have to reintroduce dma_map_ops calls in page-coherent.h.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      CC: catalin.marinas@arm.com
      CC: Will.Deacon@arm.com
      CC: Ian.Campbell@citrix.com
      02ab71cd
  8. 11 12月, 2013 5 次提交