18 May, 2017

3 commits

  • The ftrace function_graph time measurements of a given function is not
    accurate according to those recorded by ftrace using the function
    filters. This change pulls the x86_64 fix from 'commit 722b3c746953
    ("ftrace/graph: Trace function entry before updating index")' into the
    sparc specific prepare_ftrace_return which stops ftrace from
    counting interrupted tasks in the time measurement.

    Example measurements for select_task_rq_fair running "hackbench 100
    process 1000":

    | tracing/trace_stat/function0 | function_graph
    Before patch | 2.802 us | 4.255 us
    After patch | 2.749 us | 3.094 us

    Signed-off-by: Liam R. Howlett
    Signed-off-by: David S. Miller

    Liam R. Howlett
     
  • Greetings,

    GCC 7 introduced the -Wstringop-overflow flag to detect buffer overflows
    in calls to string handling functions [1][2]. Due to the way
    ``empty_zero_page'' is declared in arch/sparc/include/setup.h, this
    causes a warning to trigger at compile time in the function mem_init(),
    which is subsequently converted to an error. The ensuing patch fixes
    this issue and aligns the declaration of empty_zero_page to that of
    other architectures. Thank you.

    Cheers,
    Orlando.

    [1] https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02308.html
    [2] https://gcc.gnu.org/gcc-7/changes.html

    Signed-off-by: Orlando Arias

    --------------------------------------------------------------------------------
    Signed-off-by: David S. Miller

    Orlando Arias
     
  • An incorrect huge page alignment check caused
    mmap failure for 64K pages when MAP_FIXED is used
    with address not aligned to HPAGE_SIZE.

    Orabug: 25885991

    Fixes: dcd1912d21a0 ("sparc64: Add 64K page size support")
    Signed-off-by: Nitin Gupta
    Signed-off-by: David S. Miller

    Nitin Gupta
     

11 May, 2017

1 commit

  • …asahiroy/linux-kbuild

    Pull Kbuild UAPI updates from Masahiro Yamada:
    "Improvement of headers_install by Nicolas Dichtel.

    It has been long since the introduction of uapi directories, but the
    de-coupling of exported headers has not been completed. Headers listed
    in header-y are exported whether they exist in uapi directories or
    not. His work fixes this inconsistency.

    All (and only) headers under uapi directories are now exported. The
    asm-generic wrappers are still exceptions, but this is a big step
    forward"

    * tag 'kbuild-uapi-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
    arch/include: remove empty Kbuild files
    uapi: export all arch specifics directories
    uapi: export all headers under uapi directories
    smc_diag.h: fix include from userland
    btrfs_tree.h: fix include from userland
    uapi: includes linux/types.h before exporting files
    Makefile.headersinst: remove destination-y option
    Makefile.headersinst: cleanup input files
    x86: stop exporting msr-index.h to userland
    nios2: put setup.h in uapi
    h8300: put bitsperlong.h in uapi

    Linus Torvalds
     

10 May, 2017

4 commits

  • Regularly, when a new header is created in include/uapi/, the developer
    forgets to add it in the corresponding Kbuild file. This error is usually
    detected after the release is out.

    In fact, all headers under uapi directories should be exported, thus it's
    useless to have an exhaustive list.

    After this patch, the following files, which were not exported, are now
    exported (with make headers_install_all):
    asm-arc/kvm_para.h
    asm-arc/ucontext.h
    asm-blackfin/shmparam.h
    asm-blackfin/ucontext.h
    asm-c6x/shmparam.h
    asm-c6x/ucontext.h
    asm-cris/kvm_para.h
    asm-h8300/shmparam.h
    asm-h8300/ucontext.h
    asm-hexagon/shmparam.h
    asm-m32r/kvm_para.h
    asm-m68k/kvm_para.h
    asm-m68k/shmparam.h
    asm-metag/kvm_para.h
    asm-metag/shmparam.h
    asm-metag/ucontext.h
    asm-mips/hwcap.h
    asm-mips/reg.h
    asm-mips/ucontext.h
    asm-nios2/kvm_para.h
    asm-nios2/ucontext.h
    asm-openrisc/shmparam.h
    asm-parisc/kvm_para.h
    asm-powerpc/perf_regs.h
    asm-sh/kvm_para.h
    asm-sh/ucontext.h
    asm-tile/shmparam.h
    asm-unicore32/shmparam.h
    asm-unicore32/ucontext.h
    asm-x86/hwcap2.h
    asm-xtensa/kvm_para.h
    drm/armada_drm.h
    drm/etnaviv_drm.h
    drm/vgem_drm.h
    linux/aspeed-lpc-ctrl.h
    linux/auto_dev-ioctl.h
    linux/bcache.h
    linux/btrfs_tree.h
    linux/can/vxcan.h
    linux/cifs/cifs_mount.h
    linux/coresight-stm.h
    linux/cryptouser.h
    linux/fsmap.h
    linux/genwqe/genwqe_card.h
    linux/hash_info.h
    linux/kcm.h
    linux/kcov.h
    linux/kfd_ioctl.h
    linux/lightnvm.h
    linux/module.h
    linux/nbd-netlink.h
    linux/nilfs2_api.h
    linux/nilfs2_ondisk.h
    linux/nsfs.h
    linux/pr.h
    linux/qrtr.h
    linux/rpmsg.h
    linux/sched/types.h
    linux/sed-opal.h
    linux/smc.h
    linux/smc_diag.h
    linux/stm.h
    linux/switchtec_ioctl.h
    linux/vfio_ccw.h
    linux/wil6210_uapi.h
    rdma/bnxt_re-abi.h

    Note that I have removed from this list the files which are generated in every
    exported directories (like .install or .install.cmd).

    Thanks to Julien Floret for the tip to get all
    subdirs with a pure makefile command.

    For the record, note that exported files for asm directories are a mix of
    files listed by:
    - include/uapi/asm-generic/Kbuild.asm;
    - arch//include/uapi/asm/Kbuild;
    - arch//include/asm/Kbuild.

    Signed-off-by: Nicolas Dichtel
    Acked-by: Daniel Vetter
    Acked-by: Russell King
    Acked-by: Mark Salter
    Acked-by: Michael Ellerman (powerpc)
    Signed-off-by: Masahiro Yamada

    Nicolas Dichtel
     
  • Pull sparc updates from David Miller:
    "sparc changes, including a bug fix for handling exceptions during
    bzero on some sparc64 cpus"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
    sparc64: fix fault handling in NGbzero.S and GENbzero.S
    sparc: use memdup_user_nul in sun4m LED driver
    sparc: Remove redundant tests in boot_flags_init().

    Linus Torvalds
     
  • When any of the functions contained in NGbzero.S and GENbzero.S
    vector through *bzero_from_clear_user, we may end up taking a
    fault when executing one of the store alternate address space
    instructions. If this happens, the exception handler does not
    restore the %asi register.

    This commit fixes the issue by introducing a new exception
    handler that ensures the %asi register is restored when
    a fault is handled.

    Orabug: 25577560

    Signed-off-by: Dave Aldridge
    Reviewed-by: Rob Gardner
    Reviewed-by: Babu Moger
    Signed-off-by: David S. Miller

    Dave Aldridge
     
  • Use memdup_user_nul() helper instead of open-coding to simplify the code.

    Signed-off-by: Geliang Tang
    Signed-off-by: David S. Miller

    Geliang Tang
     

09 May, 2017

1 commit

  • Pull PCI updates from Bjorn Helgaas:

    - add framework for supporting PCIe devices in Endpoint mode (Kishon
    Vijay Abraham I)

    - use non-postable PCI config space mappings when possible (Lorenzo
    Pieralisi)

    - clean up and unify mmap of PCI BARs (David Woodhouse)

    - export and unify Function Level Reset support (Christoph Hellwig)

    - avoid FLR for Intel 82579 NICs (Sasha Neftin)

    - add pci_request_irq() and pci_free_irq() helpers (Christoph Hellwig)

    - short-circuit config access failures for disconnected devices (Keith
    Busch)

    - remove D3 sleep delay when possible (Adrian Hunter)

    - freeze PME scan before suspending devices (Lukas Wunner)

    - stop disabling MSI/MSI-X in pci_device_shutdown() (Prarit Bhargava)

    - disable boot interrupt quirk for ASUS M2N-LR (Stefan Assmann)

    - add arch-specific alignment control to improve device passthrough by
    avoiding multiple BARs in a page (Yongji Xie)

    - add sysfs sriov_drivers_autoprobe to control VF driver binding
    (Bodong Wang)

    - allow slots below PCI-to-PCIe "reverse bridges" (Bjorn Helgaas)

    - fix crashes when unbinding host controllers that don't support
    removal (Brian Norris)

    - add driver for MicroSemi Switchtec management interface (Logan
    Gunthorpe)

    - add driver for Faraday Technology FTPCI100 host bridge (Linus
    Walleij)

    - add i.MX7D support (Andrey Smirnov)

    - use generic MSI support for Aardvark (Thomas Petazzoni)

    - make Rockchip driver modular (Brian Norris)

    - advertise 128-byte Read Completion Boundary support for Rockchip
    (Shawn Lin)

    - advertise PCI_EXP_LNKSTA_SLC for Rockchip root port (Shawn Lin)

    - convert atomic_t to refcount_t in HV driver (Elena Reshetova)

    - add CPU IRQ affinity in HV driver (K. Y. Srinivasan)

    - fix PCI bus removal in HV driver (Long Li)

    - add support for ThunderX2 DMA alias topology (Jayachandran C)

    - add ThunderX pass2.x 2nd node MCFG quirk (Tomasz Nowicki)

    - add ITE 8893 bridge DMA alias quirk (Jarod Wilson)

    - restrict Cavium ACS quirk only to CN81xx/CN83xx/CN88xx devices
    (Manish Jaggi)

    * tag 'pci-v4.12-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (146 commits)
    PCI: Don't allow unbinding host controllers that aren't prepared
    ARM: DRA7: clockdomain: Change the CLKTRCTRL of CM_PCIE_CLKSTCTRL to SW_WKUP
    MAINTAINERS: Add PCI Endpoint maintainer
    Documentation: PCI: Add userguide for PCI endpoint test function
    tools: PCI: Add sample test script to invoke pcitest
    tools: PCI: Add a userspace tool to test PCI endpoint
    Documentation: misc-devices: Add Documentation for pci-endpoint-test driver
    misc: Add host side PCI driver for PCI test function device
    PCI: Add device IDs for DRA74x and DRA72x
    dt-bindings: PCI: dra7xx: Add DT bindings to enable unaligned access
    PCI: dwc: dra7xx: Workaround for errata id i870
    dt-bindings: PCI: dra7xx: Add DT bindings for PCI dra7xx EP mode
    PCI: dwc: dra7xx: Add EP mode support
    PCI: dwc: dra7xx: Facilitate wrapper and MSI interrupts to be enabled independently
    dt-bindings: PCI: Add DT bindings for PCI designware EP mode
    PCI: dwc: designware: Add EP mode support
    Documentation: PCI: Add binding documentation for pci-test endpoint function
    ixgbe: Use pcie_flr() instead of duplicating it
    IB/hfi1: Use pcie_flr() instead of duplicating it
    PCI: imx6: Fix spelling mistake: "contol" -> "control"
    ...

    Linus Torvalds
     

03 May, 2017

2 commits

  • The test:

    *commands && *commands == ' '

    is equivalent to:

    *commands == ' '

    Reported-by: David Binderman
    Signed-off-by: David S. Miller

    David S. Miller
     
  • Pull networking updates from David Millar:
    "Here are some highlights from the 2065 networking commits that
    happened this development cycle:

    1) XDP support for IXGBE (John Fastabend) and thunderx (Sunil Kowuri)

    2) Add a generic XDP driver, so that anyone can test XDP even if they
    lack a networking device whose driver has explicit XDP support
    (me).

    3) Sparc64 now has an eBPF JIT too (me)

    4) Add a BPF program testing framework via BPF_PROG_TEST_RUN (Alexei
    Starovoitov)

    5) Make netfitler network namespace teardown less expensive (Florian
    Westphal)

    6) Add symmetric hashing support to nft_hash (Laura Garcia Liebana)

    7) Implement NAPI and GRO in netvsc driver (Stephen Hemminger)

    8) Support TC flower offload statistics in mlxsw (Arkadi Sharshevsky)

    9) Multiqueue support in stmmac driver (Joao Pinto)

    10) Remove TCP timewait recycling, it never really could possibly work
    well in the real world and timestamp randomization really zaps any
    hint of usability this feature had (Soheil Hassas Yeganeh)

    11) Support level3 vs level4 ECMP route hashing in ipv4 (Nikolay
    Aleksandrov)

    12) Add socket busy poll support to epoll (Sridhar Samudrala)

    13) Netlink extended ACK support (Johannes Berg, Pablo Neira Ayuso,
    and several others)

    14) IPSEC hw offload infrastructure (Steffen Klassert)"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (2065 commits)
    tipc: refactor function tipc_sk_recv_stream()
    tipc: refactor function tipc_sk_recvmsg()
    net: thunderx: Optimize page recycling for XDP
    net: thunderx: Support for XDP header adjustment
    net: thunderx: Add support for XDP_TX
    net: thunderx: Add support for XDP_DROP
    net: thunderx: Add basic XDP support
    net: thunderx: Cleanup receive buffer allocation
    net: thunderx: Optimize CQE_TX handling
    net: thunderx: Optimize RBDR descriptor handling
    net: thunderx: Support for page recycling
    ipx: call ipxitf_put() in ioctl error path
    net: sched: add helpers to handle extended actions
    qed*: Fix issues in the ptp filter config implementation.
    qede: Fix concurrency issue in PTP Tx path processing.
    stmmac: Add support for SIMATIC IOT2000 platform
    net: hns: fix ethtool_get_strings overflow in hns driver
    tcp: fix wraparound issue in tcp_lp
    bpf, arm64: fix jit branch offset related to ldimm64
    bpf, arm64: implement jiting of BPF_XADD
    ...

    Linus Torvalds
     

02 May, 2017

4 commits

  • Like other JITs, sparc64 maintains an array of instruction offsets but
    stores the entries off by one. This is done because jumps to the
    exit block are indexed to one past the last BPF instruction.

    So if we size the array by the program length, we need to record
    the previous instruction in order to stay within the array bounds.

    This is explained in ARM JIT commit 8eee539ddea0 ("arm64: bpf: fix
    out-of-bounds read in bpf2a64_offset()").

    But this scheme requires a little bit of careful handling when
    the instruction before the branch destination is a 64-bit load
    immediate. It takes up 2 BPF instruction slots.

    Therefore, we have to fill in the array entry for the second
    half of the 64-bit load immediate instruction rather than for
    the one for the beginning of that instruction.

    Fixes: 7a12b5031c6b ("sparc64: Add eBPF JIT.")
    Signed-off-by: David S. Miller

    David S. Miller
     
  • Pull scheduler updates from Ingo Molnar:
    "The main changes in this cycle were:

    - another round of rq-clock handling debugging, robustization and
    fixes

    - PELT accounting improvements

    - CPU hotplug related ->cpus_allowed affinity handling fixes all
    around the tree

    - ... plus misc fixes, cleanups and updates"

    * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (35 commits)
    sched/x86: Update reschedule warning text
    crypto: N2 - Replace racy task affinity logic
    cpufreq/sparc-us2e: Replace racy task affinity logic
    cpufreq/sparc-us3: Replace racy task affinity logic
    cpufreq/sh: Replace racy task affinity logic
    cpufreq/ia64: Replace racy task affinity logic
    ACPI/processor: Replace racy task affinity logic
    ACPI/processor: Fix error handling in __acpi_processor_start()
    sparc/sysfs: Replace racy task affinity logic
    powerpc/smp: Replace open coded task affinity logic
    ia64/sn/hwperf: Replace racy task affinity logic
    ia64/salinfo: Replace racy task affinity logic
    workqueue: Provide work_on_cpu_safe()
    ia64/topology: Remove cpus_allowed manipulation
    sched/fair: Move the PELT constants into a generated header
    sched/fair: Increase PELT accuracy for small tasks
    sched/fair: Fix comments
    sched/Documentation: Add 'sched-pelt' tool
    sched/fair: Fix corner case in __accumulate_sum()
    sched/core: Remove 'task' parameter and rename tsk_restore_flags() to current_restore_flags()
    ...

    Linus Torvalds
     
  • Pull timer updates from Thomas Gleixner:
    "The timer departement delivers:

    - more year 2038 rework

    - a massive rework of the arm achitected timer

    - preparatory patches to allow NTP correction of clock event devices
    to avoid early expiry

    - the usual pile of fixes and enhancements all over the place"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (91 commits)
    timer/sysclt: Restrict timer migration sysctl values to 0 and 1
    arm64/arch_timer: Mark errata handlers as __maybe_unused
    Clocksource/mips-gic: Remove redundant non devicetree init
    MIPS/Malta: Probe gic-timer via devicetree
    clocksource: Use GENMASK_ULL in definition of CLOCKSOURCE_MASK
    acpi/arm64: Add SBSA Generic Watchdog support in GTDT driver
    clocksource: arm_arch_timer: add GTDT support for memory-mapped timer
    acpi/arm64: Add memory-mapped timer support in GTDT driver
    clocksource: arm_arch_timer: simplify ACPI support code.
    acpi/arm64: Add GTDT table parse driver
    clocksource: arm_arch_timer: split MMIO timer probing.
    clocksource: arm_arch_timer: add structs to describe MMIO timer
    clocksource: arm_arch_timer: move arch_timer_needs_of_probing into DT init call
    clocksource: arm_arch_timer: refactor arch_timer_needs_probing
    clocksource: arm_arch_timer: split dt-only rate handling
    x86/uv/time: Set ->min_delta_ticks and ->max_delta_ticks
    unicore32/time: Set ->min_delta_ticks and ->max_delta_ticks
    um/time: Set ->min_delta_ticks and ->max_delta_ticks
    tile/time: Set ->min_delta_ticks and ->max_delta_ticks
    score/time: Set ->min_delta_ticks and ->max_delta_ticks
    ...

    Linus Torvalds
     
  • Pull uaccess unification updates from Al Viro:
    "This is the uaccess unification pile. It's _not_ the end of uaccess
    work, but the next batch of that will go into the next cycle. This one
    mostly takes copy_from_user() and friends out of arch/* and gets the
    zero-padding behaviour in sync for all architectures.

    Dealing with the nocache/writethrough mess is for the next cycle;
    fortunately, that's x86-only. Same for cleanups in iov_iter.c (I am
    sold on access_ok() in there, BTW; just not in this pile), same for
    reducing __copy_... callsites, strn*... stuff, etc. - there will be a
    pile about as large as this one in the next merge window.

    This one sat in -next for weeks. -3KLoC"

    * 'work.uaccess' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (96 commits)
    HAVE_ARCH_HARDENED_USERCOPY is unconditional now
    CONFIG_ARCH_HAS_RAW_COPY_USER is unconditional now
    m32r: switch to RAW_COPY_USER
    hexagon: switch to RAW_COPY_USER
    microblaze: switch to RAW_COPY_USER
    get rid of padding, switch to RAW_COPY_USER
    ia64: get rid of copy_in_user()
    ia64: sanitize __access_ok()
    ia64: get rid of 'segment' argument of __do_{get,put}_user()
    ia64: get rid of 'segment' argument of __{get,put}_user_check()
    ia64: add extable.h
    powerpc: get rid of zeroing, switch to RAW_COPY_USER
    esas2r: don't open-code memdup_user()
    alpha: fix stack smashing in old_adjtimex(2)
    don't open-code kernel_setsockopt()
    mips: switch to RAW_COPY_USER
    mips: get rid of tail-zeroing in primitives
    mips: make copy_from_user() zero tail explicitly
    mips: clean and reorder the forest of macros...
    mips: consolidate __invoke_... wrappers
    ...

    Linus Torvalds
     

27 Apr, 2017

4 commits


25 Apr, 2017

2 commits

  • Doing a full 64-bit decomposition is really stupid especially for
    simple values like 0 and -1.

    But if we are going to optimize this, go all the way and try for all 2
    and 3 instruction sequences not requiring a temporary register as
    well.

    First we do the easy cases where it's a zero or sign extended 32-bit
    number (sethi+or, sethi+xor, respectively).

    Then we try to find a range of set bits we can load simply then shift
    up into place, in various ways.

    Then we try negating the constant and see if we can do a simple
    sequence using that with a xor at the end. (f.e. the range of set
    bits can't be loaded simply, but for the negated value it can)

    The final optimized strategy involves 4 instructions sequences not
    needing a temporary register.

    Otherwise we sadly fully decompose using a temp..

    Example, from ALU64_XOR_K: 0x0000ffffffff0000 ^ 0x0 = 0x0000ffffffff0000:

    0000000000000000 :
    0: 9d e3 bf 50 save %sp, -176, %sp
    4: 01 00 00 00 nop
    8: 90 10 00 18 mov %i0, %o0
    c: 13 3f ff ff sethi %hi(0xfffffc00), %o1
    10: 92 12 63 ff or %o1, 0x3ff, %o1 ! ffffffff
    14: 93 2a 70 10 sllx %o1, 0x10, %o1
    18: 15 3f ff ff sethi %hi(0xfffffc00), %o2
    1c: 94 12 a3 ff or %o2, 0x3ff, %o2 ! ffffffff
    20: 95 2a b0 10 sllx %o2, 0x10, %o2
    24: 92 1a 60 00 xor %o1, 0, %o1
    28: 12 e2 40 8a cxbe %o1, %o2, 38
    2c: 9a 10 20 02 mov 2, %o5
    30: 10 60 00 03 b,pn %xcc, 3c
    34: 01 00 00 00 nop
    38: 9a 10 20 01 mov 1, %o5 ! 1
    3c: 81 c7 e0 08 ret
    40: 91 eb 40 00 restore %o5, %g0, %o0

    Signed-off-by: David S. Miller

    David S. Miller
     
  • cbcond combines a compare with a branch into a single instruction.

    The limitations are:

    1) Only newer chips support it

    2) For immediate compares we are limited to 5-bit signed immediate
    values

    3) The branch displacement is limited to 10-bit signed

    4) We cannot use it for JSET

    Also, cbcond (unlike all other sparc control transfers) lacks a delay
    slot.

    Currently we don't have a useful instruction we can push into the
    delay slot of normal branches. So using cbcond pretty much always
    increases code density, and is therefore a win.

    Signed-off-by: David S. Miller

    David S. Miller
     

24 Apr, 2017

2 commits


23 Apr, 2017

2 commits


20 Apr, 2017

2 commits


19 Apr, 2017

4 commits

  • Make sure the start adderess is aligned to PMD_SIZE
    boundary when freeing page table backing a hugepage
    region. The issue was causing segfaults when a region
    backed by 64K pages was unmapped since such a region
    is in general not PMD_SIZE aligned.

    Signed-off-by: Nitin Gupta
    Signed-off-by: David S. Miller

    Nitin Gupta
     
  • CONFIG_PROVE_LOCKING_SMALL shrinks the memory usage of lockdep so the
    kernel text, data, and bss fit in the required 32MB limit, but this
    option is not set for every config that enables lockdep.

    A 4.10 kernel fails to boot with the console output

    Kernel: Using 8 locked TLB entries for main kernel image.
    hypervisor_tlb_lock[2000000:0:8000000071c007c3:1]: errors with f
    Program terminated

    with these config options

    CONFIG_LOCKDEP=y
    CONFIG_LOCK_STAT=y
    CONFIG_PROVE_LOCKING=n

    To fix, rename CONFIG_PROVE_LOCKING_SMALL to CONFIG_LOCKDEP_SMALL, and
    enable this option with CONFIG_LOCKDEP=y so we get the reduced memory
    usage every time lockdep is turned on.

    Tested that CONFIG_LOCKDEP_SMALL is set to 'y' if and only if
    CONFIG_LOCKDEP is set to 'y'. When other lockdep-related config options
    that select CONFIG_LOCKDEP are enabled (e.g. CONFIG_LOCK_STAT or
    CONFIG_PROVE_LOCKING), verified that CONFIG_LOCKDEP_SMALL is also
    enabled.

    Fixes: e6b5f1be7afe ("config: Adding the new config parameter CONFIG_PROVE_LOCKING_SMALL for sparc")
    Signed-off-by: Daniel Jordan
    Reviewed-by: Babu Moger
    Signed-off-by: David S. Miller

    Daniel Jordan
     
  • This is relatively esoteric, and knowing that we don't have it makes life
    easier in some cases rather than just an eventual -EINVAL from
    pci_mmap_page_range().

    Signed-off-by: David Woodhouse
    Signed-off-by: Bjorn Helgaas

    David Woodhouse
     
  • We can declare it even on platforms where it isn't going to
    be defined. There's no need to have it littered through the various
    files.

    Signed-off-by: David Woodhouse
    Signed-off-by: Bjorn Helgaas

    David Woodhouse
     

16 Apr, 2017

1 commit


15 Apr, 2017

2 commits

  • The mmustat_enable sysfs file accessor functions must run code on the
    target CPU. This is achieved by temporarily setting the affinity of the
    calling user space thread to the requested CPU and reset it to the original
    affinity afterwards.

    That's racy vs. concurrent affinity settings for that thread resulting in
    code executing on the wrong CPU and overwriting the new affinity setting.

    Replace it by using work_on_cpu() which guarantees to run the code on the
    requested CPU.

    Protection against CPU hotplug is not required as the open sysfs file
    already prevents the removal from the CPU offline callback. Using the
    hotplug protected version would actually be wrong because it would deadlock
    against a CPU hotplug operation of the CPU associated to the sysfs file in
    progress.

    Signed-off-by: Thomas Gleixner
    Acked-by: David S. Miller
    Cc: fenghua.yu@intel.com
    Cc: tony.luck@intel.com
    Cc: herbert@gondor.apana.org.au
    Cc: rjw@rjwysocki.net
    Cc: peterz@infradead.org
    Cc: benh@kernel.crashing.org
    Cc: bigeasy@linutronix.de
    Cc: jiangshanlai@gmail.com
    Cc: sparclinux@vger.kernel.org
    Cc: viresh.kumar@linaro.org
    Cc: mpe@ellerman.id.au
    Cc: tj@kernel.org
    Cc: lenb@kernel.org
    Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1704131001270.2408@nanos
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     
  • In preparation for making the clockevents core NTP correction aware,
    all clockevent device drivers must set ->min_delta_ticks and
    ->max_delta_ticks rather than ->min_delta_ns and ->max_delta_ns: a
    clockevent device's rate is going to change dynamically and thus, the
    ratio of ns to ticks ceases to stay invariant.

    Make the sparc arch's clockevent drivers initialize these fields properly.

    This patch alone doesn't introduce any change in functionality as the
    clockevents core still looks exclusively at the (untouched) ->min_delta_ns
    and ->max_delta_ns. As soon as this has changed, a followup patch will
    purge the initialization of ->min_delta_ns and ->max_delta_ns from these
    drivers.

    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: Daniel Lezcano
    Cc: Richard Cochran
    Cc: Prarit Bhargava
    Cc: Stephen Boyd
    Cc: "David S. Miller"
    Cc: sparclinux@vger.kernel.org
    Acked-by: David S. Miller
    Signed-off-by: Nicolai Stange
    Signed-off-by: John Stultz

    Nicolai Stange
     

08 Apr, 2017

2 commits

  • Introduce a new getsockopt operation to retrieve the socket cookie
    for a specific socket based on the socket fd. It returns a unique
    non-decreasing cookie for each socket.
    Tested: https://android-review.googlesource.com/#/c/358163/

    Acked-by: Willem de Bruijn
    Signed-off-by: Chenbo Feng
    Signed-off-by: David S. Miller

    Chenbo Feng
     
  • Pull sparc fixes from David Miller:
    "Several fixes here, mostly having to due with either build errors or
    memory corruptions depending upon whether you have THP enabled or not"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
    sparc: remove unused wp_works_ok macro
    sparc32: Export vac_cache_size to fix build error
    sparc64: Fix memory corruption when THP is enabled
    sparc64: Fix kernel panic due to erroneous #ifdef surrounding pmd_write()
    arch/sparc: Avoid DCTI Couples
    sparc64: kern_addr_valid regression
    sparc64: Add support for 2G hugepages
    sparc64: Fix size check in huge_pte_alloc

    Linus Torvalds
     

07 Apr, 2017

4 commits

  • It's unused for ages, used to be required for ksyms.c back in the v1.1
    times.

    Signed-off-by: Mathias Krause
    Acked-by: David S. Miller
    Signed-off-by: David S. Miller

    Mathias Krause
     
  • sparc32:allmodconfig fails to build with the following error.

    ERROR: "vac_cache_size" [drivers/infiniband/sw/rxe/rdma_rxe.ko] undefined!

    Fixes: cb8864559631 ("infiniband: Fix alignment of mmap cookies ...")
    Cc: Jason Gunthorpe
    Cc: Doug Ledford
    Signed-off-by: Guenter Roeck
    Signed-off-by: David S. Miller

    Guenter Roeck
     
  • The memory corruption was happening due to incorrect
    TLB/TSB flushing of hugepages.

    Reported-by: David S. Miller
    Signed-off-by: Nitin Gupta
    Signed-off-by: David S. Miller

    Nitin Gupta
     
  • This commit moves sparc64's prototype of pmd_write() outside
    of the CONFIG_TRANSPARENT_HUGEPAGE ifdef.

    In 2013, commit a7b9403f0e6d ("sparc64: Encode huge PMDs using PTE
    encoding.") exposed a path where pmd_write() could be called without
    CONFIG_TRANSPARENT_HUGEPAGE defined. This can result in the panic below.

    The diff is awkward to read, but the changes are straightforward.
    pmd_write() was moved outside of #ifdef CONFIG_TRANSPARENT_HUGEPAGE.
    Also, __HAVE_ARCH_PMD_WRITE was defined.

    kernel BUG at include/asm-generic/pgtable.h:576!
    \|/ ____ \|/
    "@'/ .. \`@"
    /_| \__/ |_\
    \__U_/
    oracle_8114_cdb(8114): Kernel bad sw trap 5 [#1]
    CPU: 120 PID: 8114 Comm: oracle_8114_cdb Not tainted
    4.1.12-61.7.1.el6uek.rc1.sparc64 #1
    task: fff8400700a24d60 ti: fff8400700bc4000 task.ti: fff8400700bc4000
    TSTATE: 0000004411e01607 TPC: 00000000004609f8 TNPC: 00000000004609fc Y:
    00000005 Not tainted
    TPC:
    g0: 000000000001c000 g1: 0000000000ef3954 g2: 0000000000000000 g3: 0000000000000001
    g4: fff8400700a24d60 g5: fff8001fa5c10000 g6: fff8400700bc4000 g7: 0000000000000720
    o0: 0000000000bc5058 o1: 0000000000000240 o2: 0000000000006000 o3: 0000000000001c00
    o4: 0000000000000000 o5: 0000048000080000 sp: fff8400700bc6ab1 ret_pc: 00000000004609f0
    RPC:
    l0: fff8400700bc74fc l1: 0000000000020000 l2: 0000000000002000 l3: 0000000000000000
    l4: fff8001f93250950 l5: 000000000113f800 l6: 0000000000000004 l7: 0000000000000000
    i0: fff8400700ca46a0 i1: bd0000085e800453 i2: 000000026a0c4000 i3: 000000026a0c6000
    i4: 0000000000000001 i5: fff800070c958de8 i6: fff8400700bc6b61 i7: 0000000000460dd0
    I7:
    Call Trace:
    [0000000000460dd0] gup_pud_range+0x170/0x1a0
    [0000000000460e84] get_user_pages_fast+0x84/0x120
    [00000000006f5a18] iov_iter_get_pages+0x98/0x240
    [00000000005fa744] do_direct_IO+0xf64/0x1e00
    [00000000005fbbc0] __blockdev_direct_IO+0x360/0x15a0
    [00000000101f74fc] ext4_ind_direct_IO+0xdc/0x400 [ext4]
    [00000000101af690] ext4_ext_direct_IO+0x1d0/0x2c0 [ext4]
    [00000000101af86c] ext4_direct_IO+0xec/0x220 [ext4]
    [0000000000553bd4] generic_file_read_iter+0x114/0x140
    [00000000005bdc2c] __vfs_read+0xac/0x100
    [00000000005bf254] vfs_read+0x54/0x100
    [00000000005bf368] SyS_pread64+0x68/0x80

    Signed-off-by: Tom Hromatka
    Signed-off-by: David S. Miller

    Tom Hromatka