15 Mar, 2013

1 commit

  • We have CONFIG_SYMBOL_PREFIX, which three archs define to the string
    "_". But Al Viro broke this in "consolidate cond_syscall and
    SYSCALL_ALIAS declarations" (in linux-next), and he's not the first to
    do so.

    Using CONFIG_SYMBOL_PREFIX is awkward, since we usually just want to
    prefix it so something. So various places define helpers which are
    defined to nothing if CONFIG_SYMBOL_PREFIX isn't set:

    1) include/asm-generic/unistd.h defines __SYMBOL_PREFIX.
    2) include/asm-generic/vmlinux.lds.h defines VMLINUX_SYMBOL(sym)
    3) include/linux/export.h defines MODULE_SYMBOL_PREFIX.
    4) include/linux/kernel.h defines SYMBOL_PREFIX (which differs from #7)
    5) kernel/modsign_certificate.S defines ASM_SYMBOL(sym)
    6) scripts/modpost.c defines MODULE_SYMBOL_PREFIX
    7) scripts/Makefile.lib defines SYMBOL_PREFIX on the commandline if
    CONFIG_SYMBOL_PREFIX is set, so that we have a non-string version
    for pasting.

    (arch/h8300/include/asm/linkage.h defines SYMBOL_NAME(), too).

    Let's solve this properly:
    1) No more generic prefix, just CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX.
    2) Make linux/export.h usable from asm.
    3) Define VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR().
    4) Make everyone use them.

    Signed-off-by: Rusty Russell
    Reviewed-by: James Hogan
    Tested-by: James Hogan (metag)

    Rusty Russell
     

13 Mar, 2013

3 commits

  • In commit 887cbce0adea ("arch Kconfig: centralise ARCH_NO_VIRT_TO_BUS")
    I introduced the config sybmol HAVE_VIRT_TO_BUS and selected that where
    needed. I am not sure what I was thinking. Instead, just directly
    select VIRT_TO_BUS where it is needed.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     
  • Pull ARM SoC fixes from Arnd Bergmann:
    "These bug fixes are for the largest part for mvebu/kirkwood, which saw
    a few regressions after the clock infrastructure was enabled, and for
    OMAP, which showed a few more preexisting bugs with the new
    multiplatform support.

    Other small fixes are for imx, mxs, tegra, spear and socfpga"

    * tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (37 commits)
    ARM: spear3xx: Use correct pl080 header file
    Arm: socfpga: pl330: Add #dma-cells for generic dma binding support
    ARM: multiplatform: Sort the max gpio numbers.
    ARM: imx: fix typo "DEBUG_IMX50_IMX53_UART"
    ARM: imx: pll1_sys should be an initial on clk
    arm: mach-orion5x: fix typo in compatible string of a .dts file
    arm: mvebu: fix address-cells in mpic DT node
    arm: plat-orion: fix address decoding when > 4GB is used
    arm: mvebu: Reduce reg-io-width with UARTs
    ARM: Dove: add RTC device node
    arm: mvebu: enable the USB ports on Armada 370 Reference Design board
    ARM: dove: drop "select COMMON_CLK_DOVE"
    rtc: rtc-mv: Add support for clk to avoid lockups
    gpio: mvebu: Add clk support to prevent lockup
    ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels
    ARM: kirkwood: of_serial: fix clock gating by removing clock-frequency
    ARM: mxs: cfa10049: Fix fb initialisation function
    ARM: SPEAr13xx: Fix typo "ARCH_HAVE_CPUFREQ"
    ARM: OMAP: RX-51: add missing USB phy binding
    clk: Tegra: Remove duplicate smp_twd clock
    ...

    Linus Torvalds
     
  • Pull m68knommu fixes from Greg Ungerer:
    "It contains a few small fixes for the non-MMU m68k platforms. Fixes
    some compilation problems, some broken header definitions, removes an
    unused config option and adds a name for the old 68000 CPU support."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu:
    m68k: drop "select EMAC_INC"
    m68knommu: fix misnamed GPIO pin definition for ColdFire 528x CPU
    m68knommu: fix MC68328.h defines
    m68knommu: fix build when CPU is not coldfire
    m68knommu: add CPU_NAME for 68000

    Linus Torvalds
     

12 Mar, 2013

6 commits

  • The definitions have move around recently, causing build errors
    in spear3xx for all configurations:

    spear3xx.c:47:5: error: 'PL080_BSIZE_16' undeclared here (not in a function)
    spear3xx.c:47:23: error: 'PL080_CONTROL_SB_SIZE_SHIFT' undeclared here (not in a function)
    spear3xx.c:48:22: error: 'PL080_CONTROL_DB_SIZE_SHIFT' undeclared here (not in a function)

    Signed-off-by: Arnd Bergmann
    Cc: Alessandro Rubini
    Cc: Viresh Kumar

    Arnd Bergmann
     
  • This patch adds #dma-cells property to PL330 DMA controller nodes for
    supporting generic dma dt bindings on SOCFPGA platform. #dma-channels
    and #dma-requests are not required now but added in advance.

    Signed-off-by: Padmavathi Venna
    Signed-off-by: Arnd Bergmann

    Padmavathi Venna
     
  • mvebu fixes for v3.9 from Jason Cooper :

    The first four patches:

    89c58c1 rtc: rtc-mv: Add support for clk to avoid lockups
    de88747 gpio: mvebu: Add clk support to prevent lockup
    7bf5b40 ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels
    93fff4c ARM: kirkwood: of_serial: fix clock gating by removing clock-frequency

    are Cc'd to stable since they were held over from the previous merge window.

    The rest are a small collection of fixes and a couple of devicetree conversion
    catchups.

    * tag 'mvebu_fixes_for_v3.9' of git://git.infradead.org/users/jcooper/linux:
    arm: mach-orion5x: fix typo in compatible string of a .dts file
    arm: mvebu: fix address-cells in mpic DT node
    arm: plat-orion: fix address decoding when > 4GB is used
    arm: mvebu: Reduce reg-io-width with UARTs
    ARM: Dove: add RTC device node
    arm: mvebu: enable the USB ports on Armada 370 Reference Design board
    ARM: dove: drop "select COMMON_CLK_DOVE"
    rtc: rtc-mv: Add support for clk to avoid lockups
    gpio: mvebu: Add clk support to prevent lockup
    ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels
    ARM: kirkwood: of_serial: fix clock gating by removing clock-frequency

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     
  • From Shawn Guo :

    The 2nd take of imx fixes for 3.9:
    - Fix pll1_sys clk initial status
    - Fix a typo in imx DEBUG_LL Kconfig

    * tag 'imx-fixes-3.9-2' of git://git.linaro.org/people/shawnguo/linux-2.6:
    ARM: imx: fix typo "DEBUG_IMX50_IMX53_UART"
    ARM: imx: pll1_sys should be an initial on clk

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     
  • From Shawn Guo :

    The 2nd mxs fixes for 3.9:
    - Fix an error caused by incorrect conflict resolution when
    applying the patch

    * tag 'mxs-fixes-3.9-2' of git://git.linaro.org/people/shawnguo/linux-2.6:
    ARM: mxs: cfa10049: Fix fb initialisation function

    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     
  • When building a multiplatform kernel, we could end up with a smaller
    number of GPIOs than the one required by the platform the kernel was
    running on.

    Sort the max GPIO number by descending order so that we always take the
    highest number required.

    Signed-off-by: Maxime Ripard
    Signed-off-by: Arnd Bergmann

    Maxime Ripard
     

11 Mar, 2013

9 commits

  • Pull perf fixes from Ingo Molnar:
    "Misc minor fixes mostly related to tracing"

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    s390: Fix a header dependencies related build error
    tracing: update documentation of snapshot utility
    tracing: Do not return EINVAL in snapshot when not allocated
    tracing: Add help of snapshot feature when snapshot is empty
    ftrace: Update the kconfig for DYNAMIC_FTRACE

    Linus Torvalds
     
  • Commit f8c95fe (ARM: imx: support DEBUG_LL uart port selection for all
    i.MX SoCs) had a typo that DEBUG_IMX50_IMX53_UART should be
    DEBUG_IMX53_UART.

    Signed-off-by: Paul Bolle
    Signed-off-by: Shawn Guo

    Paul Bolle
     
  • Commit 877c685607925238e302cd3aa38788dca6c1b226
    ("perf: Remove include of cgroup.h from perf_event.h") caused
    this build failure if PERF_EVENTS is enabled:

    In file included from arch/s390/include/asm/perf_event.h:9:0,
    from include/linux/perf_event.h:24,
    from kernel/events/ring_buffer.c:12:
    arch/s390/include/asm/cpu_mf.h: In function 'qctri':
    arch/s390/include/asm/cpu_mf.h:61:12: error: 'EINVAL' undeclared (first use in this function)

    cpu_mf.h had an implicit errno.h dependency, which was added
    indirectly via cgroups.h but not anymore. Add it explicitly.

    Reported-by: Fengguang Wu
    Tested-by: Fengguang Wu
    Signed-off-by: Li Zefan
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Link: http://lkml.kernel.org/r/51385F79.7000106@huawei.com
    Signed-off-by: Ingo Molnar

    Li Zefan
     
  • The tty below tty_port might get destroyed by the tty layer
    while we hold a reference to it.
    So we have to carry tty_port around...

    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • As we setup the SIGWINCH handler in tty_port_operations->activate
    it makes sense to tear down it in ->destruct.

    Signed-off-by: Richard Weinberger

    Richard Weinberger
     
  • arch/um/os-Linux/signal.c:18:8: error: conflicting types for 'sig_info'
    In file included from /home/slyfox/linux-2.6/arch/um/os-Linux/signal.c:12:0:
    arch/um/include/shared/as-layout.h:64:15: note: previous declaration of 'sig_info' was here

    Signed-off-by: Sergei Trofimovich
    CC: Jeff Dike
    CC: Richard Weinberger
    CC: "Martin Pärtel"
    CC: Al Viro
    CC: user-mode-linux-devel@lists.sourceforge.net
    CC: user-mode-linux-user@lists.sourceforge.net
    CC: linux-kernel@vger.kernel.org
    Signed-off-by: Richard Weinberger

    Sergei Trofimovich
     
  • arch/um/os-Linux/start_up.c: In function 'check_coredump_limit':
    arch/um/os-Linux/start_up.c:338:16: error: storage size of 'lim' isn't known
    arch/um/os-Linux/start_up.c:339:2: error: implicit declaration of function 'getrlimit' [-Werror=implicit-function-declaration]

    Signed-off-by: Sergei Trofimovich
    CC: Jeff Dike
    CC: Richard Weinberger
    CC: Al Viro
    CC: user-mode-linux-devel@lists.sourceforge.net
    CC: user-mode-linux-user@lists.sourceforge.net
    CC: linux-kernel@vger.kernel.org
    Signed-off-by: Richard Weinberger

    Sergei Trofimovich
     
  • This new version moves the skb_tx_timestamp in the main uml
    driver. This should avoid the need to call this function in each
    transport (vde, slirp, tuntap, ...). It also add support for ethtool
    get_ts_info.

    Signed-off-by: Paul Chavent
    Acked-by: Richard Cochran
    Signed-off-by: Richard Weinberger

    Paul Chavent
     
  • We always boot from PLL1, so let's have pll1_sys in the clks_init_on
    list to have clk prepare/enable use count match the hardware status,
    so that drivers managing pll1_sys like cpufreq can get the use count
    right from the start.

    Reported-by: Dirk Behme
    Signed-off-by: Shawn Guo

    Shawn Guo
     

10 Mar, 2013

1 commit

  • Pull namespace bugfixes from Eric Biederman:
    "This is three simple fixes against 3.9-rc1. I have tested each of
    these fixes and verified they work correctly.

    The userns oops in key_change_session_keyring and the BUG_ON triggered
    by proc_ns_follow_link were found by Dave Jones.

    I am including the enhancement for mount to only trigger requests of
    filesystem modules here instead of delaying this for the 3.10 merge
    window because it is both trivial and the kind of change that tends to
    bit-rot if left untouched for two months."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
    proc: Use nd_jump_link in proc_ns_follow_link
    fs: Limit sys_mount to only request filesystem modules (Part 2).
    fs: Limit sys_mount to only request filesystem modules.
    userns: Stop oopsing in key_change_session_keyring

    Linus Torvalds
     

09 Mar, 2013

15 commits

  • Merge misc fixes from Andrew Morton.

    * emailed patches from Andrew Morton :
    alpha: boot: fix build breakage introduced by system.h disintegration
    memcg: initialize kmem-cache destroying work earlier
    Randy has moved
    ksm: fix m68k build: only NUMA needs pfn_to_nid
    dmi_scan: fix missing check for _DMI_ signature in smbios_present()
    Revert parts of "hlist: drop the node parameter from iterators"
    idr: remove WARN_ON_ONCE() on negative IDs
    mm/mempolicy.c: fix sp_node_init() argument ordering
    mm/mempolicy.c: fix wrong sp_node insertion
    ipc: don't allocate a copy larger than max
    ipc: fix potential oops when src msg > 4k w/ MSG_COPY

    Linus Torvalds
     
  • Commit ec2212088c42 ("Disintegrate asm/system.h for Alpha") removed the
    system.h include from boot/head.S, which puts the PAL_* asm constants
    out of scope.

    Include so we can get building again.

    Signed-off-by: Will Deacon
    Cc: David Rusling
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Will Deacon
     
  • Pull tile architecture fixes from Chris Metcalf:
    "This fixes the bug that Al Viro spotted with the compat llseek code.
    I also fixed the compat syscall definitions to use the new syscall
    define macros to properly sign-extend their arguments."

    * 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
    tile: properly use COMPAT_SYSCALL_DEFINEx
    tile: work around bug in the generic sys_llseek

    Linus Torvalds
     
  • Pull metag bugfixes from James Hogan:
    "A couple of fairly minor arch/metag integration fixes from v3.9-rc1:

    - remove SET_PERSONALITY(): use default definition like other arches
    now do.

    - inhibit NUMA balancing: like SH, NUMA is used for memories with
    different latencies. ARCH_WANT_VARIABLE_LOCALITY has been added
    for this purpose."

    * tag 'metag-for-v3.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag:
    metag: Inhibit NUMA balancing.
    metag: remove SET_PERSONALITY()

    Linus Torvalds
     
  • The orion5x-lacie-ethernet-disk-mini-v2.dts file was using
    "marvell-orion5x-88f5182" as a compatible string, while it should have
    been "marvell,orion5x-88f5182".

    Signed-off-by: Thomas Petazzoni
    Signed-off-by: Jason Cooper

    Thomas Petazzoni
     
  • There is no need to have a #address-cells property in the MPIC Device
    Tree node, and more than that, having it confuses the of_irq_map_raw()
    logic, which will be used by the Marvell PCIe driver.

    Signed-off-by: Thomas Petazzoni
    Signed-off-by: Jason Cooper

    Thomas Petazzoni
     
  • During the system initialization, the orion_setup_cpu_mbus_target()
    function reads the SDRAM address decoding registers to find out how
    many chip-selects of SDRAM have been enabled, and builds a small array
    with one entry per chip-select. This array is then used by device
    drivers (XOR, Ethernet, etc.) to configure their own address decoding
    windows to the SDRAM.

    However, devices can only access the first 32 bits of the physical
    memory. Even though LPAE is not supported for now, some Marvell boards
    are now showing up with 8 GB of RAM, configured using two SDRAM
    address decoding windows: the first covering the first 4 GB, the
    second covering the last 4 GB. The array built by
    orion_setup_cpu_mbus_target() has therefore two entries, and device
    drivers try to set up two address decoding windows to the
    SDRAM. However, in the device registers for the address decoding, the
    base address is only 32 bits, so those two windows overlap each other,
    and the devices do not work at all.

    This patch makes sure that the array built by
    orion_setup_cpu_mbus_target() only contains the SDRAM decoding windows
    that correspond to the first 4 GB of the memory. To do that, it
    ignores the SDRAM decoding windows for which the 4 low-order bits are
    not zero (the 4 low-order bits of the base register are used to store
    bits 32:35 of the base address, so they actually indicate whether the
    base address is above 4 GB).

    This patch allows the newly introduced armada-xp-gp board to properly
    operate when it is mounted with more than 4 GB of RAM. Without that,
    all devices doing DMA (for example XOR and Ethernet) do not work at
    all.

    Signed-off-by: Thomas Petazzoni
    Tested-by: Ezequiel Garcia
    Signed-off-by: Jason Cooper

    Thomas Petazzoni
     
  • Setting the reg-io-width to 1 byte represents more accurate
    description of the HW.

    This will fix an issue where UART driver causes kernel
    panic during bootup. Gregory CLEMENT traced the issue to
    autoconfig() in 8250.c, where the existence of FIFO is
    checked from UART_IIR register. The register is now read as
    32-bit value as the reg-io-width is set to 4-bytes. The
    retuned value seems to contain bogus data for bits 31:8,
    causing the issue.

    Signed-off-by: Heikki Krogerus
    Cc: Gregory CLEMENT
    Cc: Masami Hiramatsu
    Tested-by: Gregory CLEMENT
    Acked-by: Gregory CLEMENT
    Tested-by: Masami Hiramatsu
    Tested-by: Thomas Petazzoni
    Signed-off-by: Jason Cooper

    Heikki Krogerus
     
  • The commit:

    48be9ac ARM: Dove: split legacy and DT setup

    removed the RTC initialization. This patch re-enables the RTC
    via the DT.

    Signed-off-by: Jean-François Moine
    Signed-off-by: Jason Cooper

    Jean-Francois Moine
     
  • This patch modifies the Armada 370 Reference Design DTS file to enable
    support for the two USB ports found on this board.

    Signed-off-by: Florian Fainelli
    Signed-off-by: Jason Cooper

    Florian Fainelli
     
  • Commit 5b03df9ace680d7cdd34a69dfd85ca5f74159d18 ("ARM: dove: switch to
    DT clock providers") added "select COMMON_CLK_DOVE" to Marvell Dove's
    Kconfig entry. But there's no Kconfig symbol COMMON_CLK_DOVE, which
    makes this select statement a nop. It's probably a leftover of some
    experimental code that never hit mainline. Drop it.

    Signed-off-by: Paul Bolle
    Signed-off-by: Jason Cooper

    Paul Bolle
     
  • The Marvell RTC on Kirkwood makes use of the runit clock. Ensure the
    driver clk_prepare_enable() this clock, otherwise there is a danger
    the SoC will lockup when accessing RTC registers with the clock
    disabled.

    Reported-by: Simon Baatz
    Signed-off-by: Andrew Lunn
    Tested-by: Simon Baatz
    Cc:
    Signed-off-by: Jason Cooper

    Andrew Lunn
     
  • The kirkwood SoC GPIO cores use the runit clock. Add code to
    clk_prepare_enable() runit, otherwise there is a danger of locking up
    the SoC by accessing the GPIO registers when runit clock is not
    ticking.

    Reported-by: Simon Baatz
    Signed-off-by: Andrew Lunn
    Tested-by: Simon Baatz
    Acked-by: Linus Walleij
    Cc:
    Signed-off-by: Jason Cooper

    Andrew Lunn
     
  • The ethernet controller used on kirkwood looses its MAC address
    register contents when the corresponding clock is gated. As soon as
    mv643xx_eth is built as module, the clock gets gated and when loading
    the module, the MAC address is gone.

    Proper DT support for the mv643xx_eth driver is expected soon, so we add
    a workaround to always enable ge0/ge1 clocks on kirkwood. This workaround
    is also already used on non-DT kirkwood kernels.

    Reported-by: Simon Baatz
    Signed-off-by: Sebastian Hesselbarth
    Tested-by: Simon Baatz
    Cc:
    Signed-off-by: Jason Cooper

    Sebastian Hesselbarth
     
  • When DT support for kirkwood was first introduced, there was no clock
    infrastructure. As a result, we had to manually pass the
    clock-frequency to the driver from the device node.

    Unfortunately, on kirkwood, with minimal config or all module configs,
    clock-frequency breaks booting because of_serial doesn't consume the
    gate_clk when clock-frequency is defined.

    The end result on kirkwood is that runit gets gated, and then the boot
    fails when the kernel tries to write to the serial port.

    Fix the issue by removing the clock-frequency parameter from all
    kirkwood dts files.

    Booted on dreamplug without earlyprintk and successfully logged in via
    ttyS0.

    Reported-by: Simon Baatz
    Tested-by: Simon Baatz
    Cc:
    Signed-off-by: Jason Cooper

    Jason Cooper
     

08 Mar, 2013

4 commits

  • Pull x86 fixes from Peter Anvin:
    "Several boot fixes (MacBook, legacy EFI bootloaders), another
    please-don't-brick fix, and some minor stuff."

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86: Do not try to sync identity map for non-mapped pages
    x86, doc: Be explicit about what the x86 struct boot_params requires
    x86: Don't clear efi_info even if the sentinel hits
    x86, mm: Make sure to find a 2M free block for the first mapped area
    x86: Fix 32-bit *_cpu_data initializers
    efivarfs: return accurate error code in efivarfs_fill_super()
    efivars: efivarfs_valid_name() should handle pstore syntax
    efi: be more paranoid about available space when creating variables
    iommu, x86: Add DMA remap fault reason
    x86, smpboot: Remove unused variable

    Linus Torvalds
     
  • Pull ARM fixes from Russell King:
    "Mainly a group of fixes, the only exception is the wiring up of the
    kcmp syscall now that those patches went in during the last merge
    window."

    * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
    ARM: 7668/1: fix memset-related crashes caused by recent GCC (4.7.2) optimizations
    ARM: 7667/1: perf: Fix section mismatch on armpmu_init()
    ARM: 7666/1: decompressor: add -mno-single-pic-base for building the decompressor
    ARM: 7665/1: Wire up kcmp syscall
    ARM: 7664/1: perf: remove erroneous semicolon from event initialisation
    ARM: 7663/1: perf: fix ARMv7 EVTYPE_MASK to include NSH bit
    ARM: 7662/1: hw_breakpoint: reset debug logic on secondary CPUs in s2ram resume
    ARM: 7661/1: mm: perform explicit branch predictor maintenance when required
    ARM: 7660/1: tlb: add branch predictor maintenance operations
    ARM: 7659/1: mm: make mm->context.id an atomic64_t variable
    ARM: 7658/1: mm: fix race updating mm->context.id on ASID rollover
    ARM: 7657/1: head: fix swapper and idmap population with LPAE and big-endian
    ARM: 7655/1: smp_twd: make twd_local_timer_of_register() no-op for nosmp
    ARM: 7652/1: mm: fix missing use of 'asid' to get asid value from mm->context.id
    ARM: 7642/1: netx: bump IRQ offset to 64

    Linus Torvalds
     
  • kernel_map_sync_memtype() is called from a variety of contexts. The
    pat.c code that calls it seems to ensure that it is not called for
    non-ram areas by checking via pat_pagerange_is_ram(). It is important
    that it only be called on the actual identity map because there *IS*
    no map to sync for highmem pages, or for memory holes.

    The ioremap.c uses are not as careful as those from pat.c, and call
    kernel_map_sync_memtype() on PCI space which is in the middle of the
    kernel identity map _range_, but is not actually mapped.

    This patch adds a check to kernel_map_sync_memtype() which probably
    duplicates some of the checks already in pat.c. But, it is necessary
    for the ioremap.c uses and shouldn't hurt other callers.

    I have reproduced this bug and this patch fixes it for me and the
    original bug reporter:

    https://lkml.org/lkml/2013/2/5/396

    Signed-off-by: Dave Hansen
    Link: http://lkml.kernel.org/r/20130307163151.D9B58C4E@kernel.stglabs.ibm.com
    Signed-off-by: Dave Hansen
    Tested-by: Tetsuo Handa
    Signed-off-by: H. Peter Anvin

    Dave Hansen
     
  • Recent GCC versions (e.g. GCC-4.7.2) perform optimizations based on
    assumptions about the implementation of memset and similar functions.
    The current ARM optimized memset code does not return the value of
    its first argument, as is usually expected from standard implementations.

    For instance in the following function:

    void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waiter)
    {
    memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter));
    waiter->magic = waiter;
    INIT_LIST_HEAD(&waiter->list);
    }

    compiled as:

    800554d0 :
    800554d0: e92d4008 push {r3, lr}
    800554d4: e1a00001 mov r0, r1
    800554d8: e3a02010 mov r2, #16 ; 0x10
    800554dc: e3a01011 mov r1, #17 ; 0x11
    800554e0: eb04426e bl 80165ea0
    800554e4: e1a03000 mov r3, r0
    800554e8: e583000c str r0, [r3, #12]
    800554ec: e5830000 str r0, [r3]
    800554f0: e5830004 str r0, [r3, #4]
    800554f4: e8bd8008 pop {r3, pc}

    GCC assumes memset returns the value of pointer 'waiter' in register r0; causing
    register/memory corruptions.

    This patch fixes the return value of the assembly version of memset.
    It adds a 'mov' instruction and merges an additional load+store into
    existing load/store instructions.
    For ease of review, here is a breakdown of the patch into 4 simple steps:

    Step 1
    ======
    Perform the following substitutions:
    ip -> r8, then
    r0 -> ip,
    and insert 'mov ip, r0' as the first statement of the function.
    At this point, we have a memset() implementation returning the proper result,
    but corrupting r8 on some paths (the ones that were using ip).

    Step 2
    ======
    Make sure r8 is saved and restored when (! CALGN(1)+0) == 1:

    save r8:
    - str lr, [sp, #-4]!
    + stmfd sp!, {r8, lr}

    and restore r8 on both exit paths:
    - ldmeqfd sp!, {pc} @ Now
    Reviewed-by: Nicolas Pitre
    Signed-off-by: Dirk Behme
    Signed-off-by: Russell King

    Ivan Djelic
     

07 Mar, 2013

1 commit

  • If the sentinel triggers, we do not want the boot loader authors to
    just poke it and make the error go away, we want them to actually fix
    the problem.

    This should help avoid making the incorrect change in non-compliant
    bootloaders.

    [ hpa: dropped the Documentation/x86/boot.txt hunk pending
    clarifications ]

    Signed-off-by: Peter Jones
    Link: http://lkml.kernel.org/r/1362592823-28967-1-git-send-email-pjones@redhat.com
    Signed-off-by: H. Peter Anvin

    Peter Jones