1. 09 5月, 2017 1 次提交
  2. 02 5月, 2017 1 次提交
    • S
      xen/arm,arm64: fix xen_dma_ops after 815dd187 "Consolidate get_dma_ops..." · e0586326
      Stefano Stabellini 提交于
      The following commit:
      
        commit 815dd187
        Author: Bart Van Assche <bart.vanassche@sandisk.com>
        Date:   Fri Jan 20 13:04:04 2017 -0800
      
            treewide: Consolidate get_dma_ops() implementations
      
      rearranges get_dma_ops in a way that xen_dma_ops are not returned when
      running on Xen anymore, dev->dma_ops is returned instead (see
      arch/arm/include/asm/dma-mapping.h:get_arch_dma_ops and
      include/linux/dma-mapping.h:get_dma_ops).
      
      Fix the problem by storing dev->dma_ops in dev_archdata, and setting
      dev->dma_ops to xen_dma_ops. This way, xen_dma_ops is returned naturally
      by get_dma_ops. The Xen code can retrieve the original dev->dma_ops from
      dev_archdata when needed. It also allows us to remove __generic_dma_ops
      from common headers.
      Signed-off-by: NStefano Stabellini <sstabellini@kernel.org>
      Tested-by: NJulien Grall <julien.grall@arm.com>
      Suggested-by: NCatalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: NCatalin Marinas <catalin.marinas@arm.com>
      Cc: <stable@vger.kernel.org>        [4.11+]
      CC: linux@armlinux.org.uk
      CC: catalin.marinas@arm.com
      CC: will.deacon@arm.com
      CC: boris.ostrovsky@oracle.com
      CC: jgross@suse.com
      CC: Julien Grall <julien.grall@arm.com>
      e0586326
  3. 29 4月, 2017 1 次提交
  4. 26 4月, 2017 3 次提交
    • G
      ARM: 8672/1: mm: remove tasklist locking from update_sections_early() · 11ce4b33
      Grygorii Strashko 提交于
      The below backtrace can be observed on -rt kernel with
      CONFIG_DEBUG_MODULE_RONX (4.9 kernel CONFIG_DEBUG_RODATA) option enabled:
      
       BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:993
       in_atomic(): 1, irqs_disabled(): 128, pid: 14, name: migration/0
       1 lock held by migration/0/14:
        #0:  (tasklist_lock){+.+...}, at: [<c01183e8>] update_sections_early+0x24/0xdc
       irq event stamp: 38
       hardirqs last  enabled at (37): [<c08f6f7c>] _raw_spin_unlock_irq+0x24/0x68
       hardirqs last disabled at (38): [<c01fdfe8>] multi_cpu_stop+0xd8/0x138
       softirqs last  enabled at (0): [<c01303ec>] copy_process.part.5+0x238/0x1b64
       softirqs last disabled at (0): [<  (null)>]   (null)
       Preemption disabled at: [<c01fe244>] cpu_stopper_thread+0x80/0x10c
       CPU: 0 PID: 14 Comm: migration/0 Not tainted 4.9.21-rt16-02220-g49e319c #15
       Hardware name: Generic DRA74X (Flattened Device Tree)
       [<c0112014>] (unwind_backtrace) from [<c010d370>] (show_stack+0x10/0x14)
       [<c010d370>] (show_stack) from [<c049beb8>] (dump_stack+0xa8/0xd4)
       [<c049beb8>] (dump_stack) from [<c01631a0>] (___might_sleep+0x1bc/0x2ac)
       [<c01631a0>] (___might_sleep) from [<c08f7244>] (__rt_spin_lock+0x1c/0x30)
       [<c08f7244>] (__rt_spin_lock) from [<c08f77a4>] (rt_read_lock+0x54/0x68)
       [<c08f77a4>] (rt_read_lock) from [<c01183e8>] (update_sections_early+0x24/0xdc)
       [<c01183e8>] (update_sections_early) from [<c01184b0>] (__fix_kernmem_perms+0x10/0x1c)
       [<c01184b0>] (__fix_kernmem_perms) from [<c01fe010>] (multi_cpu_stop+0x100/0x138)
       [<c01fe010>] (multi_cpu_stop) from [<c01fe24c>] (cpu_stopper_thread+0x88/0x10c)
       [<c01fe24c>] (cpu_stopper_thread) from [<c015edc4>] (smpboot_thread_fn+0x174/0x31c)
       [<c015edc4>] (smpboot_thread_fn) from [<c015a988>] (kthread+0xf0/0x108)
       [<c015a988>] (kthread) from [<c0108818>] (ret_from_fork+0x14/0x3c)
       Freeing unused kernel memory: 1024K (c0d00000 - c0e00000)
      
      The stop_machine() is called with cpus = NULL from fix_kernmem_perms() and
      mark_rodata_ro() which means only one CPU will execute
      update_sections_early() while all other CPUs will spin and wait. Hence,
      it's safe to remove tasklist locking from update_sections_early(). As part
      of this change also mark functions which are local to this module as
      static.
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Acked-by: NLaura Abbott <labbott@redhat.com>
      Acked-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      11ce4b33
    • V
      ARM: 8671/1: V7M: Preserve registers across switch from Thread to Handler mode · b70cd406
      Vladimir Murzin 提交于
      According to ARMv7 ARM, when exception is taken content of r0-r3, r12
      is unknown (see ExceptionTaken() pseudocode). Even though existent
      implementations keep these register unchanged, preserve them to be in
      line with architecture.
      Reported-by: NDobromir Stefanov <dobromir.stefanov@arm.com>
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      b70cd406
    • V
      ARM: 8670/1: V7M: Do not corrupt vector table around v7m_invalidate_l1 call · 6d805949
      Vladimir Murzin 提交于
      We save/restore registers around v7m_invalidate_l1 to address pointed
      by r12, which is vector table, so the first eight entries are
      overwritten with a garbage. We already have stack setup at that stage,
      so use it to save/restore register.
      
      Fixes: 6a8146f4 ("ARM: 8609/1: V7M: Add support for the Cortex-M7 processor")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      6d805949
  5. 25 4月, 2017 1 次提交
    • L
      ARM: Implement pci_remap_cfgspace() interface · b9cdbe6e
      Lorenzo Pieralisi 提交于
      The PCI bus specification (rev 3.0, 3.2.5 "Transaction Ordering and
      Posting") defines rules for PCI configuration space transactions ordering
      and posting, that state that configuration writes have to be non-posted
      transactions.
      
      Current ioremap interface on ARM provides mapping functions that provide
      "bufferable" writes transactions (ie ioremap uses MT_DEVICE memory type)
      aka posted writes, so PCI host controller drivers have no arch interface to
      remap PCI configuration space with memory attributes that comply with the
      PCI specifications for configuration space.
      
      Implement an ARM specific pci_remap_cfgspace() interface that allows to map
      PCI config memory regions with MT_UNCACHED memory type (ie strongly ordered
      - non-posted writes), providing a remap function that complies with PCI
      specifications for config space transactions.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Russell King <linux@armlinux.org.uk>
      b9cdbe6e
  6. 20 4月, 2017 1 次提交
    • J
      ARM: 8667/3: Fix memory attribute inconsistencies when using fixmap · b089c31c
      Jon Medhurst 提交于
      To cope with the variety in ARM architectures and configurations, the
      pagetable attributes for kernel memory are generated at runtime to match
      the system the kernel finds itself on. This calculated value is stored
      in pgprot_kernel.
      
      However, when early fixmap support was added for ARM (commit
      a5f4c561) the attributes used for mappings were hard coded because
      pgprot_kernel is not set up early enough. Unfortunately, when fixmap is
      used after early boot this means the memory being mapped can have
      different attributes to existing mappings, potentially leading to
      unpredictable behaviour. A specific problem also exists due to the hard
      coded values not include the 'shareable' attribute which means on
      systems where this matters (e.g. those with multiple CPU clusters) the
      cache contents for a memory location can become inconsistent between
      CPUs.
      
      To resolve these issues we change fixmap to use the same memory
      attributes (from pgprot_kernel) that the rest of the kernel uses. To
      enable this we need to refactor the initialisation code so
      build_mem_type_table() is called early enough. Note, that relies on early
      param parsing for memory type overrides passed via the kernel command
      line, so we need to make sure this call is still after
      parse_early_params().
      
      [ardb: keep early_fixmap_init() before param parsing, for earlycon]
      
      Fixes: a5f4c561 ("ARM: 8415/1: early fixmap support for earlycon")
      Cc: <stable@vger.kernel.org> # v4.3+
      Tested-by: Nafzal mohammed <afzal.mohd.ma@gmail.com>
      Signed-off-by: NJon Medhurst <tixy@linaro.org>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      b089c31c
  7. 09 4月, 2017 3 次提交
  8. 30 3月, 2017 3 次提交
    • K
      ARM: 8666/1: mm: dump: Add domain to output · dd59f974
      Kees Cook 提交于
      This adds the memory domain (on non-LPAE) to the PMD and PTE dumps. This
      isn't in the regular PMD bits because I couldn't find a clean way to
      fall back to retain some of the PMD bits when reporting PTE. So this is
      special-cased currently.
      
      New output example:
      
        ---[ Modules ]---
        0x7f000000-0x7f001000       4K KERNEL      ro x  SHD MEM/CACHED/WBWA
        0x7f001000-0x7f002000       4K KERNEL      ro NX SHD MEM/CACHED/WBWA
        0x7f002000-0x7f004000       8K KERNEL      RW NX SHD MEM/CACHED/WBWA
        ---[ Kernel Mapping ]---
        0x80000000-0x80100000       1M KERNEL      RW NX SHD
        0x80100000-0x80800000       7M KERNEL      ro x  SHD
        0x80800000-0x80b00000       3M KERNEL      ro NX SHD
        0x80b00000-0xa0000000     501M KERNEL      RW NX SHD
        ...
        ---[ Vectors ]---
        0xffff0000-0xffff1000       4K VECTORS USR ro x  SHD MEM/CACHED/WBWA
        0xffff1000-0xffff2000       4K VECTORS     ro x  SHD MEM/CACHED/WBWA
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      dd59f974
    • A
      ARM: 8665/1: nommu: access ID_PFR1 only if CPUID scheme · 3cc070c1
      afzal mohammed 提交于
      Greg upon trying to boot no-MMU Kernel on ARM926EJ reported boot
      failure. He root caused it to ID_PFR1 access introduced by the
      commit mentioned in the fixes tag below.
      
      All CP15 processors need not have processor feature registers, only
      for architectures defined by CPUID scheme would have it. Hence check
      for it before accessing processor feature register, ID_PFR1.
      
      Fixes: f8300a0b ("ARM: 8647/2: nommu: dynamic exception base address setting")
      Reported-by: NGreg Ungerer <gerg@uclinux.org>
      Signed-off-by: Nafzal mohammed <afzal.mohd.ma@gmail.com>
      Tested-by: NGreg Ungerer <gerg@uclinux.org>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      3cc070c1
    • R
      ARM: dma-mapping: disallow dma_get_sgtable() for non-kernel managed memory · 916a008b
      Russell King 提交于
      dma_get_sgtable() tries to create a scatterlist table containing valid
      struct page pointers for the coherent memory allocation passed in to it.
      
      However, memory can be declared via dma_declare_coherent_memory(), or
      via other reservation schemes which means that coherent memory is not
      guaranteed to be backed by struct pages.  In such cases, the resulting
      scatterlist table contains pointers to invalid pages, which causes
      kernel oops later.
      
      This patch adds detection of such memory, and refuses to create a
      scatterlist table for such memory.
      Reported-by: NShuah Khan <shuahkhan@gmail.com>
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      916a008b
  9. 17 3月, 2017 1 次提交
  10. 02 3月, 2017 5 次提交
  11. 28 2月, 2017 11 次提交
  12. 25 2月, 2017 1 次提交
  13. 13 2月, 2017 1 次提交
  14. 08 2月, 2017 2 次提交
  15. 30 1月, 2017 1 次提交
  16. 25 1月, 2017 2 次提交
    • P
      arm: migrate exception table users off module.h and onto extable.h · 0ea9365a
      Paul Gortmaker 提交于
      These files were only including module.h for exception table
      related functions.  We've now separated that content out into its
      own file "extable.h" so now move over to that and avoid all the
      extra header content in module.h that we don't really need to compile
      these files.
      
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: linux-arm-kernel@lists.infradead.org
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      0ea9365a
    • B
      treewide: Constify most dma_map_ops structures · 5299709d
      Bart Van Assche 提交于
      Most dma_map_ops structures are never modified. Constify these
      structures such that these can be write-protected. This patch
      has been generated as follows:
      
      git grep -l 'struct dma_map_ops' |
        xargs -d\\n sed -i \
          -e 's/struct dma_map_ops/const struct dma_map_ops/g' \
          -e 's/const struct dma_map_ops {/struct dma_map_ops {/g' \
          -e 's/^const struct dma_map_ops;$/struct dma_map_ops;/' \
          -e 's/const const struct dma_map_ops /const struct dma_map_ops /g';
      sed -i -e 's/const \(struct dma_map_ops intel_dma_ops\)/\1/' \
        $(git grep -l 'struct dma_map_ops intel_dma_ops');
      sed -i -e 's/const \(struct dma_map_ops dma_iommu_ops\)/\1/' \
        $(git grep -l 'struct dma_map_ops' | grep ^arch/powerpc);
      sed -i -e '/^struct vmd_dev {$/,/^};$/ s/const \(struct dma_map_ops[[:blank:]]dma_ops;\)/\1/' \
             -e '/^static void vmd_setup_dma_ops/,/^}$/ s/const \(struct dma_map_ops \*dest\)/\1/' \
             -e 's/const \(struct dma_map_ops \*dest = \&vmd->dma_ops\)/\1/' \
          drivers/pci/host/*.c
      sed -i -e '/^void __init pci_iommu_alloc(void)$/,/^}$/ s/dma_ops->/intel_dma_ops./' arch/ia64/kernel/pci-dma.c
      sed -i -e 's/static const struct dma_map_ops sn_dma_ops/static struct dma_map_ops sn_dma_ops/' arch/ia64/sn/pci/pci_dma.c
      sed -i -e 's/(const struct dma_map_ops \*)//' drivers/misc/mic/bus/vop_bus.c
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: x86@kernel.org
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      5299709d
  17. 19 1月, 2017 1 次提交
  18. 11 1月, 2017 1 次提交
新手
引导
客服 返回
顶部