1. 11 Jun, 2018 6 commits
  2. 09 Jun, 2018 1 commit
    • Luc Van Oostenryck's avatar
      riscv: split the declaration of __copy_user · 86406d51
      Luc Van Oostenryck authored
      We use a single __copy_user assembly function to copy memory both from
      and to userspace. While this works, it triggers sparse errors because
      we're implicitly casting between the kernel and user address spaces by
      calling __copy_user.
      
      This patch splits the C declaration into a pair of functions,
      __asm_copy_{to,from}_user, that have sane semantics WRT __user. This
      split make things fine from sparse's point of view. The assembly
      implementation keeps a single definition but add a double ENTRY() for it,
      one for __asm_copy_to_user and another one for __asm_copy_from_user.
      The result is a spare-safe implementation that pays no performance
      or code size penalty.
      Signed-off-by: default avatarLuc Van Oostenryck <luc.vanoostenryck@gmail.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      86406d51
  3. 07 Jun, 2018 2 commits
  4. 04 Jun, 2018 6 commits
    • Palmer Dabbelt's avatar
      RISC-V: Preliminary Perf Support · 32c81bce
      Palmer Dabbelt authored
      The RISC-V ISA defines a core set of performance counters that must
      exist on all processors along with a standard way to add more
      performance counters.
      
      This patch set adds preliminary perf support for RISC-V systems.  Long
      term we'll move to model where all PMUs can be built into the kernel at
      the same time, detected at runtime (possibly via device tree), and
      provided to userspace.  Since we currently only support the ISA-mandated
      performance counters there's no need to detect anything right now.
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      32c81bce
    • Alan Kao's avatar
      perf: riscv: Add Document for Future Porting Guide · 0d431558
      Alan Kao authored
      Reviewed-by: default avatarAlex Solomatnikov <sols@sifive.com>
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Greentime Hu <greentime@andestech.com>
      Signed-off-by: default avatarAlan Kao <alankao@andestech.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      0d431558
    • Alan Kao's avatar
      perf: riscv: preliminary RISC-V support · 178e9fc4
      Alan Kao authored
      This patch provide a basic PMU, riscv_base_pmu, which supports two
      general hardware event, instructions and cycles.  Furthermore, this
      PMU serves as a reference implementation to ease the portings in
      the future.
      
      riscv_base_pmu should be able to run on any RISC-V machine that
      conforms to the Priv-Spec.  Note that the latest qemu model hasn't
      fully support a proper behavior of Priv-Spec 1.10 yet, but work
      around should be easy with very small fixes.  Please check
      https://github.com/riscv/riscv-qemu/pull/115 for future updates.
      
      Cc: Nick Hu <nickhu@andestech.com>
      Cc: Greentime Hu <greentime@andestech.com>
      Signed-off-by: default avatarAlan Kao <alankao@andestech.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      178e9fc4
    • Palmer Dabbelt's avatar
      MAINTAINERS: Update Albert's email, he's back at Berkeley · 9c521764
      Palmer Dabbelt authored
      When I was adding a MAINTAINERS entry for SiFive's drivers I realized
      that Albert's email is out of date -- he's gone back to Berkeley, so his
      SiFive email is technically defunct.  This patch updates his entry to a
      current email address, hosted at Berkeley.
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      9c521764
    • Palmer Dabbelt's avatar
      MAINTAINERS: Add myself as a maintainer for SiFive's drivers · 3ed45d7f
      Palmer Dabbelt authored
      There aren't actually any files in the tree that match these patterns
      right now, but we've just started submitting our drivers so I thought it
      would be good to make sure there's at least someone at SiFive who's
      listed as maintaining them.  I'm leaving the RISC-V lists on here
      because:
      
      * As of today, all the RISC-V ASICs that people can actually buy are
        from SiFive -- though hopefully there'll be more soon!
      * The RTL for many of our devices is open source, so I anticipate these
        devices might make they way chips from other vendors.
      * We may standardize some of these devices as part of a RISC-V
        specification at some point in the future.
      
      I'm a bit swamped right now so I might not be the most active maintainer
      of these drivers, but I think it'd be good to make sure someone who has
      hardware access gets CC'd on updates to our drivers just as a sanity
      check.  Hopefully that's an OK way to handle this.
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      3ed45d7f
    • Alan Kao's avatar
      riscv: Fix the bug in memory access fixup code · ebcbd75e
      Alan Kao authored
      A piece of fixup code is currently shared by __copy_user and
      __clear_user.  It first disables the access to user-space memory
      and then returns the "n" argument, which represents #(bytes not processed).
      However,__copy_user's "n" is in register a2, while __clear_user's in a1,
      and thus it causes errors for programs like setdomainname02 testcase in LTP.
      
      This patch fixes this issue by separating their fixup code and returning
      the right value for the kernel to handle a relative fault properly.
      Signed-off-by: default avatarAlan Kao <alankao@andestech.com>
      Cc: Greentime Hu <greentime@andestech.com>
      Cc: Zong Li <zong@andestech.com>
      Cc: Vincent Chen <vincentc@andestech.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmer@sifive.com>
      ebcbd75e
  5. 03 Jun, 2018 6 commits
    • Linus Torvalds's avatar
      Linux 4.17 · 29dcea88
      Linus Torvalds authored
      29dcea88
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 325e14f9
      Linus Torvalds authored
      Pull vfs fixes from Al Viro.
      
       - fix io_destroy()/aio_complete() race
      
       - the vfs_open() change to get rid of open_check_o_direct() boilerplate
         was nice, but buggy. Al has a patch avoiding a revert, but that's
         definitely not a last-day fodder, so for now revert it is...
      
      * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        Revert "fs: fold open_check_o_direct into do_dentry_open"
        fix io_destroy()/aio_complete() race
      325e14f9
    • Al Viro's avatar
      Revert "fs: fold open_check_o_direct into do_dentry_open" · af04fadc
      Al Viro authored
      This reverts commit cab64df1.
      
      Having vfs_open() in some cases drop the reference to
      struct file combined with
      
      	error = vfs_open(path, f, cred);
      	if (error) {
      		put_filp(f);
      		return ERR_PTR(error);
      	}
      	return f;
      
      is flat-out wrong.  It used to be
      
      		error = vfs_open(path, f, cred);
      		if (!error) {
      			/* from now on we need fput() to dispose of f */
      			error = open_check_o_direct(f);
      			if (error) {
      				fput(f);
      				f = ERR_PTR(error);
      			}
      		} else {
      			put_filp(f);
      			f = ERR_PTR(error);
      		}
      
      and sure, having that open_check_o_direct() boilerplate gotten rid of is
      nice, but not that way...
      
      Worse, another call chain (via finish_open()) is FUBAR now wrt
      FILE_OPENED handling - in that case we get error returned, with file
      already hit by fput() *AND* FILE_OPENED not set.  Guess what happens in
      path_openat(), when it hits
      
      	if (!(opened & FILE_OPENED)) {
      		BUG_ON(!error);
      		put_filp(file);
      	}
      
      The root cause of all that crap is that the callers of do_dentry_open()
      have no way to tell which way did it fail; while that could be fixed up
      (by passing something like int *opened to do_dentry_open() and have it
      marked if we'd called ->open()), it's probably much too late in the
      cycle to do so right now.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      af04fadc
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 874cd339
      Linus Torvalds authored
      Pull scheduler fixes from Thomas Gleixner:
      
       - two patches addressing the problem that the scheduler allows under
         certain conditions user space tasks to be scheduled on CPUs which are
         not yet fully booted which causes a few subtle and hard to debug
         issue
      
       - add a missing runqueue clock update in the deadline scheduler which
         triggers a warning under certain circumstances
      
       - fix a silly typo in the scheduler header file
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/headers: Fix typo
        sched/deadline: Fix missing clock update
        sched/core: Require cpu_active() in select_task_rq(), for user tasks
        sched/core: Fix rules for running on online && !active CPUs
      874cd339
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 26bdace7
      Linus Torvalds authored
      Pull perf tooling fixes from Thomas Gleixner:
      
       - fix 'perf test Session topology' segfault on s390 (Thomas Richter)
      
       - fix NULL return handling in bpf__prepare_load() (YueHaibing)
      
       - fix indexing on Coresight ETM packet queue decoder (Mathieu Poirier)
      
       - fix perf.data format description of NRCPUS header (Arnaldo Carvalho
         de Melo)
      
       - update perf.data documentation section on cpu topology
      
       - handle uncore event aliases in small groups properly (Kan Liang)
      
       - add missing perf_sample.addr into python sample dictionary (Leo Yan)
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf tools: Fix perf.data format description of NRCPUS header
        perf script python: Add addr into perf sample dict
        perf data: Update documentation section on cpu topology
        perf cs-etm: Fix indexing for decoder packet queue
        perf bpf: Fix NULL return handling in bpf__prepare_load()
        perf test: "Session topology" dumps core on s390
        perf parse-events: Handle uncore event aliases in small groups properly
      26bdace7
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 918fe1b3
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Infinite loop in _decode_session6(), from Eric Dumazet.
      
       2) Pass correct argument to nla_strlcpy() in netfilter, also from Eric
          Dumazet.
      
       3) Out of bounds memory access in ipv6 srh code, from Mathieu Xhonneux.
      
       4) NULL deref in XDP_REDIRECT handling of tun driver, from Toshiaki
          Makita.
      
       5) Incorrect idr release in cls_flower, from Paul Blakey.
      
       6) Probe error handling fix in davinci_emac, from Dan Carpenter.
      
       7) Memory leak in XPS configuration, from Alexander Duyck.
      
       8) Use after free with cloned sockets in kcm, from Kirill Tkhai.
      
       9) MTU handling fixes fo ip_tunnel and ip6_tunnel, from Nicolas
          Dichtel.
      
      10) Fix UAPI hole in bpf data structure for 32-bit compat applications,
          from Daniel Borkmann.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (33 commits)
        bpf: fix uapi hole for 32 bit compat applications
        net: usb: cdc_mbim: add flag FLAG_SEND_ZLP
        ip6_tunnel: remove magic mtu value 0xFFF8
        ip_tunnel: restore binding to ifaces with a large mtu
        net: dsa: b53: Add BCM5389 support
        kcm: Fix use-after-free caused by clonned sockets
        net-sysfs: Fix memory leak in XPS configuration
        ixgbe: fix parsing of TC actions for HW offload
        net: ethernet: davinci_emac: fix error handling in probe()
        net/ncsi: Fix array size in dumpit handler
        cls_flower: Fix incorrect idr release when failing to modify rule
        net/sonic: Use dma_mapping_error()
        xfrm Fix potential error pointer dereference in xfrm_bundle_create.
        vhost_net: flush batched heads before trying to busy polling
        tun: Fix NULL pointer dereference in XDP redirect
        be2net: Fix error detection logic for BE3
        net: qmi_wwan: Add Netgear Aircard 779S
        mlxsw: spectrum: Forbid creation of VLAN 1 over port/LAG
        atm: zatm: fix memcmp casting
        iwlwifi: pcie: compare with number of IRQs requested for, not number of CPUs
        ...
      918fe1b3
  6. 02 Jun, 2018 15 commits
  7. 01 Jun, 2018 4 commits