16 Jan, 2015

2 commits

  • cycles:p and cycles:pp do not work on SLM since commit:

    86a04461a99f ("perf/x86: Revamp PEBS event selection")

    UOPS_RETIRED.ALL is not a PEBS capable event, so it should not be used
    to count cycle number.

    Actually SLM calls intel_pebs_aliases_core2() which uses INST_RETIRED.ANY_P
    to count the number of cycles. It's a PEBS capable event. But inv and
    cmask must be set to count cycles.

    Considering SLM allows all events as PEBS with no flags, only
    INST_RETIRED.ANY_P, inv=1, cmask=16 needs to handled specially.

    Signed-off-by: Kan Liang
    Signed-off-by: Peter Zijlstra (Intel)
    Link: http://lkml.kernel.org/r/1421084541-31639-1-git-send-email-kan.liang@intel.com
    Cc: Arnaldo Carvalho de Melo
    Cc: Linus Torvalds
    Signed-off-by: Ingo Molnar

    Kan Liang
     
  • This patch fixes a problem with the initialization of the
    sysfs_show() routine for the RAPL PMU.

    The current code was wrongly relying on the EVENT_ATTR_STR()
    macro which uses the events_sysfs_show() function in the x86
    PMU code. That function itself was relying on the x86_pmu data
    structure. Yet RAPL and the core PMU (x86_pmu) have nothing to
    do with each other. They should therefore not interact with
    each other.

    The x86_pmu structure is initialized at boot time based on
    the host CPU model. When the host CPU is not supported, the
    x86_pmu remains uninitialized and some of the callbacks it
    contains are NULL.

    The false dependency with x86_pmu could potentially cause crashes
    in case the x86_pmu is not initialized while the RAPL PMU is. This
    may, for instance, be the case in virtualized environments.

    This patch fixes the problem by using a private sysfs_show()
    routine for exporting the RAPL PMU events.

    Signed-off-by: Stephane Eranian
    Signed-off-by: Peter Zijlstra (Intel)
    Link: http://lkml.kernel.org/r/20150113225953.GA21525@thinkpad
    Cc: vincent.weaver@maine.edu
    Cc: jolsa@redhat.com
    Cc: Arnaldo Carvalho de Melo
    Cc: Linus Torvalds
    Signed-off-by: Ingo Molnar

    Stephane Eranian
     

15 Jan, 2015

3 commits

  • Pull networking fixes from David Miller:

    1) Don't use uninitialized data in IPVS, from Dan Carpenter.

    2) conntrack race fixes from Pablo Neira Ayuso.

    3) Fix TX hangs with i40e, from Jesse Brandeburg.

    4) Fix budget return from poll calls in dnet and alx, from Eric
    Dumazet.

    5) Fix bugus "if (unlikely(x) < 0)" test in AF_PACKET, from Christoph
    Jaeger.

    6) Fix bug introduced by conversion to list_head in TIPC retransmit
    code, from Jon Paul Maloy.

    7) Don't use GFP_NOIO under spinlock in USB kaweth driver, from Alexey
    Khoroshilov.

    8) Fix bridge build with INET disabled, from Arnd Bergmann.

    9) Fix netlink array overrun for PROBE attributes in openvswitch, from
    Thomas Graf.

    10) Don't hold spinlock across synchronize_irq() in tg3 driver, from
    Prashant Sreedharan.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (44 commits)
    tg3: Release tp->lock before invoking synchronize_irq()
    tg3: tg3_reset_task() needs to use rtnl_lock to synchronize
    tg3: tg3_timer() should grab tp->lock before checking for tp->irq_sync
    team: avoid possible underflow of count_pending value for notify_peers and mcast_rejoin
    openvswitch: packet messages need their own probe attribtue
    i40e: adds FCoE configure option
    cxgb4vf: Fix queue allocation for 40G adapter
    netdevice: Add missing parentheses in macro
    bridge: only provide proxy ARP when CONFIG_INET is enabled
    neighbour: fix base_reachable_time(_ms) not effective immediatly when changed
    net: fec: fix MDIO bus assignement for dual fec SoC's
    xen-netfront: use different locks for Rx and Tx stats
    drivers: net: cpsw: fix multicast flush in dual emac mode
    cxgb4vf: Initialize mdio_addr before using it
    net: Corrected the comment describing the ndo operations to reflect the actual prototype for couple of operations
    usb/kaweth: use GFP_ATOMIC under spin_lock in usb_start_wait_urb()
    MAINTAINERS: add me as ibmveth maintainer
    tipc: fix bug in broadcast retransmit code
    update ip-sysctl.txt documentation (v2)
    net/at91_ether: prepare and unprepare clock
    ...

    Linus Torvalds
     
  • Pull kvm fixes from Paolo Bonzini:
    "Two bugfixes for arm64. I will have another pull request next week,
    but otherwise things are calm"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
    arm64: KVM: Fix HCR setting for 32bit guests
    arm64: KVM: Fix TLB invalidation by IPA/VMID

    Linus Torvalds
     
  • Pull s390 fixes from Martin Schwidefsky:
    "Two small performance tweaks, the plumbing for the execveat system
    call and a couple of bug fixes"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    s390/uprobes: fix user space PER events
    s390/bpf: Fix JMP_JGE_X (A > X) and JMP_JGT_X (A >= X)
    s390/bpf: Fix ALU_NEG (A = -A)
    s390/mm: avoid using pmd_to_page for !USE_SPLIT_PMD_PTLOCKS
    s390/timex: fix get_tod_clock_ext() inline assembly
    s390: wire up execveat syscall
    s390/kernel: use stnsm 255 instead of stosm 0
    s390/vtime: Get rid of redundant WARN_ON
    s390/zcrypt: kernel oops at insmod of the z90crypt device driver

    Linus Torvalds
     

14 Jan, 2015

2 commits

  • On i.MX28, the MDIO bus is shared between the two FEC instances.
    The driver makes sure that the second FEC uses the MDIO bus of the
    first FEC. This is done conditionally if FEC_QUIRK_ENET_MAC is set.
    However, in newer designs, such as Vybrid or i.MX6SX, each FEC MAC
    has its own MDIO bus. Simply removing the quirk FEC_QUIRK_ENET_MAC
    is not an option since other logic, triggered by this quirk, is
    still needed.

    Furthermore, there are board designs which use the same MDIO bus
    for both PHY's even though the second bus would be available on the
    SoC side. Such layout are popular since it saves pins on SoC side.
    Due to the above quirk, those boards currently do work fine. The
    boards in the mainline tree with such a layout are:
    - Freescale Vybrid Tower with TWR-SER2 (vf610-twr.dts)
    - Freescale i.MX6 SoloX SDB Board (imx6sx-sdb.dts)

    This patch adds a new quirk FEC_QUIRK_SINGLE_MDIO for i.MX28, which
    makes sure that the MDIO bus of the first FEC is used in any case.

    However, the boards above do have a SoC with a MDIO bus for each FEC
    instance. But the PHY's are not connected in a 1:1 configuration. A
    proper device tree description is needed to allow the driver to
    figure out where to find its PHY. This patch fixes that shortcoming
    by adding a MDIO bus child node to the first FEC instance, along
    with the two PHY's on that bus, and making use of the phy-handle
    property to add a reference to the PHY's.

    Acked-by: Sascha Hauer
    Signed-off-by: Stefan Agner
    Signed-off-by: David S. Miller

    Stefan Agner
     
  • Pull xen bug fixes from David Vrabel:
    "Several critical linear p2m fixes that prevented some hosts from
    booting"

    * tag 'stable/for-linus-3.19-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
    x86/xen: properly retrieve NMI reason
    xen: check for zero sized area when invalidating memory
    xen: use correct type for physical addresses
    xen: correct race in alloc_p2m_pmd()
    xen: correct error for building p2m list on 32 bits
    x86/xen: avoid freeing static 'name' when kasprintf() fails
    x86/xen: add extra memory for remapped frames during setup
    x86/xen: don't count how many PFNs are identity mapped
    x86/xen: Free bootmem in free_p2m_page() during early boot
    x86/xen: Remove unnecessary BUG_ON(preemptible()) in xen_setup_timer()

    Linus Torvalds
     

13 Jan, 2015

1 commit

  • Using the native code here can't work properly, as the hypervisor would
    normally have cleared the two reason bits by the time Dom0 gets to see
    the NMI (if passed to it at all). There's a shared info field for this,
    and there's an existing hook to use - just fit the two together. This
    is particularly relevant so that NMIs intended to be handled by APEI /
    GHES actually make it to the respective handler.

    Note that the hook can (and should) be used irrespective of whether
    being in Dom0, as accessing port 0x61 in a DomU would be even worse,
    while the shared info field would just hold zero all the time. Note
    further that hardware NMI handling for PVH doesn't currently work
    anyway due to missing code in the hypervisor (but it is expected to
    work the native rather than the PV way).

    Signed-off-by: Jan Beulich
    Reviewed-by: Boris Ostrovsky
    Signed-off-by: David Vrabel

    Jan Beulich
     

12 Jan, 2015

10 commits

  • Commit b856a59141b1 (arm/arm64: KVM: Reset the HCR on each vcpu
    when resetting the vcpu) moved the init of the HCR register to
    happen later in the init of a vcpu, but left out the fixup
    done in kvm_reset_vcpu when preparing for a 32bit guest.

    As a result, the 32bit guest is run as a 64bit guest, but the
    rest of the kernel still manages it as a 32bit. Fun follows.

    Moving the fixup to vcpu_reset_hcr solves the problem for good.

    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall
    Signed-off-by: Paolo Bonzini

    Marc Zyngier
     
  • It took about two years for someone to notice that the IPA passed
    to TLBI IPAS2E1IS must be shifted by 12 bits. Clearly our reviewing
    is not as good as it should be...

    Paper bag time for me.

    Reported-by: Mario Smarduch
    Tested-by: Mario Smarduch
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall
    Signed-off-by: Paolo Bonzini

    Marc Zyngier
     
  • With the introduction of the linear mapped p2m list setting memory
    areas to "invalid" had to be delayed. When doing the invalidation
    make sure no zero sized areas are processed.

    Signed-off-by: Juegren Gross
    Signed-off-by: David Vrabel

    Juergen Gross
     
  • When converting a pfn to a physical address be sure to use 64 bit
    wide types or convert the physical address to a pfn if possible.

    Signed-off-by: Juergen Gross
    Tested-by: Boris Ostrovsky
    Signed-off-by: David Vrabel

    Juergen Gross
     
  • When allocating a new pmd for the linear mapped p2m list a check is
    done for not introducing another pmd when this just happened on
    another cpu. In this case the old pte pointer was returned which
    points to the p2m_missing or p2m_identity page. The correct value
    would be the pointer to the found new page.

    Signed-off-by: Juergen Gross
    Signed-off-by: David Vrabel

    Juergen Gross
     
  • In xen_rebuild_p2m_list() for large areas of invalid or identity
    mapped memory the pmd entries on 32 bit systems are initialized
    wrong. Correct this error.

    Suggested-by: Boris Ostrovsky
    Signed-off-by: Juergen Gross
    Signed-off-by: David Vrabel

    Juergen Gross
     
  • If uprobes are single stepped for example with gdb, the behavior should
    now be correct. Before this patch, when gdb was single stepping a uprobe,
    the result was a SIGILL.
    When PER is active for any storage alteration and a uprobe is hit, a storage
    alteration event is indicated. These over indications are filterd out by gdb,
    if no change has happened within the observed area.

    Signed-off-by: Jan Willeke
    Signed-off-by: Martin Schwidefsky

    Jan Willeke
     
  • Pull ARM fixes from Russell King:
    "Three small fixes from over the Christmas period, and wiring up the
    new execveat syscall for ARM"

    * 'fixes' of git://ftp.arm.linux.org.uk/~rmk/linux-arm:
    ARM: 8275/1: mm: fix PMD_SECT_RDONLY undeclared compile error
    ARM: 8253/1: mm: use phys_addr_t type in map_lowmem() for kernel mem region
    ARM: 8249/1: mm: dump: don't skip regions
    ARM: wire up execveat syscall

    Linus Torvalds
     
  • Pull x86 fixes from Ingo Molnar:
    "Misc fixes: two vdso fixes, two kbuild fixes and a boot failure fix
    with certain odd memory mappings"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, vdso: Use asm volatile in __getcpu
    x86/build: Clean auto-generated processor feature files
    x86: Fix mkcapflags.sh bash-ism
    x86: Fix step size adjustment during initial memory mapping
    x86_64, vdso: Fix the vdso address randomization algorithm

    Linus Torvalds
     
  • Pull perf fixes from Ingo Molnar:
    "Mostly tooling fixes, but also some kernel side fixes: uncore PMU
    driver fix, user regs sampling fix and an instruction decoder fix that
    unbreaks PEBS precise sampling"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/x86/uncore/hsw-ep: Handle systems with only two SBOXes
    perf/x86_64: Improve user regs sampling
    perf: Move task_pt_regs sampling into arch code
    x86: Fix off-by-one in instruction decoder
    perf hists browser: Fix segfault when showing callchain
    perf callchain: Free callchains when hist entries are deleted
    perf hists: Fix children sort key behavior
    perf diff: Fix to sort by baseline field by default
    perf list: Fix --raw-dump option
    perf probe: Fix crash in dwarf_getcfi_elf
    perf probe: Fix to fall back to find probe point in symbols
    perf callchain: Append callchains only when requested
    perf ui/tui: Print backtrace symbols when segfault occurs
    perf report: Show progress bar for output resorting

    Linus Torvalds
     

10 Jan, 2015

3 commits

  • Pull arm64 fixes from Will Deacon:
    "Here is a handful of minor arm64 fixes discovered and fixed over the
    Christmas break. The main part is adding some missing #includes that
    we seem to be getting transitively but have started causing problems
    in -next.

    - Fix early mapping fixmap corruption by EFI runtime services
    - Fix __NR_compat_syscalls off-by-one
    - Add missing sanity checks for some 32-bit registers
    - Add some missing #includes which we get transitively
    - Remove unused prepare_to_copy() macro"

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    arm64/efi: add missing call to early_ioremap_reset()
    arm64: fix missing asm/io.h include in kernel/smp_spin_table.c
    arm64: fix missing asm/alternative.h include in kernel/module.c
    arm64: fix missing linux/bug.h include in asm/arch_timer.h
    arm64: fix missing asm/pgtable-hwdef.h include in asm/processor.h
    arm64: sanity checks: add missing AArch32 registers
    arm64: Remove unused prepare_to_copy()
    arm64: Correct __NR_compat_syscalls for bpf

    Linus Torvalds
     
  • Merge misc fixes from Andrew Morton:
    "12 fixes"

    * emailed patches from Andrew Morton :
    mm, vmscan: prevent kswapd livelock due to pfmemalloc-throttled process being killed
    memcg: fix destination cgroup leak on task charges migration
    mm: memcontrol: switch soft limit default back to infinity
    mm/debug_pagealloc: remove obsolete Kconfig options
    vfs: renumber FMODE_NONOTIFY and add to uniqueness check
    arch/blackfin/mach-bf533/boards/stamp.c: add linux/delay.h
    ocfs2: fix the wrong directory passed to ocfs2_lookup_ino_from_name() when link file
    MAINTAINERS: update rydberg's addresses
    mm: protect set_page_dirty() from ongoing truncation
    mm: prevent endless growth of anon_vma hierarchy
    exit: fix race between wait_consider_task() and wait_task_zombie()
    ocfs2: remove bogus check in dlm_process_recovery_data

    Linus Torvalds
     
  • In v3.19-rc3 tree when CONFIG_ARM_LPAE and CONFIG_DEBUG_RODATA are enabled
    image failed to compile with the following error:

    arch/arm/mm/init.c:661:14: error: ‘PMD_SECT_RDONLY’ undeclared here (not in a function)

    It seems that '80d6b0c ARM: mm: allow text and rodata sections to be read-only'
    and 'ded9477 ARM: 8109/1: mm: Modify pte_write and pmd_write logic for LPAE'
    commits crossed. 80d6b0c uses PMD_SECT_RDONLY macro but ded9477 renames it
    and uses software bits L_PMD_SECT_RDONLY instead.

    Fix is to use L_PMD_SECT_RDONLY instead PMD_SECT_RDONLY as ded9477 does in
    another places.

    Signed-off-by: Victor Kamensky
    Acked-by: Will Deacon
    Signed-off-by: Russell King

    Victor Kamensky
     

09 Jan, 2015

9 commits

  • There was another report of a boot failure with a #GP fault in the
    uncore SBOX initialization. The earlier work around was not enough
    for this system.

    The boot was failing while trying to initialize the third SBOX.

    This patch detects parts with only two SBOXes and limits the number
    of SBOX units to two there.

    Stable material, as it affects boot problems on 3.18.

    Tested-by: Andreas Oehler
    Signed-off-by: Andi Kleen
    Signed-off-by: Peter Zijlstra (Intel)
    Cc:
    Cc: Arnaldo Carvalho de Melo
    Cc: Stephane Eranian
    Cc: Yan, Zheng
    Link: http://lkml.kernel.org/r/1420583675-9163-1-git-send-email-andi@firstfloor.org
    Signed-off-by: Ingo Molnar

    Andi Kleen
     
  • Perf reports user regs for kernel-mode samples so that samples can
    be backtraced through user code. The old code was very broken in
    syscall context, resulting in useless backtraces.

    The new code, in contrast, is still dangerously racy, but it should
    at least work most of the time.

    Tested-by: Jiri Olsa
    Signed-off-by: Andy Lutomirski
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Stephane Eranian
    Cc: Andrew Morton
    Cc: chenggang.qcg@taobao.com
    Cc: Wu Fengguang
    Cc: Namhyung Kim
    Cc: Mike Galbraith
    Cc: Arjan van de Ven
    Cc: David Ahern
    Cc: Linus Torvalds
    Link: http://lkml.kernel.org/r/243560c26ff0f739978e2459e203f6515367634d.1420396372.git.luto@amacapital.net
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     
  • On x86_64, at least, task_pt_regs may be only partially initialized
    in many contexts, so x86_64 should not use it without extra care
    from interrupt context, let alone NMI context.

    This will allow x86_64 to override the logic and will supply some
    scratch space to use to make a cleaner copy of user regs.

    Tested-by: Jiri Olsa
    Signed-off-by: Andy Lutomirski
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Stephane Eranian
    Cc: chenggang.qcg@taobao.com
    Cc: Wu Fengguang
    Cc: Namhyung Kim
    Cc: Mike Galbraith
    Cc: Arjan van de Ven
    Cc: David Ahern
    Cc: Arnaldo Carvalho de Melo
    Cc: Catalin Marinas
    Cc: Jean Pihet
    Cc: Linus Torvalds
    Cc: Mark Salter
    Cc: Russell King
    Cc: Will Deacon
    Cc: linux-arm-kernel@lists.infradead.org
    Link: http://lkml.kernel.org/r/e431cd4c18c2e1c44c774f10758527fb2d1025c4.1420396372.git.luto@amacapital.net
    Signed-off-by: Ingo Molnar

    Andy Lutomirski
     
  • Stephane reported that the PEBS fixup was broken by the recent commit to
    the instruction decoder. The thing had an off-by-one which resulted in
    not being able to decode the last instruction and always bail.

    Reported-by: Stephane Eranian
    Fixes: 6ba48ff46f76 ("x86: Remove arbitrary instruction size limit in instruction decoder")
    Signed-off-by: Peter Zijlstra (Intel)
    Cc: stable@vger.kernel.org # 3.18
    Cc:
    Cc: Jiri Olsa
    Cc: Liang Kan
    Cc: Arnaldo Carvalho de Melo
    Cc: Dave Hansen
    Cc: Jim Keniston
    Cc: Linus Torvalds
    Cc: Masami Hiramatsu
    Link: http://lkml.kernel.org/r/20141216104614.GV3337@twins.programming.kicks-ass.net
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Currently the signed COMPARE (cr) instruction is used to compare "A"
    with "X". This is not correct because "A" and "X" are both unsigned.
    To fix this use the unsigned COMPARE LOGICAL (clr) instruction instead.

    Signed-off-by: Michael Holzheu
    Signed-off-by: Martin Schwidefsky

    Michael Holzheu
     
  • Currently the LOAD NEGATIVE (lnr) instruction is used for ALU_NEG. This
    instruction always loads the negative value. Therefore, if A is already
    negative, it remains unchanged. To fix this use LOAD COMPLEMENT (lcr)
    instead.

    Signed-off-by: Michael Holzheu
    Signed-off-by: Martin Schwidefsky

    Michael Holzheu
     
  • build error

    arch/blackfin/mach-bf533/boards/stamp.c:834:2: error: implicit declaration of function 'mdelay'

    Signed-off-by: Oleg Nesterov
    Reported-by: Wu Fengguang
    Acked-by: Mike Frysinger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Pull power management and ACPI fixes from Rafael Wysocki:
    "These are an ACPI device power management initialization fix (-stable
    material), two commits renaming stuff in the ACPI processor driver to
    make it more suitable for ARM64 processors and a new ACPI backlight
    blacklist entry.

    Specifics:

    - Fix ACPI power management intialization for device objects
    corresponding to devices that are not present at the init time (the
    _STA control method returns 0 for them) and therefore should not be
    regarded as power manageable (Rafael J Wysocki).

    - Rename a structure field and two functions used by the ACPI
    processor driver to make them less tied to architectures that use
    APICs (both x86 and ia64) and more suitable for ARM64 processors
    (Hanjun Guo).

    - Add a disable_native_backlight quirk for Dell XPS15 L521X designed
    in an unusual way preventing native backlight from working on that
    machine (Hans de Goede)"

    * tag 'pm+acpi-3.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    ACPI / video: Add disable_native_backlight quirk for Dell XPS15 L521X
    ACPI / processor: Rename acpi_(un)map_lsapic() to acpi_(un)map_cpu()
    ACPI / processor: Convert apic_id to phys_id to make it arch agnostic
    ACPI / PM: Fix PM initialization for devices that are not present

    Linus Torvalds
     
  • Pull crypto fixes from Herbert Xu:
    "This fixes a build problem with sha-mb with old toolchains and an
    implementation bug in the ctr(aes)/by8 branch of aesni-intel that's
    enabled when AVX is available"

    * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
    crypto: sha-mb - Add avx2_supported check.
    crypto: aesni - fix "by8" variant for 128 bit keys

    Linus Torvalds
     

08 Jan, 2015

9 commits

  • In case kasprintf() fails in xen_setup_timer() we assign name to the
    static string "". We, however, don't check
    that fact before issuing kfree() in xen_teardown_timer(), kernel is
    supposed to crash with 'kernel BUG at mm/slub.c:3341!'

    Solve the issue by making name a fixed length string inside struct
    xen_clock_event_device. 16 bytes should be enough.

    Suggested-by: Laszlo Ersek
    Signed-off-by: Vitaly Kuznetsov
    Signed-off-by: David Vrabel

    Vitaly Kuznetsov
     
  • If the non-RAM regions in the e820 memory map are larger than the size
    of the initial balloon, a BUG was triggered as the frames are remaped
    beyond the limit of the linear p2m. The frames are remapped into the
    initial balloon area (xen_extra_mem) but not enough of this is
    available.

    Ensure enough extra memory regions are added for these remapped
    frames.

    Signed-off-by: David Vrabel
    Reviewed-by: Juergen Gross

    David Vrabel
     
  • This accounting is just used to print a diagnostic message that isn't
    very useful.

    Signed-off-by: David Vrabel
    Reviewed-by: Juergen Gross

    David Vrabel
     
  • With recent changes in p2m we now have legitimate cases when
    p2m memory needs to be freed during early boot (i.e. before
    slab is initialized).

    Signed-off-by: Boris Ostrovsky
    Reviewed-by: Juergen Gross
    Signed-off-by: David Vrabel

    Boris Ostrovsky
     
  • The early ioremap support introduced by patch bf4b558eba92
    ("arm64: add early_ioremap support") failed to add a call to
    early_ioremap_reset() at an appropriate time. Without this call,
    invocations of early_ioremap etc. that are done too late will go
    unnoticed and may cause corruption.

    This is exactly what happened when the first user of this feature
    was added in patch f84d02755f5a ("arm64: add EFI runtime services").
    The early mapping of the EFI memory map is unmapped during an early
    initcall, at which time the early ioremap support is long gone.

    Fix by adding the missing call to early_ioremap_reset() to
    setup_arch(), and move the offending early_memunmap() to right after
    the point where the early mapping of the EFI memory map is last used.

    Fixes: f84d02755f5a ("arm64: add EFI runtime services")
    Cc:
    Signed-off-by: Leif Lindholm
    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Will Deacon

    Ard Biesheuvel
     
  • pmd_to_page() is only available if USE_SPLIT_PMD_PTLOCKS is defined.
    The use of pmd_to_page in the gmap code can cause compile errors if
    NR_CPUS is smaller than SPLIT_PTLOCK_CPUS. Do not use pmd_to_page
    outside of USE_SPLIT_PMD_PTLOCKS sections.

    Reported-by: Mike Frysinger
    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     
  • Now local variables kernel_x_start and kernel_x_end defined using
    'unsigned long' type which is wrong because they represent physical
    memory range and will be calculated wrongly if LPAE is enabled.
    As result, all following code in map_lowmem() will not work correctly.

    For example, Keystone 2 boot is broken because
    kernel_x_start == 0x0000 0000
    kernel_x_end == 0x0080 0000

    instead of
    kernel_x_start == 0x0000 0008 0000 0000
    kernel_x_end == 0x0000 0008 0080 0000
    and as result whole low memory will be mapped with MT_MEMORY_RW
    permissions by code (start > kernel_x_end):
    } else if (start >= kernel_x_end) {
    map.pfn = __phys_to_pfn(start);
    map.virtual = __phys_to_virt(start);
    map.length = end - start;
    map.type = MT_MEMORY_RW;

    create_mapping(&map);
    }

    Hence, fix it by using phys_addr_t type for variables kernel_x_start
    and kernel_x_end.

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

    Grygorii Strashko
     
  • Currently the arm page table dumping code starts dumping page tables
    from USER_PGTABLES_CEILING. This is unnecessary for skipping any entries
    related to userspace as the swapper_pg_dir does not contain such
    entries, and results in a couple of unfortuante side effects.

    Firstly, any kernel mappings which might exist below
    USER_PGTABLES_CEILING will not be accounted in the dump output. This
    masks any entries erroneously created below this address.

    Secondly, if the final page table entry walked is part of a valid
    mapping the page table dumping code will not log the region this entry
    is part of, as the final note_page call in walk_pgd will trigger an
    early return when 0 < USER_PGTABLES_CEILING. Luckily this isn't seen on
    contemporary systems as they typically don't have enough RAM to extend
    the linear mapping right to the end of the address space.

    Due to the way addr is constructed in the walk_* functions, it can never
    be less than USER_PGTABLES_CEILING when walking the page tables, so it
    is not necessary to avoid dereferencing invalid table addresses. The
    existing checks for st->current_prot and st->marker[1].start_address are
    sufficient to ensure we will not print and/or dereference garbage when
    trying to log information.

    This patch removes both problematic uses of USER_PGTABLES_CEILING from
    the arm page table dumping code, preventing both of these issues. We
    will now report any low mappings, and the final note_page call will not
    return early, ensuring all regions are logged.

    Signed-off-by: Mark Rutland
    Cc: Steve Capper
    Cc: Kees Cook
    Cc: Will Deacon
    Signed-off-by: Russell King

    Mark Rutland
     
  • Signed-off-by: Russell King

    Russell King
     

07 Jan, 2015

1 commit

  • On next-20150105, defconfig compilation breaks with:

    arch/arm64/kernel/smp_spin_table.c:80:2: error: implicit declaration of function ‘ioremap_cache’ [-Werror=implicit-function-declaration]
    arch/arm64/kernel/smp_spin_table.c:92:2: error: implicit declaration of function ‘writeq_relaxed’ [-Werror=implicit-function-declaration]
    arch/arm64/kernel/smp_spin_table.c:101:2: error: implicit declaration of function ‘iounmap’ [-Werror=implicit-function-declaration]

    Fix by including asm/io.h, which contains definitions or prototypes
    for these macros or functions.

    This second version incorporates a comment from Mark Rutland
    to keep the includes in alphabetical order
    by filename.

    Signed-off-by: Paul Walmsley
    Cc: Paul Walmsley
    Cc: Catalin Marinas
    Cc: Will Deacon
    Acked-by: Mark Rutland
    Signed-off-by: Will Deacon

    Paul Walmsley