23 Oct, 2015

1 commit

  • commit 53960059d56ecef67d4ddd546731623641a3d2d1 upstream.

    If there is a DMA zone (usually 24bit = 16MB I believe), but no DMA32
    zone, as is the case for some 32-bit kernels, then massage_gfp_flags()
    will cause DMA memory allocated for devices with a 32..63-bit
    coherent_dma_mask to fall back to using __GFP_DMA, even though there may
    only be 32-bits of physical address available anyway.

    Correct that case to compare against a mask the size of phys_addr_t
    instead of always using a 64-bit mask.

    Signed-off-by: James Hogan
    Fixes: a2e715a86c6d ("MIPS: DMA: Fix computation of DMA flags from device's coherent_dma_mask.")
    Cc: Ralf Baechle
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/9610/
    Signed-off-by: Ralf Baechle
    Signed-off-by: Greg Kroah-Hartman

    James Hogan
     

11 Aug, 2015

1 commit

  • commit cccf34e9411c41b0cbfb41980fe55fc8e7c98fd2 upstream.

    MT_SMP is not the only SMP option for MT cores. The MT_SMP option
    allows more than one VPE per core to appear as a secondary CPU in the
    system. Because of how CM works, it propagates the address-based
    cache ops to the secondary cores but not the index-based ones.
    Because of that, the code does not use IPIs to flush the L1 caches on
    secondary cores because the CM would have done that already. However,
    the CM functionality is independent of the type of SMP kernel so even in
    non-MT kernels, IPIs are not necessary. As a result of which, we change
    the conditional to depend on the CM presence. Moreover, since VPEs on
    the same core share the same L1 caches, there is no need to send an
    IPI on all of them so we calculate a suitable cpumask with only one
    VPE per core.

    Signed-off-by: Markos Chandras
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/10654/
    Signed-off-by: Ralf Baechle
    Signed-off-by: Greg Kroah-Hartman

    Markos Chandras
     

06 Jun, 2015

1 commit


16 May, 2015

1 commit

  • The ELPA bit in PageGrain is all about large *physical* addresses, so
    correct the reference to "large virtual address" in the comment above
    where it is set for MIPS64.

    Signed-off-by: James Hogan
    Cc: David Daney
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/10038/
    Signed-off-by: Ralf Baechle

    James Hogan
     

18 Apr, 2015

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is the main pull request for MIPS for Linux 4.1. Most
    noteworthy:

    - Add more Octeon-optimized crypto functions
    - Octeon crypto preemption and locking fixes
    - Little endian support for Octeon
    - Use correct CSR to soft reset Octeons
    - Support LEDs on the Octeon-based DSR-1000N
    - Fix PCI interrupt mapping for the Octeon-based DSR-1000N
    - Mark prom_free_prom_memory() as __init for a number of systems
    - Support for Imagination's Pistachio SOC. This includes arch and
    CLK bits. I'd like to merge pinctrl bits later
    - Improve parallelism of csum_partial for certain pipelines
    - Organize DTB files in subdirs like other architectures
    - Implement read_sched_clock for all MIPS platforms other than
    Octeon
    - Massive series of 38 fixes and cleanups for the FPU emulator /
    kernel
    - Further FPU remulator work to support new features. This sits on a
    separate branch which also has been pulled into the 4.1 KVM branch
    - Clean up and fixes for the SEAD3 eval board; remove unused file
    - Various updates for Netlogic platforms
    - A number of small updates for Loongson 3 platforms
    - Increase the memory limit for ATH79 platforms to 256MB
    - A fair number of fixes and updates for BCM47xx platforms
    - Finish the implementation of XPA support
    - MIPS FDC support. No, not floppy controller but Fast Debug Channel :)
    - Detect the R16000 used in SGI legacy platforms
    - Fix Kconfig dependencies for the SSB bus support"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (265 commits)
    MIPS: Makefile: Fix MIPS ASE detection code
    MIPS: asm: elf: Set O32 default FPU flags
    MIPS: BCM47XX: Fix detecting Microsoft MN-700 & Asus WL500G
    MIPS: Kconfig: Disable SMP/CPS for 64-bit
    MIPS: Hibernate: flush TLB entries earlier
    MIPS: smp-cps: cpu_set FPU mask if FPU present
    MIPS: lose_fpu(): Disable FPU when MSA enabled
    MIPS: ralink: add missing symbol for RALINK_ILL_ACC
    MIPS: ralink: Fix bad config symbol in PCI makefile.
    SSB: fix Kconfig dependencies
    MIPS: Malta: Detect and fix bad memsize values
    Revert "MIPS: Avoid pipeline stalls on some MIPS32R2 cores."
    MIPS: Octeon: Delete override of cpu_has_mips_r2_exec_hazard.
    MIPS: Fix cpu_has_mips_r2_exec_hazard.
    MIPS: kernel: entry.S: Set correct ISA level for mips_ihb
    MIPS: asm: spinlock: Fix addiu instruction for R10000_LLSC_WAR case
    MIPS: r4kcache: Use correct base register for MIPS R6 cache flushes
    MIPS: Kconfig: Fix typo for the r2-to-r6 emulator kernel parameter
    MIPS: unaligned: Fix regular load/store instruction emulation for EVA
    MIPS: unaligned: Surround load/store macros in do {} while statements
    ...

    Linus Torvalds
     

15 Apr, 2015

2 commits

  • When an architecture fully supports randomizing the ELF load location,
    a per-arch mmap_rnd() function is used to find a randomized mmap base.
    In preparation for randomizing the location of ET_DYN binaries
    separately from mmap, this renames and exports these functions as
    arch_mmap_rnd(). Additionally introduces CONFIG_ARCH_HAS_ELF_RANDOMIZE
    for describing this feature on architectures that support it
    (which is a superset of ARCH_BINFMT_ELF_RANDOMIZE_PIE, since s390
    already supports a separated ET_DYN ASLR from mmap ASLR without the
    ARCH_BINFMT_ELF_RANDOMIZE_PIE logic).

    Signed-off-by: Kees Cook
    Cc: Hector Marco-Gisbert
    Cc: Russell King
    Reviewed-by: Ingo Molnar
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Ralf Baechle
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Michael Ellerman
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Alexander Viro
    Cc: Oleg Nesterov
    Cc: Andy Lutomirski
    Cc: "David A. Long"
    Cc: Andrey Ryabinin
    Cc: Arun Chandran
    Cc: Yann Droneaud
    Cc: Min-Hua Chen
    Cc: Paul Burton
    Cc: Alex Smith
    Cc: Markos Chandras
    Cc: Vineeth Vijayan
    Cc: Jeff Bailey
    Cc: Michael Holzheu
    Cc: Ben Hutchings
    Cc: Behan Webster
    Cc: Ismael Ripoll
    Cc: Jan-Simon Mller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     
  • In preparation for splitting out ET_DYN ASLR, extract the mmap ASLR
    selection into a separate function.

    Signed-off-by: Kees Cook
    Reviewed-by: Ingo Molnar
    Cc: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     

13 Apr, 2015

1 commit


10 Apr, 2015

1 commit


02 Apr, 2015

1 commit

  • Fix the 74K D-cache alias erratum workaround so that it actually works.
    Our current code sets MIPS_CACHE_VTAG for the D-cache, but that flag
    only has any effect for the I-cache. Additionally MIPS_CACHE_PINDEX is
    set for the D-cache if CP0.Config7.AR is also set for an affected
    processor, leading to confusing information in the bootstrap log (the
    flag isn't used beyond that).

    So delete the setting of MIPS_CACHE_VTAG and rely on MIPS_CACHE_ALIASES,
    set in a common place, removing I-cache coherency issues seen in GDB
    testing with software breakpoints, gdbserver and ptrace(2), on affected
    systems.

    While at it add a little piece of explanation of what CP0.Config6.SYND
    is so that people do not have to chase documentation.

    Signed-off-by: Maciej W. Rozycki
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/8507/
    Signed-off-by: Ralf Baechle

    Maciej W. Rozycki
     

01 Apr, 2015

2 commits


25 Mar, 2015

2 commits

  • The lazy cache flushing implemented in the MIPS kernel suffers from a
    race condition that is exposed by do_set_pte() in mm/memory.c.

    A pre-condition is a file-system that writes to the page from the CPU
    in its readpage method and then calls flush_dcache_page(). One example
    is ubifs. Another pre-condition is that the dcache flush is postponed
    in __flush_dcache_page().

    Upon a page fault for an executable mapping not existing in the
    page-cache, the following will happen:
    1. Write to the page
    2. flush_dcache_page
    3. flush_icache_page
    4. set_pte_at
    5. update_mmu_cache (commits the flush of a dcache-dirty page)

    Between steps 4 and 5 another thread can hit the same page and it will
    encounter a valid pte. Because the data still is in the L1 dcache the CPU
    will fetch stale data from L2 into the icache and execute garbage.

    This fix moves the commit of the cache flush to step 3 to close the
    race window. It also reduces the amount of flushes on non-executable
    mappings because we never enter __flush_dcache_page() for non-aliasing
    CPUs.

    Regressions can occur in drivers that mistakenly relies on the
    flush_dcache_page() in get_user_pages() for DMA operations.

    [ralf@linux-mips.org: Folded in patch 9346 to fix highmem issue.]

    Signed-off-by: Lars Persson
    Cc: linux-mips@linux-mips.org
    Cc: paul.burton@imgtec.com
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/9346/
    Patchwork: https://patchwork.linux-mips.org/patch/9738/
    Signed-off-by: Ralf Baechle

    Lars Persson
     
  • Revert commit 2a4a8b1e5d9d ("MIPS: Remove race window in page fault
    handling") because it increased the number of flushed dcache pages and
    became a performance problem for some workloads.

    Signed-off-by: Lars Persson
    Cc: linux-mips@linux-mips.org
    Cc: paul.burton@imgtec.com
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/9345/
    Signed-off-by: Ralf Baechle

    Lars Persson
     

20 Mar, 2015

1 commit

  • Add support for extended physical addressing (XPA) so that
    32-bit platforms can access equal to or greater than 40 bits
    of physical addresses.

    NOTE:
    1) XPA and EVA are not the same and cannot be used
    simultaneously.
    2) If you configure your kernel for XPA, the PTEs
    and all address sizes become 64-bit.
    3) Your platform MUST have working HIGHMEM support.

    Signed-off-by: Steven J. Hill
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/9355/
    Signed-off-by: Ralf Baechle

    Steven J. Hill
     

18 Mar, 2015

1 commit

  • This patch rearranges the PTE bits into fixed positions for R2
    and later cores. In the past, the TLB handling code did runtime
    checking of RI/XI and adjusted the shifts and rotates in order
    to fit the largest PFN value into the PTE. The checking now
    occurs when building the TLB handler, thus eliminating those
    checks. These new arrangements also define the largest possible
    PFN value that can fit in the PTE. HUGE page support is only
    available for 64-bit cores. Layouts of the PTE bits are now:

    64-bit, R1 or earlier: CCC D V G [S H] M A W R P
    32-bit, R1 or earler: CCC D V G M A W R P
    64-bit, R2 or later: CCC D V G RI/R XI [S H] M A W P
    32-bit, R2 or later: CCC D V G RI/R XI M A W P

    [ralf@linux-mips.org: Fix another build error *rant* *rant*]

    Signed-off-by: Steven J. Hill
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/9353/
    Signed-off-by: Ralf Baechle

    Steven J. Hill
     

22 Feb, 2015

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is the main pull request for MIPS:

    - a number of fixes that didn't make the 3.19 release.

    - a number of cleanups.

    - preliminary support for Cavium's Octeon 3 SOCs which feature up to
    48 MIPS64 R3 cores with FPU and hardware virtualization.

    - support for MIPS R6 processors.

    Revision 6 of the MIPS architecture is a major revision of the MIPS
    architecture which does away with many of original sins of the
    architecture such as branch delay slots. This and other changes in
    R6 require major changes throughout the entire MIPS core
    architecture code and make up for the lion share of this pull
    request.

    - finally some preparatory work for eXtendend Physical Address
    support, which allows support of up to 40 bit of physical address
    space on 32 bit processors"

    [ Ahh, MIPS can't leave the PAE brain damage alone. It's like
    every CPU architect has to make that mistake, but pee in the snow
    by changing the TLA. But whether it's called PAE, LPAE or XPA,
    it's horrid crud - Linus ]

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (114 commits)
    MIPS: sead3: Corrected get_c0_perfcount_int
    MIPS: mm: Remove dead macro definitions
    MIPS: OCTEON: irq: add CIB and other fixes
    MIPS: OCTEON: Don't do acknowledge operations for level triggered irqs.
    MIPS: OCTEON: More OCTEONIII support
    MIPS: OCTEON: Remove setting of processor specific CVMCTL icache bits.
    MIPS: OCTEON: Core-15169 Workaround and general CVMSEG cleanup.
    MIPS: OCTEON: Update octeon-model.h code for new SoCs.
    MIPS: OCTEON: Implement DCache errata workaround for all CN6XXX
    MIPS: OCTEON: Add little-endian support to asm/octeon/octeon.h
    MIPS: OCTEON: Implement the core-16057 workaround
    MIPS: OCTEON: Delete unused COP2 saving code
    MIPS: OCTEON: Use correct instruction to read 64-bit COP0 register
    MIPS: OCTEON: Save and restore CP2 SHA3 state
    MIPS: OCTEON: Fix FP context save.
    MIPS: OCTEON: Save/Restore wider multiply registers in OCTEON III CPUs
    MIPS: boot: Provide more uImage options
    MIPS: Remove unneeded #ifdef __KERNEL__ from asm/processor.h
    MIPS: ip22-gio: Remove legacy suspend/resume support
    mips: pci: Add ifdef around pci_proc_domain
    ...

    Linus Torvalds
     

21 Feb, 2015

1 commit

  • In commit c441d4a54c6e ("MIPS: mm: Only build one microassembler that
    is suitable"), the Makefile at arch/mips/mm was rewritten to only
    build the "right" microassembler file, depending on whether
    CONFIG_CPU_MICROMIPS is set or not.

    In the files, however, there are still preprocessor definitions
    depending on CONFIG_CPU_MICROMIPS. The #ifdef around them can now
    never evaluate to true, so let's remove them altogether.

    This inconsistency was found using the undertaker-checkpatch tool.

    Signed-off-by: Andreas Ruprecht
    Reviewed-by: Maciej W. Rozycki
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Cc: Valentin Rothberg
    Cc: Paul Bolle
    Patchwork: https://patchwork.linux-mips.org/patch/9267/
    Signed-off-by: Ralf Baechle

    Andreas Ruprecht
     

20 Feb, 2015

2 commits


17 Feb, 2015

4 commits


16 Feb, 2015

4 commits


12 Feb, 2015

2 commits

  • This allows the get_user_pages_fast slow path to release the mmap_sem
    before blocking.

    Signed-off-by: Andrea Arcangeli
    Reviewed-by: Kirill A. Shutemov
    Cc: Andres Lagar-Cavilla
    Cc: Peter Feiner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Arcangeli
     
  • Currently we have many duplicates in definitions around
    follow_huge_addr(), follow_huge_pmd(), and follow_huge_pud(), so this
    patch tries to remove the m. The basic idea is to put the default
    implementation for these functions in mm/hugetlb.c as weak symbols
    (regardless of CONFIG_ARCH_WANT_GENERAL_HUGETL B), and to implement
    arch-specific code only when the arch needs it.

    For follow_huge_addr(), only powerpc and ia64 have their own
    implementation, and in all other architectures this function just returns
    ERR_PTR(-EINVAL). So this patch sets returning ERR_PTR(-EINVAL) as
    default.

    As for follow_huge_(pmd|pud)(), if (pmd|pud)_huge() is implemented to
    always return 0 in your architecture (like in ia64 or sparc,) it's never
    called (the callsite is optimized away) no matter how implemented it is.
    So in such architectures, we don't need arch-specific implementation.

    In some architecture (like mips, s390 and tile,) their current
    arch-specific follow_huge_(pmd|pud)() are effectively identical with the
    common code, so this patch lets these architecture use the common code.

    One exception is metag, where pmd_huge() could return non-zero but it
    expects follow_huge_pmd() to always return NULL. This means that we need
    arch-specific implementation which returns NULL. This behavior looks
    strange to me (because non-zero pmd_huge() implies that the architecture
    supports PMD-based hugepage, so follow_huge_pmd() can/should return some
    relevant value,) but that's beyond this cleanup patch, so let's keep it.

    Justification of non-trivial changes:
    - in s390, follow_huge_pmd() checks !MACHINE_HAS_HPAGE at first, and this
    patch removes the check. This is OK because we can assume MACHINE_HAS_HPAGE
    is true when follow_huge_pmd() can be called (note that pmd_huge() has
    the same check and always returns 0 for !MACHINE_HAS_HPAGE.)
    - in s390 and mips, we use HPAGE_MASK instead of PMD_MASK as done in common
    code. This patch forces these archs use PMD_MASK, but it's OK because
    they are identical in both archs.
    In s390, both of HPAGE_SHIFT and PMD_SHIFT are 20.
    In mips, HPAGE_SHIFT is defined as (PAGE_SHIFT + PAGE_SHIFT - 3) and
    PMD_SHIFT is define as (PAGE_SHIFT + PAGE_SHIFT + PTE_ORDER - 3), but
    PTE_ORDER is always 0, so these are identical.

    Signed-off-by: Naoya Horiguchi
    Acked-by: Hugh Dickins
    Cc: James Hogan
    Cc: David Rientjes
    Cc: Mel Gorman
    Cc: Johannes Weiner
    Cc: Michal Hocko
    Cc: Rik van Riel
    Cc: Andrea Arcangeli
    Cc: Luiz Capitulino
    Cc: Nishanth Aravamudan
    Cc: Lee Schermerhorn
    Cc: Steve Capper
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Naoya Horiguchi
     

07 Feb, 2015

1 commit

  • Pull MIPS fixes from Ralf Baechle:
    "The pending MIPS fixes for 3.19. All across the field and nothing
    particularly severe or dramatic"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (23 commits)
    IRQCHIP: mips-gic: Avoid rerouting timer IRQs for smp-cmp
    MIPS: Fix syscall_get_nr for the syscall exit tracing.
    MIPS: elf2ecoff: Ignore PT_MIPS_ABIFLAGS program headers.
    MIPS: elf2ecoff: Rewrite main processing loop to switch.
    MIPS: fork: Fix MSA/FPU/DSP context duplication race
    MIPS: Fix C0_Pagegrain[IEC] support.
    MIPS: traps: Fix inline asm ctc1 missing .set hardfloat
    MIPS: mipsregs.h: Add write_32bit_cp1_register()
    MIPS: Fix kernel lockup or crash after CPU offline/online
    MIPS: OCTEON: fix kernel crash when offlining a CPU
    MIPS: ARC: Fix build error.
    MIPS: IRQ: Fix disable_irq on CPU IRQs
    MIPS: smp-mt,smp-cmp: Enable all HW IRQs on secondary CPUs
    MIPS: Fix restart of indirect syscalls
    MIPS: ELF: fix loading o32 binaries on 64-bit kernels
    MIPS: mips-cm: Fix sparse warnings
    MIPS: Kconfig: Fix recursive dependency.
    MIPS: Compat: Fix build error if CONFIG_MIPS32_COMPAT but no compat ABI.
    MIPS: JZ4740: Fixup #include's (sparse)
    MIPS: Wire up execveat(2).
    ...

    Linus Torvalds
     

31 Jan, 2015

1 commit

  • The following commits:

    5890f70f15c52d (MIPS: Use dedicated exception handler if CPU supports RI/XI exceptions)
    6575b1d4173eae (MIPS: kernel: cpu-probe: Detect unique RI/XI exceptions)

    break the kernel for *all* existing MIPS CPUs that implement the
    CP0_PageGrain[IEC] bit. They cause the TLB exception handlers to be
    generated without the legacy execute-inhibit handling, but never set
    the CP0_PageGrain[IEC] bit to activate the use of dedicated exception
    vectors for execute-inhibit exceptions. The result is that upon
    detection of an execute-inhibit violation, we loop forever in the TLB
    exception handlers instead of sending SIGSEGV to the task.

    If we are generating TLB exception handlers expecting separate
    vectors, we must also enable the CP0_PageGrain[IEC] feature.

    The bug was introduced in kernel version 3.17.

    Signed-off-by: David Daney
    Cc:
    Cc: Leonid Yegoshin
    Cc: linux-mips@linux-mips.org
    Patchwork: http://patchwork.linux-mips.org/patch/8880/
    Signed-off-by: Ralf Baechle

    David Daney
     

30 Jan, 2015

1 commit

  • The core VM already knows about VM_FAULT_SIGBUS, but cannot return a
    "you should SIGSEGV" error, because the SIGSEGV case was generally
    handled by the caller - usually the architecture fault handler.

    That results in lots of duplication - all the architecture fault
    handlers end up doing very similar "look up vma, check permissions, do
    retries etc" - but it generally works. However, there are cases where
    the VM actually wants to SIGSEGV, and applications _expect_ SIGSEGV.

    In particular, when accessing the stack guard page, libsigsegv expects a
    SIGSEGV. And it usually got one, because the stack growth is handled by
    that duplicated architecture fault handler.

    However, when the generic VM layer started propagating the error return
    from the stack expansion in commit fee7e49d4514 ("mm: propagate error
    from stack expansion even for guard page"), that now exposed the
    existing VM_FAULT_SIGBUS result to user space. And user space really
    expected SIGSEGV, not SIGBUS.

    To fix that case, we need to add a VM_FAULT_SIGSEGV, and teach all those
    duplicate architecture fault handlers about it. They all already have
    the code to handle SIGSEGV, so it's about just tying that new return
    value to the existing code, but it's all a bit annoying.

    This is the mindless minimal patch to do this. A more extensive patch
    would be to try to gather up the mostly shared fault handling logic into
    one generic helper routine, and long-term we really should do that
    cleanup.

    Just from this patch, you can generally see that most architectures just
    copied (directly or indirectly) the old x86 way of doing things, but in
    the meantime that original x86 model has been improved to hold the VM
    semaphore for shorter times etc and to handle VM_FAULT_RETRY and other
    "newer" things, so it would be a good idea to bring all those
    improvements to the generic case and teach other architectures about
    them too.

    Reported-and-tested-by: Takashi Iwai
    Tested-by: Jan Engelhardt
    Acked-by: Heiko Carstens # "s390 still compiles and boots"
    Cc: linux-arch@vger.kernel.org
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

21 Dec, 2014

1 commit

  • Pull ACCESS_ONCE cleanup preparation from Christian Borntraeger:
    "kernel: Provide READ_ONCE and ASSIGN_ONCE

    As discussed on LKML http://marc.info/?i=54611D86.4040306%40de.ibm.com
    ACCESS_ONCE might fail with specific compilers for non-scalar
    accesses.

    Here is a set of patches to tackle that problem.

    The first patch introduce READ_ONCE and ASSIGN_ONCE. If the data
    structure is larger than the machine word size memcpy is used and a
    warning is emitted. The next patches fix up several in-tree users of
    ACCESS_ONCE on non-scalar types.

    This does not yet contain a patch that forces ACCESS_ONCE to work only
    on scalar types. This is targetted for the next merge window as Linux
    next already contains new offenders regarding ACCESS_ONCE vs.
    non-scalar types"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/borntraeger/linux:
    s390/kvm: REPLACE barrier fixup with READ_ONCE
    arm/spinlock: Replace ACCESS_ONCE with READ_ONCE
    arm64/spinlock: Replace ACCESS_ONCE READ_ONCE
    mips/gup: Replace ACCESS_ONCE with READ_ONCE
    x86/gup: Replace ACCESS_ONCE with READ_ONCE
    x86/spinlock: Replace ACCESS_ONCE with READ_ONCE
    mm: replace ACCESS_ONCE with READ_ONCE or barriers
    kernel: Provide READ_ONCE and ASSIGN_ONCE

    Linus Torvalds
     

18 Dec, 2014

1 commit

  • ACCESS_ONCE does not work reliably on non-scalar types. For
    example gcc 4.6 and 4.7 might remove the volatile tag for such
    accesses during the SRA (scalar replacement of aggregates) step
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145)

    Change the gup code to replace ACCESS_ONCE with READ_ONCE.

    Signed-off-by: Christian Borntraeger
    Acked-by: Paul E. McKenney

    Christian Borntraeger
     

12 Dec, 2014

1 commit

  • Pull MIPS updates from Ralf Baechle:
    "This is an unusually large pull request for MIPS - in parts because
    lots of patches missed the 3.18 deadline but primarily because some
    folks opened the flood gates.

    - Retire the MIPS-specific phys_t with the generic phys_addr_t.
    - Improvments for the backtrace code used by oprofile.
    - Better backtraces on SMP systems.
    - Cleanups for the Octeon platform code.
    - Cleanups and fixes for the Loongson platform code.
    - Cleanups and fixes to the firmware library.
    - Switch ATH79 platform to use the firmware library.
    - Grand overhault to the SEAD3 and Malta interrupt code.
    - Move the GIC interrupt code to drivers/irqchip
    - Lots of GIC cleanups and updates to the GIC code to use modern IRQ
    infrastructures and features of the kernel.
    - OF documentation updates for the GIC bindings
    - Move GIC clocksource driver to drivers/clocksource
    - Merge GIC clocksource driver with clockevent driver.
    - Further updates to bring the GIC clocksource driver up to date.
    - R3000 TLB code cleanups
    - Improvments to the Loongson 3 platform code.
    - Convert pr_warning to pr_warn.
    - Merge a bunch of small lantiq and ralink fixes that have been
    staged/lingering inside the openwrt tree for a while.
    - Update archhelp for IP22/IP32
    - Fix a number of issues for Loongson 1B.
    - New clocksource and clockevent driver for Loongson 1B.
    - Further work on clk handling for Loongson 1B.
    - Platform work for Broadcom BMIPS.
    - Error handling cleanups for TurboChannel.
    - Fixes and optimization to the microMIPS support.
    - Option to disable the FTLB.
    - Dump more relevant information on machine check exception
    - Change binfmt to allow arch to examine PT_*PROC headers
    - Support for new style FPU register model in O32
    - VDSO randomization.
    - BCM47xx cleanups
    - BCM47xx reimplement the way the kernel accesses NVRAM information.
    - Random cleanups
    - Add support for ATH25 platforms
    - Remove pointless locking code in some PCI platforms.
    - Some improvments to EVA support
    - Minor Alchemy cleanup"

    * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (185 commits)
    MIPS: Add MFHC0 and MTHC0 instructions to uasm.
    MIPS: Cosmetic cleanups of page table headers.
    MIPS: Add CP0 macros for extended EntryLo registers
    MIPS: Remove now unused definition of phys_t.
    MIPS: Replace use of phys_t with phys_addr_t.
    MIPS: Replace MIPS-specific 64BIT_PHYS_ADDR with generic PHYS_ADDR_T_64BIT
    PCMCIA: Alchemy Don't select 64BIT_PHYS_ADDR in Kconfig.
    MIPS: lib: memset: Clean up some MIPS{EL,EB} ifdefery
    MIPS: iomap: Use __mem_{read,write}{b,w,l} for MMIO
    MIPS: fix indentation.
    MAINTAINERS: Add entry for BMIPS multiplatform kernel
    MIPS: Enable VDSO randomization
    MIPS: Remove a temporary hack for debugging cache flushes in SMTC configuration
    MIPS: Remove declaration of obsolete arch_init_clk_ops()
    MIPS: atomic.h: Reformat to fit in 79 columns
    MIPS: Apply `.insn' to fixup labels throughout
    MIPS: Fix microMIPS LL/SC immediate offsets
    MIPS: Kconfig: Only allow 32-bit microMIPS builds
    MIPS: signal.c: Fix an invalid cast in ISA mode bit handling
    MIPS: mm: Only build one microassembler that is suitable
    ...

    Linus Torvalds
     

28 Nov, 2014

1 commit

  • There is a potential race when probing the TLB in TLBL/M/S exception
    handlers for a matching entry. Between the time we hit a TLBL/S/M
    exception and the time we get to execute the TLBP instruction, the
    HTW may have replaced the TLB entry we are interested in hence the TLB
    probe may fail. However, in the existing handlers, we never checked the
    status of the TLBP (ie check the result in the C0/Index register). We
    fix this by adding such a check when the core implements the HTW. If
    we couldn't find a matching entry, we return back and try again.

    Signed-off-by: Leonid Yegoshin
    Signed-off-by: Markos Chandras
    Reviewed-by: James Hogan
    Cc: # v3.17+
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/8599/
    Signed-off-by: Ralf Baechle

    Leonid Yegoshin
     

25 Nov, 2014

3 commits