26 Mar, 2016

1 commit

  • KASAN needs to know whether the allocation happens in an IRQ handler.
    This lets us strip everything below the IRQ entry point to reduce the
    number of unique stack traces needed to be stored.

    Move the definition of __irq_entry to so that the
    users don't need to pull in . Also introduce the
    __softirq_entry macro which is similar to __irq_entry, but puts the
    corresponding functions to the .softirqentry.text section.

    Signed-off-by: Alexander Potapenko
    Acked-by: Steven Rostedt
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: David Rientjes
    Cc: Joonsoo Kim
    Cc: Andrey Konovalov
    Cc: Dmitry Vyukov
    Cc: Andrey Ryabinin
    Cc: Konstantin Serebryany
    Cc: Dmitry Chernenkov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Potapenko
     

22 Mar, 2016

1 commit

  • Pull arm[64] perf updates from Will Deacon:
    "I have another mixed bag of ARM-related perf patches here.

    It's about 25% CPU and 75% interconnect, but with drivers/bus/
    languishing without an obvious maintainer or tree, Olof and I agreed
    to keep all of these PMU patches together. I suspect a whole load of
    code from drivers/bus/arm-* can be moved under drivers/perf/, so
    that's on the radar for the future.

    Summary:

    - Initial support for ARMv8.1 CPU PMUs

    - Support for the CPU PMU in Cavium ThunderX

    - CPU PMU support for systems running 32-bit Linux in secure mode

    - Support for the system PMU in ARM CCI-550 (Cache Coherent Interconnect)"

    * tag 'arm64-perf' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (26 commits)
    drivers/perf: arm_pmu: avoid NULL dereference when not using devicetree
    arm64: perf: Extend ARMV8_EVTYPE_MASK to include PMCR.LC
    arm-cci: remove unused variable
    arm-cci: don't return value from void function
    arm-cci: make private functions static
    arm-cci: CoreLink CCI-550 PMU driver
    arm-cci500: Rearrange PMU driver for code sharing with CCI-550 PMU
    arm-cci: CCI-500: Work around PMU counter writes
    arm-cci: Provide hook for writing to PMU counters
    arm-cci: Add helper to enable PMU without synchornising counters
    arm-cci: Add routines to save/restore all counters
    arm-cci: Get the status of a counter
    arm-cci: write_counter: Remove redundant check
    arm-cci: Delay PMU counter writes to pmu::pmu_enable
    arm-cci: Refactor CCI PMU enable/disable methods
    arm-cci: Group writes to counter
    arm-cci: fix handling cpumask_any_but return value
    arm-cci: simplify sysfs attr handling
    drivers/perf: arm_pmu: implement CPU_PM notifier
    arm64: dts: Add Cavium ThunderX specific PMU
    ...

    Linus Torvalds
     

20 Mar, 2016

1 commit

  • Pull ARM updates from Russell King:
    "Another mixture of changes this time around:

    - Split XIP linker file from main linker file to make it more
    maintainable, and various XIP fixes, and clean up a resulting
    macro.

    - Decompressor cleanups from Masahiro Yamada

    - Avoid printing an error for a missing L2 cache

    - Remove some duplicated symbols in System.map, and move
    vectors/stubs back into kernel VMA

    - Various low priority fixes from Arnd

    - Updates to allow bus match functions to return negative errno
    values, touching some drivers and the driver core. Greg has acked
    these changes.

    - Virtualisation platform udpates form Jean-Philippe Brucker.

    - Security enhancements from Kees Cook

    - Rework some Kconfig dependencies and move PSCI idle management code
    out of arch/arm into drivers/firmware/psci.c

    - ARM DMA mapping updates, touching media, acked by Mauro.

    - Fix places in ARM code which should be using virt_to_idmap() so
    that Keystone2 can work.

    - Fix Marvell Tauros2 to work again with non-DT boots.

    - Provide a delay timer for ARM Orion platforms"

    * 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (45 commits)
    ARM: 8546/1: dma-mapping: refactor to fix coherent+cma+gfp=0
    ARM: 8547/1: dma-mapping: store buffer information
    ARM: 8543/1: decompressor: rename suffix_y to compress-y
    ARM: 8542/1: decompressor: merge piggy.*.S and simplify Makefile
    ARM: 8541/1: decompressor: drop redundant FORCE in Makefile
    ARM: 8540/1: decompressor: use clean-files instead of extra-y to clean files
    ARM: 8539/1: decompressor: drop more unneeded assignments to "targets"
    ARM: 8538/1: decompressor: drop unneeded assignments to "targets"
    ARM: 8532/1: uncompress: mark putc as inline
    ARM: 8531/1: turn init_new_context into an inline function
    ARM: 8530/1: remove VIRT_TO_BUS
    ARM: 8537/1: drop unused DEBUG_RODATA from XIP_KERNEL
    ARM: 8536/1: mm: hide __start_rodata_section_aligned for non-debug builds
    ARM: 8535/1: mm: DEBUG_RODATA makes no sense with XIP_KERNEL
    ARM: 8534/1: virt: fix hyp-stub build for pre-ARMv7 CPUs
    ARM: make the physical-relative calculation more obvious
    ARM: 8512/1: proc-v7.S: Adjust stack address when XIP_KERNEL
    ARM: 8411/1: Add default SPARSEMEM settings
    ARM: 8503/1: clk_register_clkdev: remove format string interface
    ARM: 8529/1: remove 'i' and 'zi' targets
    ...

    Linus Torvalds
     

17 Mar, 2016

1 commit

  • Pull KVM updates from Paolo Bonzini:
    "One of the largest releases for KVM... Hardly any generic
    changes, but lots of architecture-specific updates.

    ARM:
    - VHE support so that we can run the kernel at EL2 on ARMv8.1 systems
    - PMU support for guests
    - 32bit world switch rewritten in C
    - various optimizations to the vgic save/restore code.

    PPC:
    - enabled KVM-VFIO integration ("VFIO device")
    - optimizations to speed up IPIs between vcpus
    - in-kernel handling of IOMMU hypercalls
    - support for dynamic DMA windows (DDW).

    s390:
    - provide the floating point registers via sync regs;
    - separated instruction vs. data accesses
    - dirty log improvements for huge guests
    - bugfixes and documentation improvements.

    x86:
    - Hyper-V VMBus hypercall userspace exit
    - alternative implementation of lowest-priority interrupts using
    vector hashing (for better VT-d posted interrupt support)
    - fixed guest debugging with nested virtualizations
    - improved interrupt tracking in the in-kernel IOAPIC
    - generic infrastructure for tracking writes to guest
    memory - currently its only use is to speedup the legacy shadow
    paging (pre-EPT) case, but in the future it will be used for
    virtual GPUs as well
    - much cleanup (LAPIC, kvmclock, MMU, PIT), including ubsan fixes"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (217 commits)
    KVM: x86: remove eager_fpu field of struct kvm_vcpu_arch
    KVM: x86: disable MPX if host did not enable MPX XSAVE features
    arm64: KVM: vgic-v3: Only wipe LRs on vcpu exit
    arm64: KVM: vgic-v3: Reset LRs at boot time
    arm64: KVM: vgic-v3: Do not save an LR known to be empty
    arm64: KVM: vgic-v3: Save maintenance interrupt state only if required
    arm64: KVM: vgic-v3: Avoid accessing ICH registers
    KVM: arm/arm64: vgic-v2: Make GICD_SGIR quicker to hit
    KVM: arm/arm64: vgic-v2: Only wipe LRs on vcpu exit
    KVM: arm/arm64: vgic-v2: Reset LRs at boot time
    KVM: arm/arm64: vgic-v2: Do not save an LR known to be empty
    KVM: arm/arm64: vgic-v2: Move GICH_ELRSR saving to its own function
    KVM: arm/arm64: vgic-v2: Save maintenance interrupt state only if required
    KVM: arm/arm64: vgic-v2: Avoid accessing GICH registers
    KVM: s390: allocate only one DMA page per VM
    KVM: s390: enable STFLE interpretation only if enabled for the guest
    KVM: s390: wake up when the VCPU cpu timer expires
    KVM: s390: step the VCPU timer while in enabled wait
    KVM: s390: protect VCPU cpu timer with a seqcount
    KVM: s390: step VCPU cpu timer during kvm_run ioctl
    ...

    Linus Torvalds
     

16 Mar, 2016

1 commit

  • Pull cpu hotplug updates from Thomas Gleixner:
    "This is the first part of the ongoing cpu hotplug rework:

    - Initial implementation of the state machine

    - Runs all online and prepare down callbacks on the plugged cpu and
    not on some random processor

    - Replaces busy loop waiting with completions

    - Adds tracepoints so the states can be followed"

    More detailed commentary on this work from an earlier email:
    "What's wrong with the current cpu hotplug infrastructure?

    - Asymmetry

    The hotplug notifier mechanism is asymmetric versus the bringup and
    teardown. This is mostly caused by the notifier mechanism.

    - Largely undocumented dependencies

    While some notifiers use explicitely defined notifier priorities,
    we have quite some notifiers which use numerical priorities to
    express dependencies without any documentation why.

    - Control processor driven

    Most of the bringup/teardown of a cpu is driven by a control
    processor. While it is understandable, that preperatory steps,
    like idle thread creation, memory allocation for and initialization
    of essential facilities needs to be done before a cpu can boot,
    there is no reason why everything else must run on a control
    processor. Before this patch series, bringup looks like this:

    Control CPU Booting CPU

    do preparatory steps
    kick cpu into life

    do low level init

    sync with booting cpu sync with control cpu

    bring the rest up

    - All or nothing approach

    There is no way to do partial bringups. That's something which is
    really desired because we waste e.g. at boot substantial amount of
    time just busy waiting that the cpu comes to life. That's stupid
    as we could very well do preparatory steps and the initial IPI for
    other cpus and then go back and do the necessary low level
    synchronization with the freshly booted cpu.

    - Minimal debuggability

    Due to the notifier based design, it's impossible to switch between
    two stages of the bringup/teardown back and forth in order to test
    the correctness. So in many hotplug notifiers the cancel
    mechanisms are either not existant or completely untested.

    - Notifier [un]registering is tedious

    To [un]register notifiers we need to protect against hotplug at
    every callsite. There is no mechanism that bringup/teardown
    callbacks are issued on the online cpus, so every caller needs to
    do it itself. That also includes error rollback.

    What's the new design?

    The base of the new design is a symmetric state machine, where both
    the control processor and the booting/dying cpu execute a well
    defined set of states. Each state is symmetric in the end, except
    for some well defined exceptions, and the bringup/teardown can be
    stopped and reversed at almost all states.

    So the bringup of a cpu will look like this in the future:

    Control CPU Booting CPU

    do preparatory steps
    kick cpu into life

    do low level init

    sync with booting cpu sync with control cpu

    bring itself up

    The synchronization step does not require the control cpu to wait.
    That mechanism can be done asynchronously via a worker or some
    other mechanism.

    The teardown can be made very similar, so that the dying cpu cleans
    up and brings itself down. Cleanups which need to be done after
    the cpu is gone, can be scheduled asynchronously as well.

    There is a long way to this, as we need to refactor the notion when a
    cpu is available. Today we set the cpu online right after it comes
    out of the low level bringup, which is not really correct.

    The proper mechanism is to set it to available, i.e. cpu local
    threads, like softirqd, hotplug thread etc. can be scheduled on that
    cpu, and once it finished all booting steps, it's set to online, so
    general workloads can be scheduled on it. The reverse happens on
    teardown. First thing to do is to forbid scheduling of general
    workloads, then teardown all the per cpu resources and finally shut it
    off completely.

    This patch series implements the basic infrastructure for this at the
    core level. This includes the following:

    - Basic state machine implementation with well defined states, so
    ordering and prioritization can be expressed.

    - Interfaces to [un]register state callbacks

    This invokes the bringup/teardown callback on all online cpus with
    the proper protection in place and [un]installs the callbacks in
    the state machine array.

    For callbacks which have no particular ordering requirement we have
    a dynamic state space, so that drivers don't have to register an
    explicit hotplug state.

    If a callback fails, the code automatically does a rollback to the
    previous state.

    - Sysfs interface to drive the state machine to a particular step.

    This is only partially functional today. Full functionality and
    therefor testability will be achieved once we converted all
    existing hotplug notifiers over to the new scheme.

    - Run all CPU_ONLINE/DOWN_PREPARE notifiers on the booting/dying
    processor:

    Control CPU Booting CPU

    do preparatory steps
    kick cpu into life

    do low level init

    sync with booting cpu sync with control cpu
    wait for boot
    bring itself up

    Signal completion to control cpu

    In a previous step of this work we've done a full tree mechanical
    conversion of all hotplug notifiers to the new scheme. The balance
    is a net removal of about 4000 lines of code.

    This is not included in this series, as we decided to take a
    different approach. Instead of mechanically converting everything
    over, we will do a proper overhaul of the usage sites one by one so
    they nicely fit into the symmetric callback scheme.

    I decided to do that after I looked at the ugliness of some of the
    converted sites and figured out that their hotplug mechanism is
    completely buggered anyway. So there is no point to do a
    mechanical conversion first as we need to go through the usage
    sites one by one again in order to achieve a full symmetric and
    testable behaviour"

    * 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
    cpu/hotplug: Document states better
    cpu/hotplug: Fix smpboot thread ordering
    cpu/hotplug: Remove redundant state check
    cpu/hotplug: Plug death reporting race
    rcu: Make CPU_DYING_IDLE an explicit call
    cpu/hotplug: Make wait for dead cpu completion based
    cpu/hotplug: Let upcoming cpu bring itself fully up
    arch/hotplug: Call into idle with a proper state
    cpu/hotplug: Move online calls to hotplugged cpu
    cpu/hotplug: Create hotplug threads
    cpu/hotplug: Split out the state walk into functions
    cpu/hotplug: Unpark smpboot threads from the state machine
    cpu/hotplug: Move scheduler cpu_online notifier to hotplug core
    cpu/hotplug: Implement setup/removal interface
    cpu/hotplug: Make target state writeable
    cpu/hotplug: Add sysfs state interface
    cpu/hotplug: Hand in target state to _cpu_up/down
    cpu/hotplug: Convert the hotplugged cpu work to a state machine
    cpu/hotplug: Convert to a state machine for the control processor
    cpu/hotplug: Add tracepoints
    ...

    Linus Torvalds
     

15 Mar, 2016

1 commit

  • Pull ram resource handling changes from Ingo Molnar:
    "Core kernel resource handling changes to support NVDIMM error
    injection.

    This tree introduces a new I/O resource type, IORESOURCE_SYSTEM_RAM,
    for System RAM while keeping the current IORESOURCE_MEM type bit set
    for all memory-mapped ranges (including System RAM) for backward
    compatibility.

    With this resource flag it no longer takes a strcmp() loop through the
    resource tree to find "System RAM" resources.

    The new resource type is then used to extend ACPI/APEI error injection
    facility to also support NVDIMM"

    * 'core-resources-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    ACPI/EINJ: Allow memory error injection to NVDIMM
    resource: Kill walk_iomem_res()
    x86/kexec: Remove walk_iomem_res() call with GART type
    x86, kexec, nvdimm: Use walk_iomem_res_desc() for iomem search
    resource: Add walk_iomem_res_desc()
    memremap: Change region_intersects() to take @flags and @desc
    arm/samsung: Change s3c_pm_run_res() to use System RAM type
    resource: Change walk_system_ram() to use System RAM type
    drivers: Initialize resource entry to zero
    xen, mm: Set IORESOURCE_SYSTEM_RAM to System RAM
    kexec: Set IORESOURCE_SYSTEM_RAM for System RAM
    arch: Set IORESOURCE_SYSTEM_RAM flag for System RAM
    ia64: Set System RAM type and descriptor
    x86/e820: Set System RAM type and descriptor
    resource: Add I/O resource descriptor
    resource: Handle resource flags properly
    resource: Add System RAM resource type

    Linus Torvalds
     

05 Mar, 2016

1 commit


02 Mar, 2016

1 commit

  • Let the non boot cpus call into idle with the corresponding hotplug state, so
    the hotplug core can handle the further bringup. That's a first step to
    convert the boot side of the hotplugged cpus to do all the synchronization
    with the other side through the state machine. For now it'll only start the
    hotplug thread and kick the full bringup of the cpu.

    Signed-off-by: Thomas Gleixner
    Cc: linux-arch@vger.kernel.org
    Cc: Rik van Riel
    Cc: Rafael Wysocki
    Cc: "Srivatsa S. Bhat"
    Cc: Peter Zijlstra
    Cc: Arjan van de Ven
    Cc: Sebastian Siewior
    Cc: Rusty Russell
    Cc: Steven Rostedt
    Cc: Oleg Nesterov
    Cc: Tejun Heo
    Cc: Andrew Morton
    Cc: Paul McKenney
    Cc: Linus Torvalds
    Cc: Paul Turner
    Link: http://lkml.kernel.org/r/20160226182341.614102639@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

01 Mar, 2016

6 commits


22 Feb, 2016

4 commits

  • With CONFIG_DEBUG_RODATA not being sensible under XIP_KERNEL, remove it
    from the XIP linker script.

    Signed-off-by: Kees Cook
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Russell King

    Kees Cook
     
  • The __start_rodata_section_aligned is only referenced by the
    DEBUG_RODATA code, which is only used when the MMU is enabled,
    but the definition fails on !MMU builds:

    arch/arm/kernel/vmlinux.lds:702: undefined symbol `SECTION_SHIFT' referenced in expression

    This hides the symbol whenever DEBUG_RODATA is disabled.

    Signed-off-by: Arnd Bergmann
    Fixes: 64ac2e74f0b2 ("ARM: 8502/1: mm: mark section-aligned portion of rodata NX")
    Acked-by: Ard Biesheuvel
    Signed-off-by: Russell King

    Arnd Bergmann
     
  • ARMv6 CPUs do not have virtualisation extensions, but hyp-stub.S is
    still included into the image to keep it generic. In order to use ARMv7
    instructions during HYP initialisation, add -march=armv7-a flag to
    hyp-stub's build.

    On an ARMv6 CPU, __hyp_stub_install returns as soon as it detects that
    the mode isn't HYP, so we will never reach those instructions.

    Signed-off-by: Jean-Philippe Brucker
    Signed-off-by: Russell King

    Jean-Philippe Brucker
     
  • ARMv6 CPUs do not have virtualisation extensions, but hyp-stub.S is
    still included into the image to keep it generic. In order to use ARMv7
    instructions during HYP initialisation, add -march=armv7-a flag to
    hyp-stub's build.

    On an ARMv6 CPU, __hyp_stub_install returns as soon as it detects that
    the mode isn't HYP, so we will never reach those instructions.

    Signed-off-by: Jean-Philippe Brucker
    Signed-off-by: Russell King

    Jean-Philippe Brucker
     

17 Feb, 2016

1 commit


11 Feb, 2016

5 commits

  • When rodata is large enough that it crosses a section boundary after the
    kernel text, mark the rest NX. This is as close to full NX of rodata as
    we can get without splitting page tables or doing section alignment via
    CONFIG_DEBUG_ALIGN_RODATA.

    When the config is:

    CONFIG_DEBUG_RODATA=y
    # CONFIG_DEBUG_ALIGN_RODATA is not set

    Before:

    ---[ Kernel Mapping ]---
    0x80000000-0x80100000 1M RW NX SHD
    0x80100000-0x80a00000 9M ro x SHD
    0x80a00000-0xa0000000 502M RW NX SHD

    After:

    ---[ Kernel Mapping ]---
    0x80000000-0x80100000 1M RW NX SHD
    0x80100000-0x80700000 6M ro x SHD
    0x80700000-0x80a00000 3M ro NX SHD
    0x80a00000-0xa0000000 502M RW NX SHD

    Signed-off-by: Kees Cook
    Reviewed-by: Ard Biesheuvel
    Signed-off-by: Russell King

    Kees Cook
     
  • For an XIP build, _etext does not represent the end of the
    binary image that needs to stay mapped into the MODULES_VADDR area.
    Years ago, data came before text in the memory map. However,
    now that the order is text/init/data, an XIP_KERNEL needs to map
    up to the data location in order to keep from cutting off
    parts of the kernel that are needed.
    We only map up to the beginning of data because data has already been
    copied, so there's no reason to keep it around anymore.
    A new symbol is created to make it clear what it is we are referring
    to.

    This fixes the bug where you might lose the end of your kernel area
    after page table setup is complete.

    Signed-off-by: Chris Brandt
    Signed-off-by: Russell King

    Chris Brandt
     
  • Commit b9b32bf70f2f ("ARM: use linker magic for vectors and vector stubs")
    updated the linker script to emit the .vectors and .stubs sections into a
    VMA range that is zero based and disjoint from the normal static kernel
    region. The reason for that was that this way, the sections can be placed
    exactly 4 KB apart, while the payload of the .vectors section is only 32
    bytes.

    Since the symbols that are part of the .stubs section are emitted into the
    kallsyms table, they appear with zero based addresses as well, e.g.,

    00001004 t vector_rst
    00001020 t vector_irq
    000010a0 t vector_dabt
    00001120 t vector_pabt
    000011a0 t vector_und
    00001220 t vector_addrexcptn
    00001240 t vector_fiq
    00001240 T vector_fiq_offset

    As this confuses perf when it accesses the kallsyms tables, commit
    7122c3e9154b ("scripts/link-vmlinux.sh: only filter kernel symbols for
    arm") implemented a somewhat ugly special case for ARM, where the value
    of CONFIG_PAGE_OFFSET is passed to scripts/kallsyms, and symbols whose
    addresses are below it are filtered out. Note that this special case only
    applies to CONFIG_XIP_KERNEL=n, not because the issue the patch addresses
    exists only in that case, but because finding a limit below which to apply
    the filtering is not entirely straightforward.

    Since the .vectors and .stubs sections contain position independent code
    that is never executed in place, we can emit it at its most likely runtime
    VMA (for more recent CPUs), which is 0xffff0000 for the vector table and
    0xffff1000 for the stubs. Not only does this fix the perf issue with
    kallsyms, allowing us to drop the special case in scripts/kallsyms
    entirely, it also gives debuggers a more realistic view of the address
    space, and setting breakpoints or single stepping through code in the
    vector table or the stubs is more likely to work as expected on CPUs that
    use a high vector address. E.g.,

    00001240 A vector_fiq_offset
    ...
    c0c35000 T __init_begin
    c0c35000 T __vectors_start
    c0c35020 T __stubs_start
    c0c35020 T __vectors_end
    c0c352e0 T _sinittext
    c0c352e0 T __stubs_end
    ...
    ffff1004 t vector_rst
    ffff1020 t vector_irq
    ffff10a0 t vector_dabt
    ffff1120 t vector_pabt
    ffff11a0 t vector_und
    ffff1220 t vector_addrexcptn
    ffff1240 T vector_fiq

    (Note that vector_fiq_offset is now an absolute symbol, which kallsyms
    already ignores by default)

    The LMA footprint is identical with or without this change, only the VMAs
    are different:

    Before:
    Idx Name Size VMA LMA File off Algn
    ...
    14 .notes 00000024 c0c34020 c0c34020 00a34020 2**2
    CONTENTS, ALLOC, LOAD, READONLY, CODE
    15 .vectors 00000020 00000000 c0c35000 00a40000 2**1
    CONTENTS, ALLOC, LOAD, READONLY, CODE
    16 .stubs 000002c0 00001000 c0c35020 00a41000 2**5
    CONTENTS, ALLOC, LOAD, READONLY, CODE
    17 .init.text 0006b1b8 c0c352e0 c0c352e0 00a452e0 2**5
    CONTENTS, ALLOC, LOAD, READONLY, CODE
    ...

    After:
    Idx Name Size VMA LMA File off Algn
    ...
    14 .notes 00000024 c0c34020 c0c34020 00a34020 2**2
    CONTENTS, ALLOC, LOAD, READONLY, CODE
    15 .vectors 00000020 ffff0000 c0c35000 00a40000 2**1
    CONTENTS, ALLOC, LOAD, READONLY, CODE
    16 .stubs 000002c0 ffff1000 c0c35020 00a41000 2**5
    CONTENTS, ALLOC, LOAD, READONLY, CODE
    17 .init.text 0006b1b8 c0c352e0 c0c352e0 00a452e0 2**5
    CONTENTS, ALLOC, LOAD, READONLY, CODE
    ...

    Acked-by: Nicolas Pitre
    Acked-by: Chris Brandt
    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Russell King

    Ard Biesheuvel
     
  • Commit b9b32bf70f2f ("ARM: use linker magic for vectors and vector stubs")
    introduced new global definitions of __vectors_start and __stubs_start,
    and changed the existing ones to have internal linkage only. However, these
    symbols are still visible to kallsyms, and due to the way the .vectors and
    .stubs sections are emitted at the base of the VMA space, these duplicate
    definitions have conflicting values.

    $ nm -n vmlinux |grep -E __vectors|__stubs
    00000000 t __vectors_start
    00001000 t __stubs_start
    c0e77000 T __vectors_start
    c0e77020 T __stubs_start

    This is completely harmless by itself, since the wrong values are local
    symbols that cannot be referenced by other object files directly. However,
    since these symbols are also listed in the kallsyms symbol table in some
    cases (i.e., CONFIG_KALLSYMS_ALL=y and CONFIG_XIP_KERNEL=y), having these
    conflicting values can be confusing. So either remove them, or make them
    strictly local.

    Acked-by: Chris Brandt
    Acked-by: Nicolas Pitre
    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Russell King

    Ard Biesheuvel
     
  • When building an XIP kernel, the linker script needs to be much different
    than a conventional kernel's script. Over time, it's been difficult to
    maintain both XIP and non-XIP layouts in one linker script. Therefore,
    this patch separates the two procedures into two completely different
    files.

    The new linker script is essentially a straight copy of the current script
    with all the non-CONFIG_XIP_KERNEL portions removed.

    Additionally, all CONFIG_XIP_KERNEL portions have been removed from the
    existing linker script...never to return again.

    It should be noted that this does not fix any current XIP issues, but
    rather is the first move in fixing them properly with subsequent patches.

    Signed-off-by: Chris Brandt
    Acked-by: Nicolas Pitre
    Signed-off-by: Russell King

    Chris Brandt
     

08 Feb, 2016

3 commits

  • The use of CONFIG_DEBUG_RODATA is generally seen as an essential part of
    kernel self-protection:
    http://www.openwall.com/lists/kernel-hardening/2015/11/30/13
    Additionally, its name has grown to mean things beyond just rodata. To
    get ARM closer to this, we ought to rearrange the names of the configs
    that control how the kernel protects its memory. What was called
    CONFIG_ARM_KERNMEM_PERMS is realy doing the work that other architectures
    call CONFIG_DEBUG_RODATA.

    This redefines CONFIG_DEBUG_RODATA to actually do the bulk of the
    ROing (and NXing). In the place of the old CONFIG_DEBUG_RODATA, use
    CONFIG_DEBUG_ALIGN_RODATA, since that's what the option does: adds
    section alignment for making rodata explicitly NX, as arm does not split
    the page tables like arm64 does without _ALIGN_RODATA.

    Also adds human readable names to the sections so I could more easily
    debug my typos, and makes CONFIG_DEBUG_RODATA default "y" for CPU_V7.

    Results in /sys/kernel/debug/kernel_page_tables for each config state:

    # CONFIG_DEBUG_RODATA is not set
    # CONFIG_DEBUG_ALIGN_RODATA is not set

    ---[ Kernel Mapping ]---
    0x80000000-0x80900000 9M RW x SHD
    0x80900000-0xa0000000 503M RW NX SHD

    CONFIG_DEBUG_RODATA=y
    CONFIG_DEBUG_ALIGN_RODATA=y

    ---[ Kernel Mapping ]---
    0x80000000-0x80100000 1M RW NX SHD
    0x80100000-0x80700000 6M ro x SHD
    0x80700000-0x80a00000 3M ro NX SHD
    0x80a00000-0xa0000000 502M RW NX SHD

    CONFIG_DEBUG_RODATA=y
    # CONFIG_DEBUG_ALIGN_RODATA is not set

    ---[ Kernel Mapping ]---
    0x80000000-0x80100000 1M RW NX SHD
    0x80100000-0x80a00000 9M ro x SHD
    0x80a00000-0xa0000000 502M RW NX SHD

    Signed-off-by: Kees Cook
    Reviewed-by: Laura Abbott
    Signed-off-by: Russell King

    Kees Cook
     
  • Code run via soft_restart() is run with the MMU disabled, so we need to
    pass the identity map physical address rather than the address obtained
    from virt_to_phys(). Therefore, replace virt_to_phys() with
    virt_to_idmap() for all callers of soft_restart().

    Signed-off-by: Russell King

    Russell King
     
  • Make virt_to_idmap() return an unsigned long rather than phys_addr_t.

    Returning phys_addr_t here makes no sense, because the definition of
    virt_to_idmap() is that it shall return a physical address which maps
    identically with the virtual address. Since virtual addresses are
    limited to 32-bit, identity mapped physical addresses are as well.

    Almost all users already had an implicit narrowing cast to unsigned long
    so let's make this official and part of this interface.

    Tested-by: Grygorii Strashko
    Signed-off-by: Russell King

    Russell King
     

30 Jan, 2016

1 commit

  • Set IORESOURCE_SYSTEM_RAM in flags of resource ranges with
    "System RAM", "Kernel code", "Kernel data", and "Kernel bss".

    Note that:

    - IORESOURCE_SYSRAM (i.e. modifier bit) is set in flags when
    IORESOURCE_MEM is already set. IORESOURCE_SYSTEM_RAM is defined
    as (IORESOURCE_MEM|IORESOURCE_SYSRAM).

    - Some archs do not set 'flags' for children nodes, such as
    "Kernel code". This patch does not change 'flags' in this
    case.

    Signed-off-by: Toshi Kani
    Signed-off-by: Borislav Petkov
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Linus Torvalds
    Cc: Luis R. Rodriguez
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Toshi Kani
    Cc: linux-arch@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-mm
    Cc: linux-parisc@vger.kernel.org
    Cc: linux-s390@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: sparclinux@vger.kernel.org
    Link: http://lkml.kernel.org/r/1453841853-11383-7-git-send-email-bp@alien8.de
    Signed-off-by: Ingo Molnar

    Toshi Kani
     

28 Jan, 2016

1 commit


27 Jan, 2016

2 commits

  • arm: irq: l2c: do not print error in case of missing l2c from dtb

    In some architectures the L2 cache controller is integrated in the
    processor's block itself and it doesn't use any external cache
    controller. This means that an entry in the board's dtb related
    to the l2c is not necessary.

    Distinguish between error codes and do not print anything in case
    l2x0_of_init() doesn't find any L2C DTB entry and returns -ENODEV.

    This patch mutes the following error message:

    L2C: failed to init: -19

    on boards like odroid-xu4, cortex A7/A15, which don't have
    external cache controller.

    Signed-off-by: Andi Shyti
    Reported-by: Krzysztof Kozlowski
    Reviewed-by: Krzysztof Kozlowski
    Tested-by: Krzysztof Kozlowski
    Signed-off-by: Russell King

    Andiii
     
  • Instead of looping through all cpus calling set_capacity_scale, we can
    initialise cpu_scale per-cpu variables to SCHED_CAPACITY_SCALE with their
    definition.

    Acked-by: Vincent Guittot
    Signed-off-by: Juri Lelli
    Signed-off-by: Russell King

    Juri Lelli
     

26 Jan, 2016

1 commit

  • ARMv7 counters other than the CPU cycle counter only work if the Secure
    Debug Enable Register (SDER) SUNIDEN bit is set.

    Since access to the SDER is only possible in secure state, it will
    only be done if the device tree property "secure-reg-access" is set.

    Without this:

    Performance counter stats for 'sleep 1':

    14606094 cycles # 0.000 GHz
    0 instructions # 0.00 insns per cycle

    After applying:

    Performance counter stats for 'sleep 1':

    5843809 cycles
    2566484 instructions # 0.44 insns per cycle

    1.020144000 seconds time elapsed

    Some platforms (eg i.MX53) may also need additional platform specific
    setup.

    Acked-by: Rob Herring
    Signed-off-by: Martin Fuzzey
    Signed-off-by: Pooya Keshavarzi
    Signed-off-by: George G. Davis
    [will: add warning if property is found on arm64]
    Signed-off-by: Will Deacon

    Martin Fuzzey
     

21 Jan, 2016

2 commits

  • Pull ARM SoC multiplatform code updates from Arnd Bergmann:
    "This branch is the culmination of 5 years of effort to bring the ARMv6
    and ARMv7 platforms together such that they can all be enabled and
    boot the same kernel. It has been a tremendous amount of cleanup and
    refactoring by a huge number of people, and creation of several new
    (and major) subsystems to better abstract out all the platform details
    in an appropriate manner.

    The bulk of this branch is a large patchset from Arnd that brings
    several of the more minor and older platforms we have closer to
    multiplatform support. Among these are MMP, S3C64xx, Orion5x, mv78xx0
    and realview Much of this is moving around header files from old mach
    directories, but there are also some cleanup patches of debug_ll
    (lowlevel debug per-platform options) and other parts.

    Linus Walleij also has some patchs to clean up the older ARM Realview
    platforms by finally introducing DT support, and Rob Herring has some
    for ARM Versatile which is now DT-only. Both of these platforms are
    now multiplatform.

    Finally, a couple of patches from Russell for Dove PMU, and a fix from
    Valentin Rothberg for Exynos ADC, which were rebased on top of the
    series to avoid conflicts"

    * tag 'armsoc-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (75 commits)
    ARM: realview: don't select SMP_ON_UP for UP builds
    ARM: s3c: simplify s3c_irqwake_{e,}intallow definition
    ARM: s3c64xx: fix pm-debug compilation
    iio: exynos-adc: fix irqf_oneshot.cocci warnings
    ARM: realview: build realview-dt SMP support only when used
    ARM: realview: select apropriate targets
    ARM: realview: clean up header files
    ARM: realview: make all header files local
    ARM: no longer make CPU targets visible separately
    ARM: integrator: use explicit core module options
    ARM: realview: enable multiplatform
    ARM: make default platform work for NOMMU
    ARM: debug-ll: move DEBUG_LL_UART_EFM32 to correct Kconfig location
    ARM: defconfig: use correct debug_ll settings
    ARM: versatile: convert to multi-platform
    ARM: versatile: merge mach code into a single file
    ARM: versatile: switch to DT only booting and remove legacy code
    ARM: versatile: add DT based PCI detection
    ARM: pxa: mark ezx structures as __maybe_unused
    ARM: pxa: mark raumfeld init functions as __maybe_unused
    ...

    Linus Torvalds
     
  • Pull ARM SoC cleanups from Olof Johansson:
    "A smallish number of general cleanup commits this release cycle. Some
    of these are minor tweaks:

    - shmobile change of binding for their GIC (using arm,pl390 now)
    - ARCH_RENESAS introduction
    - Misc other renesas updates

    There's also a couple of treewide commits from Masahiro Yamada
    cleaning up const/__initconst for SMP operation structs and a switch
    to using "depends on" instead of if-constructs on most of the Kconfig
    platform targets"

    * tag 'armsoc-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
    staging: board: armadillo800eva: Use "arm,pl390"
    staging: board: kzm9d: Use "arm,pl390"
    ARM: shmobile: r8a7778 dtsi: Use "arm,pl390" for GIC
    ARM: shmobile: emev2 dtsi: Use "arm,pl390" for GIC
    ARM: shmobile: r8a7740 dtsi: Use "arm,pl390" for GIC
    ARM: shmobile: r7s72100 dtsi: Use "arm,pl390" for GIC
    ARM: use "depends on" for SoC configs instead of "if" after prompt
    ARM/clocksource: use automatic DT probing for ux500 PRCMU
    ARM: use const and __initconst for smp_operations
    ARM: hisi: do not export smp_operations structures
    ARM: mvebu: remove unused mach/gpio.h
    ARM: shmobile: Remove legacy mach/irqs.h
    ARM: shmobile: Introduce ARCH_RENESAS
    MAINTAINERS: Remove link to oss.renesas.com which is closed

    Linus Torvalds
     

15 Jan, 2016

1 commit

  • Pull livepatching updates from Jiri Kosina:

    - RO/NX attribute fixes for patch module relocations from Josh
    Poimboeuf. As part of this effort, module.c has been cleaned up as
    well and livepatching is piggy-backing on this cleanup. Rusty is OK
    with this whole lot going through livepatching tree.

    - symbol disambiguation support from Chris J Arges. That series is
    also

    Reviewed-by: Miroslav Benes

    but this came in only after I've alredy pushed out. Didn't want to
    rebase because of that, hence I am mentioning it here.

    - symbol lookup fix from Miroslav Benes

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching:
    livepatch: Cleanup module page permission changes
    module: keep percpu symbols in module's symtab
    module: clean up RO/NX handling.
    module: use a structure to encapsulate layout.
    gcov: use within_module() helper.
    module: Use the same logic for setting and unsetting RO/NX
    livepatch: function,sympos scheme in livepatch sysfs directory
    livepatch: add sympos as disambiguator field to klp_reloc
    livepatch: add old_sympos as disambiguator field to klp_func

    Linus Torvalds
     

13 Jan, 2016

3 commits

  • Pull xen updates from David Vrabel:
    "Xen features and fixes for 4.5-rc0:

    - Stolen ticks and PV wallclock support for arm/arm64

    - Add grant copy ioctl to gntdev device"

    * tag 'for-linus-4.5-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    xen/gntdev: add ioctl for grant copy
    x86/xen: don't reset vcpu_info on a cancelled suspend
    xen/gntdev: constify mmu_notifier_ops structures
    xen/grant-table: constify gnttab_ops structure
    xen/time: use READ_ONCE
    xen/x86: convert remaining timespec to timespec64 in xen_pvclock_gtod_notify
    xen/x86: support XENPF_settime64
    xen/arm: set the system time in Xen via the XENPF_settime64 hypercall
    xen/arm: introduce xen_read_wallclock
    arm: extend pvclock_wall_clock with sec_hi
    xen: introduce XENPF_settime64
    xen/arm: introduce HYPERVISOR_platform_op on arm and arm64
    xen: rename dom0_op to platform_op
    xen/arm: account for stolen ticks
    arm64: introduce CONFIG_PARAVIRT, PARAVIRT_TIME_ACCOUNTING and pv_time_ops
    arm: introduce CONFIG_PARAVIRT, PARAVIRT_TIME_ACCOUNTING and pv_time_ops
    missing include asm/paravirt.h in cputime.c
    xen: move xen_setup_runstate_info and get_runstate_snapshot to drivers/xen/time.c

    Linus Torvalds
     
  • Pull ARM updates from Russell King:

    - UEFI boot and runtime services support for ARM from Ard Biesheuvel
    and Roy Franz.

    - DT compatibility with old atags booting protocol for Nokia N900
    devices from Ivaylo Dimitrov.

    - PSCI firmware interface using new arm-smc calling convention from
    Jens Wiklander.

    - Runtime patching for udiv/sdiv instructions for ARMv7 CPUs that
    support these instructions from Nicolas Pitre.

    - L2x0 cache updates from Dirk B and Linus Walleij.

    - Randconfig fixes from Arnd Bergmann.

    - ARMv7M (nommu) updates from Ezequiel Garcia

    * 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm: (34 commits)
    ARM: 8481/2: drivers: psci: replace psci firmware calls
    ARM: 8480/2: arm64: add implementation for arm-smccc
    ARM: 8479/2: add implementation for arm-smccc
    ARM: 8478/2: arm/arm64: add arm-smccc
    ARM: 8494/1: mm: Enable PXN when running non-LPAE kernel on LPAE processor
    ARM: 8496/1: OMAP: RX51: save ATAGS data in the early boot stage
    ARM: 8495/1: ATAGS: move save_atags() to arch/arm/include/asm/setup.h
    ARM: 8452/3: PJ4: make coprocessor access sequences buildable in Thumb2 mode
    ARM: 8482/1: l2x0: make it possible to disable outer sync from DT
    ARM: 8488/1: Make IPI_CPU_BACKTRACE a "non-secure" SGI
    ARM: 8487/1: Remove IPI_CALL_FUNC_SINGLE
    ARM: 8485/1: cpuidle: remove cpu parameter from the cpuidle_ops suspend hook
    ARM: 8484/1: Documentation: l2c2x0: Mention separate controllers explicitly
    ARM: 8483/1: Documentation: l2c: Rename l2cc to l2c2x0
    ARM: 8477/1: runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()
    ARM: 8476/1: VDSO: use PTR_ERR_OR_ZERO for vma check
    ARM: 8453/2: proc-v7.S: don't locate temporary stack space in .text section
    ARM: add UEFI stub support
    ARM: wire up UEFI init and runtime support
    ARM: only consider memblocks with NOMAP cleared for linear mapping
    ...

    Linus Torvalds
     
  • Pull arm[64] perf updates from Will Deacon:
    "In the past, I have funnelled perf updates through the respective
    architecture trees, but now that the arm/arm64 perf driver has been
    largely consolidated under drivers/perf/, it makes more sense to send
    a separate pull, particularly as I'm listed as maintainer for all the
    files involved. I offered the branch to arm-soc, but Arnd suggested
    that I just send it to you directly.

    So, here is the arm/arm64 perf queue for 4.5. The main features are
    described below, but the most useful change is from Drew, which
    advertises our architected event mapping in sysfs so that the perf
    tool is a lot more user friendly and no longer requires the use of
    magic hex constants for profiling common events.

    - Support for the CPU PMU in Cortex-A72

    - Add sysfs entries to describe the architected events and their
    mappings for PMUv{1-3}"

    * tag 'arm64-perf' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    arm64: perf: add support for Cortex-A72
    arm64: perf: add format entry to describe event -> config mapping
    ARM: perf: add format entry to describe event -> config mapping
    arm64: kernel: enforce pmuserenr_el0 initialization and restore
    arm64: perf: Correct Cortex-A53/A57 compatible values
    arm64: perf: Add event descriptions
    arm64: perf: Convert event enums to #defines
    arm: perf: Add event descriptions
    arm: perf: Convert event enums to #defines
    drivers/perf: kill armpmu_register

    Linus Torvalds
     

12 Jan, 2016

1 commit


05 Jan, 2016

1 commit