09 Feb, 2017

1 commit

  • commit 4b3e6f2ef3722f1a6a97b6034ed492c1a21fd4ae upstream.

    Commit bf15f86b343ed8 ("xtensa: initialize MMU before jumping to reset
    vector") calls MMU management functions even when CONFIG_MMU is not
    selected. That breaks noMMU build on cores with MMU.

    Don't manage MMU when CONFIG_MMU is not selected.

    Signed-off-by: Max Filippov
    Signed-off-by: Greg Kroah-Hartman

    Max Filippov
     

15 Nov, 2016

1 commit


07 Nov, 2016

1 commit

  • Convert printk(KERN_* to pr_* and printk's without level to pr_cont.
    This fixes torn register dumps, stack dumps, stack traces and timestamps
    in the middle of 'Calibrating CPU frequency' message.
    Also drop unused show_code and drop false comment about show_stack.

    Signed-off-by: Max Filippov

    Max Filippov
     

12 Oct, 2016

1 commit

  • Pull uaccess.h prepwork from Al Viro:
    "Preparations to tree-wide switch to use of linux/uaccess.h (which,
    obviously, will allow to start unifying stuff for real). The last step
    there, ie

    PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*'
    sed -i -e "s!$PATT!#include !" \
    `git grep -l "$PATT"|grep -v ^include/linux/uaccess.h`

    is not taken here - I would prefer to do it once just before or just
    after -rc1. However, everything should be ready for it"

    * 'work.uaccess2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    remove a stray reference to asm/uaccess.h in docs
    sparc64: separate extable_64.h, switch elf_64.h to it
    score: separate extable.h, switch module.h to it
    mips: separate extable.h, switch module.h to it
    x86: separate extable.h, switch sections.h to it
    remove stray include of asm/uaccess.h from cacheflush.h
    mn10300: remove a bogus processor.h->uaccess.h include
    xtensa: split uaccess.h into C and asm sides
    bonding: quit messing with IOCTL
    kill __kernel_ds_p off
    mn10300: finish verify_area() off
    frv: move HAVE_ARCH_UNMAPPED_AREA to pgtable.h
    exceptions: detritus removal

    Linus Torvalds
     

11 Oct, 2016

1 commit

  • Pull protection keys syscall interface from Thomas Gleixner:
    "This is the final step of Protection Keys support which adds the
    syscalls so user space can actually allocate keys and protect memory
    areas with them. Details and usage examples can be found in the
    documentation.

    The mm side of this has been acked by Mel"

    * 'mm-pkeys-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/pkeys: Update documentation
    x86/mm/pkeys: Do not skip PKRU register if debug registers are not used
    x86/pkeys: Fix pkeys build breakage for some non-x86 arches
    x86/pkeys: Add self-tests
    x86/pkeys: Allow configuration of init_pkru
    x86/pkeys: Default to a restrictive init PKRU
    pkeys: Add details of system call use to Documentation/
    generic syscalls: Wire up memory protection keys syscalls
    x86: Wire up protection keys system calls
    x86/pkeys: Allocation/free syscalls
    x86/pkeys: Make mprotect_key() mask off additional vm_flags
    mm: Implement new pkey_mprotect() system call
    x86/pkeys: Add fault handling for PF_PK page fault bit

    Linus Torvalds
     

08 Oct, 2016

1 commit

  • When doing an nmi backtrace of many cores, most of which are idle, the
    output is a little overwhelming and very uninformative. Suppress
    messages for cpus that are idling when they are interrupted and just
    emit one line, "NMI backtrace for N skipped: idling at pc 0xNNN".

    We do this by grouping all the cpuidle code together into a new
    .cpuidle.text section, and then checking the address of the interrupted
    PC to see if it lies within that section.

    This commit suitably tags x86 and tile idle routines, and only adds in
    the minimal framework for other architectures.

    Link: http://lkml.kernel.org/r/1472487169-14923-5-git-send-email-cmetcalf@mellanox.com
    Signed-off-by: Chris Metcalf
    Acked-by: Peter Zijlstra (Intel)
    Tested-by: Peter Zijlstra (Intel)
    Tested-by: Daniel Thompson [arm]
    Tested-by: Petr Mladek
    Cc: Aaron Tomlin
    Cc: Peter Zijlstra (Intel)
    Cc: "Rafael J. Wysocki"
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Metcalf
     

06 Oct, 2016

1 commit

  • Pull Xtensa updates from Max Filippov:
    "Updates for the xtensa architecture. It is a combined set of patches
    for 4.8 that never got to the mainline and new patches for 4.9.

    - add new kernel memory layouts for MMUv3 cores: with 256MB and 512MB
    KSEG size, starting at physical address other than 0

    - make kernel load address configurable

    - clean up kernel memory layout macros

    - drop sysmem early allocator and switch to memblock

    - enable kmemleak and memory reservation from the device tree

    - wire up new syscalls: userfaultfd, membarrier, mlock2,
    copy_file_range, preadv2 and pwritev2

    - add new platform: Cadence Configurable System Platform (CSP) and
    new core variant for it: xt_lnx

    - rearrange CCOUNT calibration code, make most of it generic

    - improve machine reset code (XTFPGA now reboots reliably with MMUv3
    cores)

    - provide default memmap command line option for configurations
    without device tree support

    - ISS fixes: simdisk is now capable of using highmem pages, panic
    correctly terminates simulator"

    * tag 'xtensa-20161005' of git://github.com/jcmvbkbc/linux-xtensa: (24 commits)
    xtensa: disable MMU initialization option on MMUv2 cores
    xtensa: add default memmap and mmio32native options to defconfigs
    xtensa: add default memmap option to common_defconfig
    xtensa: add default memmap option to iss_defconfig
    xtensa: ISS: allow simdisk to use high memory buffers
    xtensa: ISS: define simc_exit and use it instead of inline asm
    xtensa: xtfpga: group platform_* functions together
    xtensa: rearrange CCOUNT calibration
    xtensa: xtfpga: use clock provider, don't update DT
    xtensa: Tweak xuartps UART driver Rx watermark for Cadence CSP config.
    xtensa: initialize MMU before jumping to reset vector
    xtensa: fix icountlevel setting in cpu_reset
    xtensa: extract common CPU reset code into separate function
    xtensa: Added Cadence CSP kernel configuration for Xtensa
    xtensa: fix default kernel load address
    xtensa: wire up new syscalls
    xtensa: support reserved-memory DT node
    xtensa: drop sysmem and switch to memblock
    xtensa: minimize use of PLATFORM_DEFAULT_MEM_{ADDR,SIZE}
    xtensa: cleanup MMU setup and kernel layout macros
    ...

    Linus Torvalds
     

30 Sep, 2016

1 commit

  • MMU initialization option is currently ignored on MMUv2 cores, but it is
    used in Kconfig to select kernel load and start addresses. This choice
    is not available for MMUv2 cores as they have hardwired TLB entries.
    Disable MMU initialization option for known MMUv2 cores so that they get
    correct kernel load/start address by default.
    This fixes the default allmodconfig build.

    Signed-off-by: Max Filippov

    Max Filippov
     

28 Sep, 2016

2 commits


21 Sep, 2016

8 commits

  • Now that memory initialization doesn't add default memory region
    specify it explicitly in the memmap command line option in case somebody
    wants to boot in non-DT-enabled configuration.

    While at it update earlycon access mode to mmio32native to support both
    LE and BE cores transparently.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • Now that memory initialization doesn't add default memory region specify
    it explicitly in the memmap command line option.

    Save common_defconfig as defconfig so that it doesn't have all option
    settings in it, only those that are different from the Kconfig defaults.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • Now that memory initialization doesn't add default memory region specify
    it explicitly in the memmap command line option.

    Save iss_defconfig as defconfig so that it doesn't have all option
    settings in it, only those that are different from the Kconfig defaults.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • ISS kernel by default has only low memory. But it may be configured to
    support high memory and started in a simulator with more than 128M of
    RAM. Simdisk driver in such configuration can get IO request with a
    high memory page. There may be no TLB entry for that page, only page
    table entry. However simulators don't do pagewalking, so such IO request
    will fail. Touch IO buffer in the buffer read/write loop so that a TLB
    entry is likely there when read or write simcall is invoked.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • A number of ISS platform functions use inline assembly to invoke
    simulator exit, not all correctly. Define simc_exit(exit_code) and use
    it instead of inline assembly.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • Group platform_* functions together and turn two separate #ifdef/#ifndef
    blocks into single #ifdef/#else. No functional changes.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • DT-enabled kernel should have a CPU node connected to a clock. This clock
    is the CCOUNT clock. Use old platform_calibrate_ccount call as a fallback
    when CPU node cannot be found or has no clock and in non-DT-enabled
    configurations.

    Drop no longer needed code that updates CPU clock-frequency property in
    the DT; drop DT-related code from the platform_calibrate_ccount too.

    Move of_clk_init to the top of time_init, so that clocks are initialized
    before CCOUNT calibration is attempted.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • Instead of querying hardcoded FPGA frequency register and then updating
    clock-frequency property in specificly named DT nodes in machine setup
    code register a clock provider that returns fixed-rate clock, configured
    by register specified in DT. This way we have less magic/hardcoded names
    and use more existing common clock framework code.

    Signed-off-by: Max Filippov
    Tested-by: Guenter Roeck

    Max Filippov
     

20 Sep, 2016

1 commit


12 Sep, 2016

3 commits


10 Sep, 2016

2 commits

  • Added defconfig, device tree and Xtensa variant header files for the
    Cadence Configurable System Platform "xt_lnx" processor configuration.

    Signed-off-by: Scott Telford
    Signed-off-by: Max Filippov

    Scott Telford
     
  • Make default kernel load address 0xd0003000 for MMUv2 cores and
    0x60003000 for noMMU cores. Don't initialize MMU inside vmlinux for
    predefined MMUv2 cores (it's noop anyway).

    This fixes the following defconfig build error:
    arch/xtensa/kernel/built-in.o: In function `fast_alloca':
    (.text+0x99a): dangerous relocation: j: cannot encode: _WindowUnderflow12
    arch/xtensa/kernel/built-in.o: In function `fast_alloca':
    (.text+0x99d): dangerous relocation: j: cannot encode: _WindowUnderflow8
    arch/xtensa/kernel/built-in.o: In function `fast_alloca':
    (.text+0x9a0): dangerous relocation: j: cannot encode: _WindowUnderflow4
    arch/xtensa/kernel/built-in.o: In function `window_overflow_restore_a0_fixup':
    (.text+0x23a3): dangerous relocation: j: cannot encode: (.DoubleExceptionVector.text+0x104)
    arch/xtensa/kernel/built-in.o: In function `window_overflow_restore_a0_fixup':
    (.text+0x23c1): dangerous relocation: j: cannot encode: (.DoubleExceptionVector.text+0x104)
    arch/xtensa/kernel/built-in.o: In function `window_overflow_restore_a0_fixup':
    (.text+0x23dd): dangerous relocation: j: cannot encode: (.DoubleExceptionVector.text+0x104)

    With this change all xtensa defconfigs build correctly.

    Reported-by: Guenter Roeck
    Signed-off-by: Max Filippov

    Max Filippov
     

09 Sep, 2016

1 commit

  • This patch adds two new system calls:

    int pkey_alloc(unsigned long flags, unsigned long init_access_rights)
    int pkey_free(int pkey);

    These implement an "allocator" for the protection keys
    themselves, which can be thought of as analogous to the allocator
    that the kernel has for file descriptors. The kernel tracks
    which numbers are in use, and only allows operations on keys that
    are valid. A key which was not obtained by pkey_alloc() may not,
    for instance, be passed to pkey_mprotect().

    These system calls are also very important given the kernel's use
    of pkeys to implement execute-only support. These help ensure
    that userspace can never assume that it has control of a key
    unless it first asks the kernel. The kernel does not promise to
    preserve PKRU (right register) contents except for allocated
    pkeys.

    The 'init_access_rights' argument to pkey_alloc() specifies the
    rights that will be established for the returned pkey. For
    instance:

    pkey = pkey_alloc(flags, PKEY_DENY_WRITE);

    will allocate 'pkey', but also sets the bits in PKRU[1] such that
    writing to 'pkey' is already denied.

    The kernel does not prevent pkey_free() from successfully freeing
    in-use pkeys (those still assigned to a memory range by
    pkey_mprotect()). It would be expensive to implement the checks
    for this, so we instead say, "Just don't do it" since sane
    software will never do it anyway.

    Any piece of userspace calling pkey_alloc() needs to be prepared
    for it to fail. Why? pkey_alloc() returns the same error code
    (ENOSPC) when there are no pkeys and when pkeys are unsupported.
    They can be unsupported for a whole host of reasons, so apps must
    be prepared for this. Also, libraries or LD_PRELOADs might steal
    keys before an application gets access to them.

    This allocation mechanism could be implemented in userspace.
    Even if we did it in userspace, we would still need additional
    user/kernel interfaces to tell userspace which keys are being
    used by the kernel internally (such as for execute-only
    mappings). Having the kernel provide this facility completely
    removes the need for these additional interfaces, or having an
    implementation of this in userspace at all.

    Note that we have to make changes to all of the architectures
    that do not use mman-common.h because we use the new
    PKEY_DENY_ACCESS/WRITE macros in arch-independent code.

    1. PKRU is the Protection Key Rights User register. It is a
    usermode-accessible register that controls whether writes
    and/or access to each individual pkey is allowed or denied.

    Signed-off-by: Dave Hansen
    Acked-by: Mel Gorman
    Cc: linux-arch@vger.kernel.org
    Cc: Dave Hansen
    Cc: arnd@arndb.de
    Cc: linux-api@vger.kernel.org
    Cc: linux-mm@kvack.org
    Cc: luto@kernel.org
    Cc: akpm@linux-foundation.org
    Cc: torvalds@linux-foundation.org
    Link: http://lkml.kernel.org/r/20160729163015.444FE75F@viggo.jf.intel.com
    Signed-off-by: Thomas Gleixner

    Dave Hansen
     

04 Aug, 2016

2 commits

  • The dma-mapping core and the implementations do not change the DMA
    attributes passed by pointer. Thus the pointer can point to const data.
    However the attributes do not have to be a bitfield. Instead unsigned
    long will do fine:

    1. This is just simpler. Both in terms of reading the code and setting
    attributes. Instead of initializing local attributes on the stack
    and passing pointer to it to dma_set_attr(), just set the bits.

    2. It brings safeness and checking for const correctness because the
    attributes are passed by value.

    Semantic patches for this change (at least most of them):

    virtual patch
    virtual context

    @r@
    identifier f, attrs;

    @@
    f(...,
    - struct dma_attrs *attrs
    + unsigned long attrs
    , ...)
    {
    ...
    }

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    and

    // Options: --all-includes
    virtual patch
    virtual context

    @r@
    identifier f, attrs;
    type t;

    @@
    t f(..., struct dma_attrs *attrs);

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.com
    Signed-off-by: Krzysztof Kozlowski
    Acked-by: Vineet Gupta
    Acked-by: Robin Murphy
    Acked-by: Hans-Christian Noren Egtvedt
    Acked-by: Mark Salter [c6x]
    Acked-by: Jesper Nilsson [cris]
    Acked-by: Daniel Vetter [drm]
    Reviewed-by: Bart Van Assche
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Fabien Dessenne [bdisp]
    Reviewed-by: Marek Szyprowski [vb2-core]
    Acked-by: David Vrabel [xen]
    Acked-by: Konrad Rzeszutek Wilk [xen swiotlb]
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Richard Kuo [hexagon]
    Acked-by: Geert Uytterhoeven [m68k]
    Acked-by: Gerald Schaefer [s390]
    Acked-by: Bjorn Andersson
    Acked-by: Hans-Christian Noren Egtvedt [avr32]
    Acked-by: Vineet Gupta [arc]
    Acked-by: Robin Murphy [arm64 and dma-iommu]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Kozlowski
     
  • Xtensa improvements for 4.8:

    - add new kernel memory layouts for MMUv3 cores: with 256MB and 512MB
    KSEG size, starting at physical address other than 0;
    - make kernel load address configurable;
    - clean up kernel memory layout macros;
    - drop sysmem early allocator and switch to memblock;
    - enable kmemleak and memory reservation from the device tree;
    - wire up new syscalls: userfaultfd, membarrier, mlock2, copy_file_range,
    preadv2 and pwritev2.

    Chris Zankel
     

31 Jul, 2016

2 commits

  • Wire up userfaultfd, membarrier, mlock2, copy_file_range, preadv2, pwritev2

    Signed-off-by: Max Filippov

    Max Filippov
     
  • Pull DeviceTree updates from Rob Herring:

    - remove most of_platform_populate() calls in arch code. Now the DT
    core code calls it in the default case and platforms only need to
    call it if they have special needs

    - use pr_fmt on all the DT core print statements

    - CoreSight binding doc improvements to block name descriptions

    - add dt_to_config script which can parse dts files and list
    corresponding kernel config options

    - fix memory leak hit with a PowerMac DT

    - correct a bunch of STMicro compatible strings to use the correct
    vendor prefix

    - fix DA9052 PMIC binding doc to match what is actually used in dts
    files

    * tag 'devicetree-for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (35 commits)
    documentation: da9052: Update regulator bindings names to match DA9052/53 DTS expectations
    xtensa: Partially Revert "xtensa: Remove unnecessary of_platform_populate with default match table"
    xtensa: Fix build error due to missing include file
    MIPS: ath79: Add missing include file
    Fix spelling errors in Documentation/devicetree
    ARM: dts: fix STMicroelectronics compatible strings
    powerpc/dts: fix STMicroelectronics compatible strings
    Documentation: dt: i2c: use correct STMicroelectronics vendor prefix
    scripts/dtc: dt_to_config - kernel config options for a devicetree
    of: fdt: mark unflattened tree as detached
    of: overlay: add resolver error prints
    coresight: document binding acronyms
    Documentation/devicetree: document cavium-pip rx-delay/tx-delay properties
    of: use pr_fmt prefix for all console printing
    of/irq: Mark initialised interrupt controllers as populated
    of: fix memory leak related to safe_name()
    Revert "of/platform: export of_default_bus_match_table"
    of: unittest: use of_platform_default_populate() to populate default bus
    memory: omap-gpmc: use of_platform_default_populate() to populate default bus
    bus: uniphier-system-bus: use of_platform_default_populate() to populate default bus
    ...

    Linus Torvalds
     

30 Jul, 2016

1 commit

  • Pull smp hotplug updates from Thomas Gleixner:
    "This is the next part of the hotplug rework.

    - Convert all notifiers with a priority assigned

    - Convert all CPU_STARTING/DYING notifiers

    The final removal of the STARTING/DYING infrastructure will happen
    when the merge window closes.

    Another 700 hundred line of unpenetrable maze gone :)"

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
    timers/core: Correct callback order during CPU hot plug
    leds/trigger/cpu: Move from CPU_STARTING to ONLINE level
    powerpc/numa: Convert to hotplug state machine
    arm/perf: Fix hotplug state machine conversion
    irqchip/armada: Avoid unused function warnings
    ARC/time: Convert to hotplug state machine
    clocksource/atlas7: Convert to hotplug state machine
    clocksource/armada-370-xp: Convert to hotplug state machine
    clocksource/exynos_mct: Convert to hotplug state machine
    clocksource/arm_global_timer: Convert to hotplug state machine
    rcu: Convert rcutree to hotplug state machine
    KVM/arm/arm64/vgic-new: Convert to hotplug state machine
    smp/cfd: Convert core to hotplug state machine
    x86/x2apic: Convert to CPU hotplug state machine
    profile: Convert to hotplug state machine
    timers/core: Convert to hotplug state machine
    hrtimer: Convert to hotplug state machine
    x86/tboot: Convert to hotplug state machine
    arm64/armv8 deprecated: Convert to hotplug state machine
    hwtracing/coresight-etm4x: Convert to hotplug state machine
    ...

    Linus Torvalds
     

27 Jul, 2016

3 commits

  • We always have vma->vm_mm around.

    Link: http://lkml.kernel.org/r/1466021202-61880-8-git-send-email-kirill.shutemov@linux.intel.com
    Signed-off-by: Kirill A. Shutemov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     
  • This partially reverts commit 69d99e6c0d62 keeping only the main
    purpose of the original commit which is the removal of
    of_platform_populate() call. The moving of of_clk_init() caused changes
    in the initialization order breaking booting.

    Fixes: 69d99e6c0d621f ("xtensa: Remove unnecessary of_platform_populate with default match table")
    Cc: Kefeng Wang
    Cc: Guenter Roeck
    Tested-by: Max Filippov
    Signed-off-by: Rob Herring

    Rob Herring
     
  • Commit 69d99e6c0d621f ("xtensa: Remove unnecessary of_platform_populate
    with default match table") dropped various include files from
    arch/xtensa/kernel/setup.c. This results in the following build error.

    arch/xtensa/kernel/setup.c: In function ‘xtensa_dt_io_area’:
    arch/xtensa/kernel/setup.c:213:2: error:
    implicit declaration of function ‘of_read_ulong’

    Fixes: 69d99e6c0d621f ("xtensa: Remove unnecessary of_platform_populate with default match table")
    Cc: Kefeng Wang
    Cc: Rob Herring
    Signed-off-by: Guenter Roeck
    Acked-by: Max Filippov
    Signed-off-by: Rob Herring

    Guenter Roeck
     

26 Jul, 2016

1 commit

  • Pull locking updates from Ingo Molnar:
    "The locking tree was busier in this cycle than the usual pattern - a
    couple of major projects happened to coincide.

    The main changes are:

    - implement the atomic_fetch_{add,sub,and,or,xor}() API natively
    across all SMP architectures (Peter Zijlstra)

    - add atomic_fetch_{inc/dec}() as well, using the generic primitives
    (Davidlohr Bueso)

    - optimize various aspects of rwsems (Jason Low, Davidlohr Bueso,
    Waiman Long)

    - optimize smp_cond_load_acquire() on arm64 and implement LSE based
    atomic{,64}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
    on arm64 (Will Deacon)

    - introduce smp_acquire__after_ctrl_dep() and fix various barrier
    mis-uses and bugs (Peter Zijlstra)

    - after discovering ancient spin_unlock_wait() barrier bugs in its
    implementation and usage, strengthen its semantics and update/fix
    usage sites (Peter Zijlstra)

    - optimize mutex_trylock() fastpath (Peter Zijlstra)

    - ... misc fixes and cleanups"

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (67 commits)
    locking/atomic: Introduce inc/dec variants for the atomic_fetch_$op() API
    locking/barriers, arch/arm64: Implement LDXR+WFE based smp_cond_load_acquire()
    locking/static_keys: Fix non static symbol Sparse warning
    locking/qspinlock: Use __this_cpu_dec() instead of full-blown this_cpu_dec()
    locking/atomic, arch/tile: Fix tilepro build
    locking/atomic, arch/m68k: Remove comment
    locking/atomic, arch/arc: Fix build
    locking/Documentation: Clarify limited control-dependency scope
    locking/atomic, arch/rwsem: Employ atomic_long_fetch_add()
    locking/atomic, arch/qrwlock: Employ atomic_fetch_add_acquire()
    locking/atomic, arch/mips: Convert to _relaxed atomics
    locking/atomic, arch/alpha: Convert to _relaxed atomics
    locking/atomic: Remove the deprecated atomic_{set,clear}_mask() functions
    locking/atomic: Remove linux/atomic.h:atomic_fetch_or()
    locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
    locking/atomic: Fix atomic64_relaxed() bits
    locking/atomic, arch/xtensa: Implement atomic_fetch_{add,sub,and,or,xor}()
    locking/atomic, arch/x86: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()
    locking/atomic, arch/tile: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()
    locking/atomic, arch/sparc: Implement atomic{,64}_fetch_{add,sub,and,or,xor}()
    ...

    Linus Torvalds
     

24 Jul, 2016

6 commits

  • This allows reserving regions of physical memory from the device tree.
    See Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt
    for more details.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • Memblock is the standard kernel boot-time memory tracker/allocator. Use
    it instead of the custom sysmem allocator. This allows using kmemleak,
    CMA and device tree memory reservation.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • Now that the kernel load address and KSEG physical base address have
    their own Kconfig symbols PLATFORM_DEFAULT_MEM seems redundant. It makes
    little sense to use it in MMU configurations instead of KSEG_PADDR.
    In noMMU configurations there's no explicit KSEG, so it's still useful
    for the early cache initialization and definition of ARCH_PFN_OFFSET,
    which affects mem_map size.

    - limit it to noMMU; MMU variants have XCHAL_KSEG_PADDR and
    XCHAL_KSEG_SIZE;
    - don't use it to define TASK_SIZE or MAX_LOW_PFN: first doesn't make
    any difference in noMMU, second is meaningless as there's no high
    memory;
    - don't add default physical memory region: memory layout should come
    from the DT, bootloader tags, or memmap= command line parameter.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • Make kernel load address explicit, independent of the selected MMU
    configuration and configurable from Kconfig. Do not restrict it to the
    first 512MB of the physical address space.

    Cleanup kernel memory layout macros:

    - rename VECBASE_RESET_VADDR to VECBASE_VADDR, XC_VADDR to VECTOR_VADDR;
    - drop VIRTUAL_MEMORY_ADDRESS and LOAD_MEMORY_ADDRESS;
    - introduce PHYS_OFFSET and use it in __va and __pa definitions;
    - synchronize MMU/noMMU vectors, drop unused NMI vector;
    - replace hardcoded vectors offset of 0x3000 with Kconfig symbol.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • MMUv3 is able to support low memory bigger than 128MB.
    Implement 256MB and 512MB KSEG layouts:

    - add Kconfig selector for KSEG layout;
    - add KSEG base address, size and alignment definitions to
    arch/xtensa/include/asm/kmem_layout.h;
    - use new definitions in TLB initialization;
    - add build time memory map consistency checks.

    See Documentation/xtensa/mmu.txt for the details of new memory layouts.

    Signed-off-by: Max Filippov

    Max Filippov
     
  • Create a header dedicated to memory layout definitions. Include it from
    places where these definitions are needed.
    Express vmalloc area address, VIRTUAL_MEMORY_ADDRESS and KERNELOFFSET
    through KSEG address.

    Signed-off-by: Max Filippov

    Max Filippov