1. 20 Jan, 2018 7 commits
    • Edward Tomasz Napierala's avatar
      Add sysctls to control device side USB identifiers. This makes it · 8e06491a
      Edward Tomasz Napierala authored
      possible to change string and numeric vendor and product identifiers,
      as well as anything else there might be to change for a particular
      device side template, eg the MAC address.
      Reviewed by:	hselasky@
      MFC after:	2 weeks
      Sponsored by:	The FreeBSD Foundation
      Differential Revision:	https://reviews.freebsd.org/D13920
    • Konstantin Belousov's avatar
      Assign map->header values to avoid boundary checks. · 1c5196c3
      Konstantin Belousov authored
      In several places, entry start and end field are checked, after
      excluding the possibility that the entry is map->header.  By assigning
      max and min values to the start and end fields of map->header in
      vm_map_init, the explicit map->header checks become unnecessary.
      Submitted by:	Doug Moore <dougm@rice.edu>
      Reviewed by:	alc, kib, markj (previous version)
      Tested by:	pho (previous version)
      MFC after:	1 week
      Differential Revision:  https://reviews.freebsd.org/D13735
    • Jean-Sébastien Pédron's avatar
      psm: Don't try to detect trackpoint packets if the Elantech device has none · b9b766ae
      Jean-Sébastien Pédron authored
      This fixes a panic when `EVDEV_SUPPORT` is enabled: if a trackpoint
      packet was detected but there was no trackpoint, we still tried to emit an
      evdev event even though the associated relative evdev device (`evdev_r`)
      was not initialized.
      PR:		225339
      MFC after:	1 week
    • Jean-Sébastien Pédron's avatar
      psm: Skip sync check when `PSM_CONFIG_NOCHECKSYNC` is set · 9402bd96
      Jean-Sébastien Pédron authored
      In psmprobe(), we set the initial `syncmask` to the vendor default value
      if the `PSM_CONFIG_NOCHECKSYNC` bit is unset. However, we currently only
      set it for the Elantech touchpad later in psmattach(), thus `syncmask`
      is always configured.
      Now, we check `PSM_CONFIG_NOCHECKSYNC` and skip sync check if it is set.
      This fixes Elantech touchpad support for units which have `hascrc` set.
      To clarify that, when we log the `syncmask` and `syncbits` fields, also
      mention if they are actually used.
      Finally, when we set `PSM_CONFIG_NOCHECKSYNC`, clear `PSM_NEED_SYNCBITS`
      PR:		225338
      MFC after:	1 week
    • Kyle Evans's avatar
      od(1): Fix mis-patch from r328188 · 450c7a04
      Kyle Evans authored
      od_test.sh got duplicated erroneously when it was added in r328188. Dedup.
    • Kyle Evans's avatar
      od(1): Fix wrong output for some corner cases in multibyte locales. · 6bb76493
      Kyle Evans authored
      Restore the original character to print if we used the look-ahead
      buffer, but that didn't help -- we either got an illegal sequence
      or still can't complete.
      PR:		224552
      Submitted by:	Yuri Pankov
      MFC after:	1 week
      Differential Revision:	https://reviews.freebsd.org/D13963
    • Landon J. Fuller's avatar
      bhnd_chipc(4): Fix leak of child device ivars by explicitly deleting · f248a99a
      Landon J. Fuller authored
      any children prior to detach.
      With the newbus child deletion ordering changes introduced in r307518,
      parent devices are now detached (and their driver set to NULL) prior to
      detaching and deleting child devices; child-related bus methods (e.g.
      BUS_CHILD_DETACHED, BUS_CHILD_DELETED) are no longer be dispatched to the
      parent device driver after it returns 0 (success) from DEVICE_DETACH.
      Sponsored by:   The FreeBSD Foundation
  2. 19 Jan, 2018 23 commits
  3. 18 Jan, 2018 10 commits
    • John Baldwin's avatar
      Use a dedicated per-CPU stack for machine check exceptions. · 68fd3b0e
      John Baldwin authored
      Similar to NMIs, machine check exceptions can fire at any time and are
      not masked by IF.  This means that machine checks can fire when the
      kstack is too deep to hold a trap frame, or at critical sections in
      trap handlers when a user %gs is used with a kernel %cs.  Use the same
      strategy used for NMIs of using a dedicated per-CPU stack configured
      in IST 3.  Store the CPU's pcpu pointer at the stop of the stack so
      that the machine check handler can reliably find the proper value for
      %gs (also borrowed from NMIs).
      This should also fix a similar issue with PTI with a MC# occurring
      while the CPU is executing on the trampoline stack.
      While here, bypass trap() entirely and just call mca_intr().  This
      avoids a bogus call to kdb_reenter() (there's no reason to try to
      reenter kdb if a MC# is raised).
      Reviewed by:	kib
      Tested by:	avg (on AMD without PTI)
      Differential Revision:	https://reviews.freebsd.org/D13962
    • Kyle Evans's avatar
      stand: Move sections around to fix stand/ build with ld.lld on armv7 · 62821e57
      Kyle Evans authored
      When building loader bits, lld fails with the following error:
      "ld: error: section: .dynamic is not contiguous with other relro sections"
      on both ubldr and EFI loader.
      Move .dynamic up to make ld.lld happy, adjust .got as necessary for ubldr.
      Tested on:	OrangePi One (ld.lld, ubldr)
      Tested on:	Banana Pi-M3 (ld.lld, ubldr)
      Tested on:	qemu-armv7 (ld.lld, EFI)
      Tested on:	qemu-armv7 (ld.bfd, EFI)
      Tested on:	Raspberry Pi 2 (ld.bfd, ubldr) [manu]
      Tested on:	Banana Pi-M2 (ld.bfd, ubldr) [manu]
      Reviewed by:	andrew, emaste, imp
      Differential Revision:	https://reviews.freebsd.org/D13942
    • Warner Losh's avatar
    • Warner Losh's avatar
      Make igor happier with this file: · 36a910fb
      Warner Losh authored
      o Don't use contractions.
      o Add common after e.g. where needed
    • John Baldwin's avatar
      Remove two no-longer-used labels from the NMI interrupt handler. · f36b1fe0
      John Baldwin authored
      Reviewed by:	kib
    • Conrad Meyer's avatar
      Add ccp(4): experimental driver for AMD Crypto Co-Processor · 844d9543
      Conrad Meyer authored
      * Registers TRNG source for random(4)
      * Finds available queues, LSBs; allocates static objects
      * Allocates a shared MSI-X for all queues.  The hardware does not have
        separate interrupts per queue.  Working interrupt mode driver.
      * Computes SHA hashes, HMAC.  Passes cryptotest.py, cryptocheck tests.
      * Does AES-CBC, CTR mode, and XTS.  cryptotest.py and cryptocheck pass.
      * Support for "authenc" (AES + HMAC).  (SHA1 seems to result in
        "unaligned" cleartext inputs from cryptocheck -- which the engine
        cannot handle.  SHA2 seems to work fine.)
      * GCM passes for block-multiple AAD, input lengths
      Largely based on ccr(4), part of cxgbe(4).
      Rough performance averages on AMD Ryzen 1950X (4kB buffer):
      aesni:      SHA1: ~8300 Mb/s    SHA256: ~8000 Mb/s
      ccp:               ~630 Mb/s    SHA256:  ~660 Mb/s  SHA512:  ~700 Mb/s
      cryptosoft:       ~1800 Mb/s    SHA256: ~1800 Mb/s  SHA512: ~2700 Mb/s
      As you can see, performance is poor in comparison to aesni(4) and even
      cryptosoft (due to high setup cost).  At a larger buffer size (128kB),
      throughput is a little better (but still worse than aesni(4)):
      aesni:      SHA1:~10400 Mb/s    SHA256: ~9950 Mb/s
      ccp:              ~2200 Mb/s    SHA256: ~2600 Mb/s  SHA512: ~3800 Mb/s
      cryptosoft:       ~1750 Mb/s    SHA256: ~1800 Mb/s  SHA512: ~2700 Mb/s
      AES performance has a similar story:
      aesni:      4kB: ~11250 Mb/s    128kB: ~11250 Mb/s
      ccp:               ~350 Mb/s    128kB:  ~4600 Mb/s
      cryptosoft:       ~1750 Mb/s    128kB:  ~1700 Mb/s
      This driver is EXPERIMENTAL.  You should verify cryptographic results on
      typical and corner case inputs from your application against a known- good
      Sponsored by:	Dell EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D12723
    • Dimitry Andric's avatar
      Pull in r322106 from upstream llvm trunk (by Alexey Bataev): · 024469e4
      Dimitry Andric authored
        [COST]Fix PR35865: Fix cost model evaluation for shuffle on X86.
        If the vector type is transformed to non-vector single type, the
        compile may crash trying to get vector information about non-vector
        Reviewers: RKSimon, spatel, mkuper, hfinkel
        Subscribers: llvm-commits
        Differential Revision: https://reviews.llvm.org/D41862
      This should fix "Not a vector MVT!" errors when building the
      games/dhewm3 port.
      Reported by:	jbeich
      PR:		225271
    • Dimitry Andric's avatar
      Pull in r322016 from upstream llvm trunk (by Sanjay Patel): · 6bee06ef
      Dimitry Andric authored
        [ValueTracking] remove overzealous assert
        The test is derived from a failing fuzz test:
        Credit to @rksimon for pointing out the problem.
      This should fix "Bad flavor while matching min/max" errors when building
      the graphics/libsixel and science/kst2 ports.
      Reported by:	jbeich
      PR:		225268, 225269
    • Ed Maste's avatar
      lld: Fix incorrect physical address on self-referencing AT command. · 62de8f4a
      Ed Maste authored
      When a section placement (AT) command references the section itself,
      the physical address of the section in the ELF header was calculated
      incorrectly due to alignment happening right after the location
      pointer's value was captured.
      The problem was diagnosed and the first version of the patch written
      by Erick Reyes.
      Obtained from:	LLVM r322421 by Rafael Espindola
    • Ed Maste's avatar
      lld: Handle parsing AT(ADDR(.foo-bar)). · cc877d7c
      Ed Maste authored
      The problem we had with it is that anything inside an AT is an
      expression, so we failed to parse the section name because of the - in
      Requested by:	royger
      Obtained from:	LLVM r322801 by Rafael Espindola