12 Oct, 2016

1 commit

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

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

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

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

    Linus Torvalds
     

08 Oct, 2016

1 commit

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

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

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

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

    Chris Metcalf
     

28 Sep, 2016

2 commits


14 Sep, 2016

1 commit

  • It should check access_ok(). Otherwise a bunch of places turn into
    trivially exploitable rootholes.

    Cc: stable@vger.kernel.org
    Signed-off-by: Al Viro

    Al Viro
     

05 Aug, 2016

1 commit

  • Pull RTC updates from Alexandre Belloni:
    "RTC for 4.8

    Cleanups:
    - huge cleanup of rtc-generic and char/genrtc this allowed to cleanup
    rtc-cmos, rtc-sh, rtc-m68k, rtc-powerpc and rtc-parisc
    - move mn10300 to rtc-cmos

    Subsystem:
    - fix wakealarms after hibernate
    - multiples fixes for rctest
    - simplify implementations of .read_alarm

    New drivers:
    - Maxim MAX6916

    Drivers:
    - ds1307: fix weekday
    - m41t80: add wakeup support
    - pcf85063: add support for PCF85063A variant
    - rv8803: extend i2c fix and other fixes
    - s35390a: fix alarm reading, this fixes instant reboot after
    shutdown for QNAP TS-41x
    - s3c: clock fixes"

    * tag 'rtc-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (65 commits)
    rtc: rv8803: Clear V1F when setting the time
    rtc: rv8803: Stop the clock while setting the time
    rtc: rv8803: Always apply the I²C workaround
    rtc: rv8803: Fix read day of week
    rtc: rv8803: Remove the check for valid time
    rtc: rv8803: Kconfig: Indicate rx8900 support
    rtc: asm9260: remove .owner field for driver
    rtc: at91sam9: Fix missing spin_lock_init()
    rtc: m41t80: add suspend handlers for alarm IRQ
    rtc: m41t80: make it a real error message
    rtc: pcf85063: Add support for the PCF85063A device
    rtc: pcf85063: fix year range
    rtc: hym8563: in .read_alarm set .tm_sec to 0 to signal minute accuracy
    rtc: explicitly set tm_sec = 0 for drivers with minute accurancy
    rtc: s3c: Add s3c_rtc_{enable/disable}_clk in s3c_rtc_setfreq()
    rtc: s3c: Remove unnecessary call to disable already disabled clock
    rtc: abx80x: use devm_add_action_or_reset()
    rtc: m41t80: use devm_add_action_or_reset()
    rtc: fix a typo and reduce three empty lines to one
    rtc: s35390a: improve two comments in .set_alarm
    ...

    Linus Torvalds
     

04 Aug, 2016

1 commit

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

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

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

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

    virtual patch
    virtual context

    @r@
    identifier f, attrs;

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

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

    and

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

    @r@
    identifier f, attrs;
    type t;

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

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

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

    Krzysztof Kozlowski
     

27 Jul, 2016

1 commit


26 Jul, 2016

1 commit

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

    The main changes are:

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

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

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

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

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

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

    - optimize mutex_trylock() fastpath (Peter Zijlstra)

    - ... misc fixes and cleanups"

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

    Linus Torvalds
     

04 Jul, 2016

1 commit


25 Jun, 2016

2 commits

  • STD_COM_FLAGS needs not be defined as it is not used anywhere on frv.

    SERIAL_PORT_DFNS is defined to be empty. 8250 is aware of empty
    SERIAL_PORT_DFNS and does:
    #ifndef SERIAL_PORT_DFNS
    #define SERIAL_PORT_DFNS
    #endif

    So no need to define it on frv.

    Signed-off-by: Jiri Slaby
    Cc: David Howells
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • This is the third version of the patchset previously sent [1]. I have
    basically only rebased it on top of 4.7-rc1 tree and dropped "dm: get
    rid of superfluous gfp flags" which went through dm tree. I am sending
    it now because it is tree wide and chances for conflicts are reduced
    considerably when we want to target rc2. I plan to send the next step
    and rename the flag and move to a better semantic later during this
    release cycle so we will have a new semantic ready for 4.8 merge window
    hopefully.

    Motivation:

    While working on something unrelated I've checked the current usage of
    __GFP_REPEAT in the tree. It seems that a majority of the usage is and
    always has been bogus because __GFP_REPEAT has always been about costly
    high order allocations while we are using it for order-0 or very small
    orders very often. It seems that a big pile of them is just a
    copy&paste when a code has been adopted from one arch to another.

    I think it makes some sense to get rid of them because they are just
    making the semantic more unclear. Please note that GFP_REPEAT is
    documented as

    * __GFP_REPEAT: Try hard to allocate the memory, but the allocation attempt

    * _might_ fail. This depends upon the particular VM implementation.
    while !costly requests have basically nofail semantic. So one could
    reasonably expect that order-0 request with __GFP_REPEAT will not loop
    for ever. This is not implemented right now though.

    I would like to move on with __GFP_REPEAT and define a better semantic
    for it.

    $ git grep __GFP_REPEAT origin/master | wc -l
    111
    $ git grep __GFP_REPEAT | wc -l
    36

    So we are down to the third after this patch series. The remaining
    places really seem to be relying on __GFP_REPEAT due to large allocation
    requests. This still needs some double checking which I will do later
    after all the simple ones are sorted out.

    I am touching a lot of arch specific code here and I hope I got it right
    but as a matter of fact I even didn't compile test for some archs as I
    do not have cross compiler for them. Patches should be quite trivial to
    review for stupid compile mistakes though. The tricky parts are usually
    hidden by macro definitions and thats where I would appreciate help from
    arch maintainers.

    [1] http://lkml.kernel.org/r/1461849846-27209-1-git-send-email-mhocko@kernel.org

    This patch (of 19):

    __GFP_REPEAT has a rather weak semantic but since it has been introduced
    around 2.6.12 it has been ignored for low order allocations. Yet we
    have the full kernel tree with its usage for apparently order-0
    allocations. This is really confusing because __GFP_REPEAT is
    explicitly documented to allow allocation failures which is a weaker
    semantic than the current order-0 has (basically nofail).

    Let's simply drop __GFP_REPEAT from those places. This would allow to
    identify place which really need allocator to retry harder and formulate
    a more specific semantic for what the flag is supposed to do actually.

    Link: http://lkml.kernel.org/r/1464599699-30131-2-git-send-email-mhocko@kernel.org
    Signed-off-by: Michal Hocko
    Cc: "David S. Miller"
    Cc: "H. Peter Anvin"
    Cc: "James E.J. Bottomley"
    Cc: "Theodore Ts'o"
    Cc: Andy Lutomirski
    Cc: Benjamin Herrenschmidt
    Cc: Catalin Marinas
    Cc: Chen Liqin
    Cc: Chris Metcalf [for tile]
    Cc: Guan Xuetao
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: Ingo Molnar
    Cc: Jan Kara
    Cc: John Crispin
    Cc: Lennox Wu
    Cc: Ley Foon Tan
    Cc: Martin Schwidefsky
    Cc: Matt Fleming
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michal Hocko
     

16 Jun, 2016

2 commits

  • Since all architectures have this implemented now natively, remove this
    dead code.

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-arch@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     
  • Implement FETCH-OP atomic primitives, these are very similar to the
    existing OP-RETURN primitives we already have, except they return the
    value of the atomic variable _before_ modification.

    This is especially useful for irreversible operations -- such as
    bitops (because it becomes impossible to reconstruct the state prior
    to modification).

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-arch@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

04 Jun, 2016

1 commit

  • Nothing on these architectures ever includes the asm/mc146818rtc.h
    file, the drivers that used to do this have been fixed long ago,
    and the remaining users are all PC-specific.

    This removes the files for good.

    Signed-off-by: Arnd Bergmann
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Alexandre Belloni

    Arnd Bergmann
     

21 May, 2016

1 commit

  • Define HAVE_EXIT_THREAD for archs which want to do something in
    exit_thread. For others, let's define exit_thread as an empty inline.

    This is a cleanup before we change the prototype of exit_thread to
    accept a task parameter.

    [akpm@linux-foundation.org: fix mips]
    Signed-off-by: Jiri Slaby
    Cc: "David S. Miller"
    Cc: "H. Peter Anvin"
    Cc: "James E.J. Bottomley"
    Cc: Aurelien Jacquiot
    Cc: Benjamin Herrenschmidt
    Cc: Catalin Marinas
    Cc: Chen Liqin
    Cc: Chris Metcalf
    Cc: Chris Zankel
    Cc: David Howells
    Cc: Fenghua Yu
    Cc: Geert Uytterhoeven
    Cc: Guan Xuetao
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: Ingo Molnar
    Cc: Ivan Kokshaysky
    Cc: James Hogan
    Cc: Jeff Dike
    Cc: Jesper Nilsson
    Cc: Jiri Slaby
    Cc: Jonas Bonn
    Cc: Koichi Yasutake
    Cc: Lennox Wu
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Martin Schwidefsky
    Cc: Matt Turner
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Mikael Starvik
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Richard Henderson
    Cc: Richard Kuo
    Cc: Richard Weinberger
    Cc: Russell King
    Cc: Steven Miao
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

25 Mar, 2016

1 commit

  • Pull asm-generic updates from Arnd Bergmann:
    "There are only three patches this time, most other changes to files in
    include/asm-generic tend to go through the tree of whoever depends on
    the change.

    Two patches are cleanups for stuff that is no longer needed, the main
    change is to adapt the generic version of BUG_ON() for CONFIG_BUG=n to
    make it behave consistently with BUG().

    This avoids undefined behavior along with a number of warnings about
    that undefined behavior in randconfig builds when we keep going on
    after hitting a BUG_ON()"

    * tag 'asm-generic-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
    asm-generic: remove old nonatomic-io wrapper files
    asm-generic: default BUG_ON(x) to if(x)BUG()
    asm-generic: page.h: Remove useless get_user_page and free_user_page

    Linus Torvalds
     

20 Mar, 2016

1 commit

  • Pull networking updates from David Miller:
    "Highlights:

    1) Support more Realtek wireless chips, from Jes Sorenson.

    2) New BPF types for per-cpu hash and arrap maps, from Alexei
    Starovoitov.

    3) Make several TCP sysctls per-namespace, from Nikolay Borisov.

    4) Allow the use of SO_REUSEPORT in order to do per-thread processing
    of incoming TCP/UDP connections. The muxing can be done using a
    BPF program which hashes the incoming packet. From Craig Gallek.

    5) Add a multiplexer for TCP streams, to provide a messaged based
    interface. BPF programs can be used to determine the message
    boundaries. From Tom Herbert.

    6) Add 802.1AE MACSEC support, from Sabrina Dubroca.

    7) Avoid factorial complexity when taking down an inetdev interface
    with lots of configured addresses. We were doing things like
    traversing the entire address less for each address removed, and
    flushing the entire netfilter conntrack table for every address as
    well.

    8) Add and use SKB bulk free infrastructure, from Jesper Brouer.

    9) Allow offloading u32 classifiers to hardware, and implement for
    ixgbe, from John Fastabend.

    10) Allow configuring IRQ coalescing parameters on a per-queue basis,
    from Kan Liang.

    11) Extend ethtool so that larger link mode masks can be supported.
    From David Decotigny.

    12) Introduce devlink, which can be used to configure port link types
    (ethernet vs Infiniband, etc.), port splitting, and switch device
    level attributes as a whole. From Jiri Pirko.

    13) Hardware offload support for flower classifiers, from Amir Vadai.

    14) Add "Local Checksum Offload". Basically, for a tunneled packet
    the checksum of the outer header is 'constant' (because with the
    checksum field filled into the inner protocol header, the payload
    of the outer frame checksums to 'zero'), and we can take advantage
    of that in various ways. From Edward Cree"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1548 commits)
    bonding: fix bond_get_stats()
    net: bcmgenet: fix dma api length mismatch
    net/mlx4_core: Fix backward compatibility on VFs
    phy: mdio-thunder: Fix some Kconfig typos
    lan78xx: add ndo_get_stats64
    lan78xx: handle statistics counter rollover
    RDS: TCP: Remove unused constant
    RDS: TCP: Add sysctl tunables for sndbuf/rcvbuf on rds-tcp socket
    net: smc911x: convert pxa dma to dmaengine
    team: remove duplicate set of flag IFF_MULTICAST
    bonding: remove duplicate set of flag IFF_MULTICAST
    net: fix a comment typo
    ethernet: micrel: fix some error codes
    ip_tunnels, bpf: define IP_TUNNEL_OPTS_MAX and use it
    bpf, dst: add and use dst_tclassid helper
    bpf: make skb->tc_classid also readable
    net: mvneta: bm: clarify dependencies
    cls_bpf: reset class and reuse major in da
    ldmvsw: Checkpatch sunvnet.c and sunvnet_common.c
    ldmvsw: Add ldmvsw.c driver code
    ...

    Linus Torvalds
     

18 Mar, 2016

1 commit

  • Pull tty/serial updates from Greg KH:
    "Here's the big tty/serial driver pull request for 4.6-rc1.

    Lots of changes in here, Peter has been on a tear again, with lots of
    refactoring and bugs fixes, many thanks to the great work he has been
    doing. Lots of driver updates and fixes as well, full details in the
    shortlog.

    All have been in linux-next for a while with no reported issues"

    * tag 'tty-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (220 commits)
    serial: 8250: describe CONFIG_SERIAL_8250_RSA
    serial: samsung: optimize UART rx fifo access routine
    serial: pl011: add mark/space parity support
    serial: sa1100: make sa1100_register_uart_fns a function
    tty: serial: 8250: add MOXA Smartio MUE boards support
    serial: 8250: convert drivers to use up_to_u8250p()
    serial: 8250/mediatek: fix building with SERIAL_8250=m
    serial: 8250/ingenic: fix building with SERIAL_8250=m
    serial: 8250/uniphier: fix modular build
    Revert "drivers/tty/serial: make 8250/8250_ingenic.c explicitly non-modular"
    Revert "drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular"
    serial: mvebu-uart: initial support for Armada-3700 serial port
    serial: mctrl_gpio: Add missing module license
    serial: ifx6x60: avoid uninitialized variable use
    tty/serial: at91: fix bad offset for UART timeout register
    tty/serial: at91: restore dynamic driver binding
    serial: 8250: Add hardware dependency to RT288X option
    TTY, devpts: document pty count limiting
    tty: goldfish: support platform_device with id -1
    drivers: tty: goldfish: Add device tree bindings
    ...

    Linus Torvalds
     

14 Mar, 2016

2 commits

  • This patch updates csum_ipv6_magic so that it correctly recognizes that
    protocol is a unsigned 8 bit value.

    This will allow us to better understand what limitations may or may not be
    present in how we handle the data. For example there are a number of
    places that call htonl on the protocol value. This is likely not necessary
    and can be replaced with a multiplication by ntohl(1) which will be
    converted to a shift by the compiler.

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

    Alexander Duyck
     
  • This patch updates all instances of csum_tcpudp_magic and
    csum_tcpudp_nofold to reflect the types that are usually used as the source
    inputs. For example the protocol field is populated based on nexthdr which
    is actually an unsigned 8 bit value. The length is usually populated based
    on skb->len which is an unsigned integer.

    This addresses an issue in which the IPv6 function csum_ipv6_magic was
    generating a checksum using the full 32b of skb->len while
    csum_tcpudp_magic was only using the lower 16 bits. As a result we could
    run into issues when attempting to adjust the checksum as there was no
    protocol agnostic way to update it.

    With this change the value is still truncated as many architectures use
    "(len + proto) << 8", however this truncation only occurs for values
    greater than 16776960 in length and as such is unlikely to occur as we stop
    the inner headers at ~64K in size.

    I did have to make a few minor changes in the arm, mn10300, nios2, and
    score versions of the function in order to support these changes as they
    were either using things such as an OR to combine the protocol and length,
    or were using ntohs to convert the length which would have truncated the
    value.

    I also updated a few spots in terms of whitespace and type differences for
    the addresses. Most of this was just to make sure all of the definitions
    were in sync going forward.

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

    Alexander Duyck
     

08 Mar, 2016

2 commits


26 Feb, 2016

2 commits

  • They are not symmetric with each other, neither are used in real world
    (can not be found by grep command in source code root directory), so
    remove them.

    Signed-off-by: Chen Gang
    Acked-by: Russell King
    Acked-by: Greg Ungerer
    Signed-off-by: Arnd Bergmann

    Chen Gang
     
  • This patch add the SO_CNX_ADVICE socket option (setsockopt only). The
    purpose is to allow an application to give feedback to the kernel about
    the quality of the network path for a connected socket. The value
    argument indicates the type of quality report. For this initial patch
    the only supported advice is a value of 1 which indicates "bad path,
    please reroute"-- the action taken by the kernel is to call
    dst_negative_advice which will attempt to choose a different ECMP route,
    reset the TX hash for flow label and UDP source port in encapsulation,
    etc.

    This facility should be useful for connected UDP sockets where only the
    application can provide any feedback about path quality. It could also
    be useful for TCP applications that have additional knowledge about the
    path outside of the normal TCP control loop.

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

    Tom Herbert
     

29 Jan, 2016

1 commit


21 Jan, 2016

3 commits

  • Move the generic implementation to now that all
    architectures support it and remove the HAVE_DMA_ATTR Kconfig symbol now
    that everyone supports them.

    [valentinrothberg@gmail.com: remove leftovers in Kconfig]
    Signed-off-by: Christoph Hellwig
    Cc: "David S. Miller"
    Cc: Aurelien Jacquiot
    Cc: Chris Metcalf
    Cc: David Howells
    Cc: Geert Uytterhoeven
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Helge Deller
    Cc: James Hogan
    Cc: Jesper Nilsson
    Cc: Koichi Yasutake
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Mikael Starvik
    Cc: Steven Miao
    Cc: Vineet Gupta
    Cc: Christian Borntraeger
    Cc: Joerg Roedel
    Cc: Sebastian Ott
    Signed-off-by: Valentin Rothberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • Signed-off-by: Christoph Hellwig
    Cc: David Howells
    Cc: Christian Borntraeger
    Cc: Joerg Roedel
    Cc: Sebastian Ott
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     
  • The SMD driver is reading and writing chunks of data to iomem, and
    there's an __iowrite32_copy() function for the writing part, but no
    __ioread32_copy() function for the reading part. This series adds
    __ioread32_copy() and uses it in two places.

    This patch (of 4):

    The frv port uses compiler builtins, __builtin_read*(), for the I/O read
    routines. Unfortunately, these don't accept const void pointers although
    the generic ASM implementations do, so generic code passing const pointers
    to these APIs cause compilers to emit warnings. Add wrapper functions
    that cast away the const to avoid the warnings.

    Signed-off-by: Stephen Boyd
    Cc: David Howells
    Cc:
    Cc: Bjorn Andersson
    Cc: Hauke Mehrtens
    Cc: Paul Walmsley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Boyd
     

16 Jan, 2016

1 commit

  • Take into account that the pmd_t type is a array inside a struct, so it
    needs two levels of brackets to initialize. Otherwise, a usage of __pmd
    generates a warning:

    include/linux/mm.h:986:2: warning: missing braces around initializer [-Wmissing-braces]

    Signed-off-by: Dan Williams
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Williams
     

14 Jan, 2016

1 commit

  • Pull libnvdimm updates from Dan Williams:
    "The bulk of this has appeared in -next and independently received a
    build success notification from the kbuild robot. The 'for-4.5/block-
    dax' topic branch was rebased over the weekend to drop the "block
    device end-of-life" rework that Al would like to see re-implemented
    with a notifier, and to address bug reports against the badblocks
    integration.

    There is pending feedback against "libnvdimm: Add a poison list and
    export badblocks" received last week. Linda identified some localized
    fixups that we will handle incrementally.

    Summary:

    - Media error handling: The 'badblocks' implementation that
    originated in md-raid is up-levelled to a generic capability of a
    block device. This initial implementation is limited to being
    consulted in the pmem block-i/o path. Later, 'badblocks' will be
    consulted when creating dax mappings.

    - Raw block device dax: For virtualization and other cases that want
    large contiguous mappings of persistent memory, add the capability
    to dax-mmap a block device directly.

    - Increased /dev/mem restrictions: Add an option to treat all
    io-memory as IORESOURCE_EXCLUSIVE, i.e. disable /dev/mem access
    while a driver is actively using an address range. This behavior
    is controlled via the new CONFIG_IO_STRICT_DEVMEM option and can be
    overridden by the existing "iomem=relaxed" kernel command line
    option.

    - Miscellaneous fixes include a 'pfn'-device huge page alignment fix,
    block device shutdown crash fix, and other small libnvdimm fixes"

    * tag 'libnvdimm-for-4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: (32 commits)
    block: kill disk_{check|set|clear|alloc}_badblocks
    libnvdimm, pmem: nvdimm_read_bytes() badblocks support
    pmem, dax: disable dax in the presence of bad blocks
    pmem: fail io-requests to known bad blocks
    libnvdimm: convert to statically allocated badblocks
    libnvdimm: don't fail init for full badblocks list
    block, badblocks: introduce devm_init_badblocks
    block: clarify badblocks lifetime
    badblocks: rename badblocks_free to badblocks_exit
    libnvdimm, pmem: move definition of nvdimm_namespace_add_poison to nd.h
    libnvdimm: Add a poison list and export badblocks
    nfit_test: Enable DSMs for all test NFITs
    md: convert to use the generic badblocks code
    block: Add badblock management for gendisks
    badblocks: Add core badblock management code
    block: fix del_gendisk() vs blkdev_ioctl crash
    block: enable dax for raw block devices
    block: introduce bdev_file_inode()
    restrict /dev/mem to idle io memory ranges
    arch: consolidate CONFIG_STRICT_DEVM in lib/Kconfig.debug
    ...

    Linus Torvalds
     

13 Jan, 2016

1 commit

  • Pull networking updates from Davic Miller:

    1) Support busy polling generically, for all NAPI drivers. From Eric
    Dumazet.

    2) Add byte/packet counter support to nft_ct, from Floriani Westphal.

    3) Add RSS/XPS support to mvneta driver, from Gregory Clement.

    4) Implement IPV6_HDRINCL socket option for raw sockets, from Hannes
    Frederic Sowa.

    5) Add support for T6 adapter to cxgb4 driver, from Hariprasad Shenai.

    6) Add support for VLAN device bridging to mlxsw switch driver, from
    Ido Schimmel.

    7) Add driver for Netronome NFP4000/NFP6000, from Jakub Kicinski.

    8) Provide hwmon interface to mlxsw switch driver, from Jiri Pirko.

    9) Reorganize wireless drivers into per-vendor directories just like we
    do for ethernet drivers. From Kalle Valo.

    10) Provide a way for administrators "destroy" connected sockets via the
    SOCK_DESTROY socket netlink diag operation. From Lorenzo Colitti.

    11) Add support to add/remove multicast routes via netlink, from Nikolay
    Aleksandrov.

    12) Make TCP keepalive settings per-namespace, from Nikolay Borisov.

    13) Add forwarding and packet duplication facilities to nf_tables, from
    Pablo Neira Ayuso.

    14) Dead route support in MPLS, from Roopa Prabhu.

    15) TSO support for thunderx chips, from Sunil Goutham.

    16) Add driver for IBM's System i/p VNIC protocol, from Thomas Falcon.

    17) Rationalize, consolidate, and more completely document the checksum
    offloading facilities in the networking stack. From Tom Herbert.

    18) Support aborting an ongoing scan in mac80211/cfg80211, from
    Vidyullatha Kanchanapally.

    19) Use per-bucket spinlock for bpf hash facility, from Tom Leiming.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1375 commits)
    net: bnxt: always return values from _bnxt_get_max_rings
    net: bpf: reject invalid shifts
    phonet: properly unshare skbs in phonet_rcv()
    dwc_eth_qos: Fix dma address for multi-fragment skbs
    phy: remove an unneeded condition
    mdio: remove an unneed condition
    mdio_bus: NULL dereference on allocation error
    net: Fix typo in netdev_intersect_features
    net: freescale: mac-fec: Fix build error from phy_device API change
    net: freescale: ucc_geth: Fix build error from phy_device API change
    bonding: Prevent IPv6 link local address on enslaved devices
    IB/mlx5: Add flow steering support
    net/mlx5_core: Export flow steering API
    net/mlx5_core: Make ipv4/ipv6 location more clear
    net/mlx5_core: Enable flow steering support for the IB driver
    net/mlx5_core: Initialize namespaces only when supported by device
    net/mlx5_core: Set priority attributes
    net/mlx5_core: Connect flow tables
    net/mlx5_core: Introduce modify flow table command
    net/mlx5_core: Managing root flow table
    ...

    Linus Torvalds
     

09 Jan, 2016

1 commit

  • Let all the archs that implement devmem_is_allowed() opt-in to a common
    definition of CONFIG_STRICT_DEVM in lib/Kconfig.debug.

    Cc: Kees Cook
    Cc: Russell King
    Cc: Will Deacon
    Cc: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc: Andrew Morton
    Cc: Greg Kroah-Hartman
    Cc: "David S. Miller"
    Acked-by: Catalin Marinas
    Acked-by: Heiko Carstens
    [heiko: drop 'default y' for s390]
    Acked-by: Ingo Molnar
    Suggested-by: Arnd Bergmann
    Signed-off-by: Dan Williams

    Dan Williams
     

05 Jan, 2016

1 commit

  • Expose socket options for setting a classic or extended BPF program
    for use when selecting sockets in an SO_REUSEPORT group. These options
    can be used on the first socket to belong to a group before bind or
    on any socket in the group after bind.

    This change includes refactoring of the existing sk_filter code to
    allow reuse of the existing BPF filter validation checks.

    Signed-off-by: Craig Gallek
    Acked-by: Alexei Starovoitov
    Signed-off-by: David S. Miller

    Craig Gallek
     

04 Dec, 2015

1 commit

  • It seems that commit 5dc12ddee93 ("Remove tas()") missed some files.
    Correct this and fully drop this macro, for which we should be using
    cmpxchg() like calls.

    Signed-off-by: Davidlohr Bueso
    Signed-off-by: Peter Zijlstra (Intel)
    Cc:
    Cc: Andrew Morton
    Cc: Aurelien Jacquiot
    Cc: Chris Metcalf
    Cc: David Howells
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Steven Miao
    Cc: Thomas Gleixner
    Cc: dave@stgolabs.net
    Link: http://lkml.kernel.org/r/1445975631-17047-2-git-send-email-dave@stgolabs.net
    Signed-off-by: Ingo Molnar

    Davidlohr Bueso
     

10 Nov, 2015

1 commit


06 Oct, 2015

1 commit


04 Oct, 2015

1 commit

  • Pull strscpy string copy function implementation from Chris Metcalf.

    Chris sent this during the merge window, but I waffled back and forth on
    the pull request, which is why it's going in only now.

    The new "strscpy()" function is definitely easier to use and more secure
    than either strncpy() or strlcpy(), both of which are horrible nasty
    interfaces that have serious and irredeemable problems.

    strncpy() has a useless return value, and doesn't NUL-terminate an
    overlong result. To make matters worse, it pads a short result with
    zeroes, which is a performance disaster if you have big buffers.

    strlcpy(), by contrast, is a mis-designed "fix" for strlcpy(), lacking
    the insane NUL padding, but having a differently broken return value
    which returns the original length of the source string. Which means
    that it will read characters past the count from the source buffer, and
    you have to trust the source to be properly terminated. It also makes
    error handling fragile, since the test for overflow is unnecessarily
    subtle.

    strscpy() avoids both these problems, guaranteeing the NUL termination
    (but not excessive padding) if the destination size wasn't zero, and
    making the overflow condition very obvious by returning -E2BIG. It also
    doesn't read past the size of the source, and can thus be used for
    untrusted source data too.

    So why did I waffle about this for so long?

    Every time we introduce a new-and-improved interface, people start doing
    these interminable series of trivial conversion patches.

    And every time that happens, somebody does some silly mistake, and the
    conversion patch to the improved interface actually makes things worse.
    Because the patch is mindnumbing and trivial, nobody has the attention
    span to look at it carefully, and it's usually done over large swatches
    of source code which means that not every conversion gets tested.

    So I'm pulling the strscpy() support because it *is* a better interface.
    But I will refuse to pull mindless conversion patches. Use this in
    places where it makes sense, but don't do trivial patches to fix things
    that aren't actually known to be broken.

    * 'strscpy' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
    tile: use global strscpy() rather than private copy
    string: provide strscpy()
    Make asm/word-at-a-time.h available on all architectures

    Linus Torvalds
     

23 Sep, 2015

1 commit

  • This patch makes sure that atomic_{read,set}() are at least
    {READ,WRITE}_ONCE().

    We already had the 'requirement' that atomic_read() should use
    ACCESS_ONCE(), and most archs had this, but a few were lacking.
    All are now converted to use READ_ONCE().

    And, by a symmetry and general paranoia argument, upgrade atomic_set()
    to use WRITE_ONCE().

    Signed-off-by: Peter Zijlstra (Intel)
    Cc: Andrew Morton
    Cc: Dmitry Vyukov
    Cc: Linus Torvalds
    Cc: Paul E. McKenney
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: james.hogan@imgtec.com
    Cc: linux-kernel@vger.kernel.org
    Cc: oleg@redhat.com
    Cc: will.deacon@arm.com
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

16 Sep, 2015

1 commit

  • Revert dff22d2054b5 ("PCI: Call pci_read_bridge_bases() from core instead
    of arch code").

    Reading PCI bridge windows is not arch-specific in itself, but there is PCI
    core code that doesn't work correctly if we read them too early. For
    example, Hannes found this case on an ARM Freescale i.mx6 board:

    pci_bus 0000:00: root bus resource [mem 0x01000000-0x01efffff]
    pci 0000:00:00.0: PCI bridge to [bus 01-ff]
    pci 0000:00:00.0: BAR 8: no space for [mem size 0x01000000] (mem window)
    pci 0000:01:00.0: BAR 2: failed to assign [mem size 0x00200000]
    pci 0000:01:00.0: BAR 1: failed to assign [mem size 0x00004000]
    pci 0000:01:00.0: BAR 0: failed to assign [mem size 0x00000100]

    The 00:00.0 mem window needs to be at least 3MB: the 01:00.0 device needs
    0x204100 of space, and mem windows are megabyte-aligned.

    Bus sizing can increase a bridge window size, but never *decrease* it (see
    d65245c3297a ("PCI: don't shrink bridge resources")). Prior to
    dff22d2054b5, ARM didn't read bridge windows at all, so the "original size"
    was zero, and we assigned a 3MB window.

    After dff22d2054b5, we read the bridge windows before sizing the bus. The
    firmware programmed a 16MB window (size 0x01000000) in 00:00.0, and since
    we never decrease the size, we kept 16MB even though we only needed 3MB.
    But 16MB doesn't fit in the host bridge aperture, so we failed to assign
    space for the window and the downstream devices.

    I think this is a defect in the PCI core: we shouldn't rely on the firmware
    to assign sensible windows.

    Ray reported a similar problem, also on ARM, with Broadcom iProc.

    Issues like this are too hard to fix right now, so revert dff22d2054b5.

    Reported-by: Hannes
    Reported-by: Ray Jui
    Link: http://lkml.kernel.org/r/CAAa04yFQEUJm7Jj1qMT57-LG7ZGtnhNDBe=PpSRa70Mj+XhW-A@mail.gmail.com
    Link: http://lkml.kernel.org/r/55F75BB8.4070405@broadcom.com
    Signed-off-by: Bjorn Helgaas
    Acked-by: Yinghai Lu
    Acked-by: Lorenzo Pieralisi

    Bjorn Helgaas