1. 19 Jun, 2021 8 commits
  2. 18 Jun, 2021 21 commits
    • Bjoern A. Zeeb's avatar
      LinuxKPI: fix build after d4a4960c pci: "pcim" (managed) support · 5f88df77
      Bjoern A. Zeeb authored
      Fix a last minute change from d4a4960c
      based on review feedback in where a function now gets called before
      it is declared which did not fully get merged back to my commit branch.
      
      Noticed by:	CI, jkim
      MFC after:	10 days
      X-MFC with:	d4a4960c
      Sponsored-by:	The FreeBSD Foundation
      5f88df77
    • Bjoern A. Zeeb's avatar
      41dfd8bd
    • Bjoern A. Zeeb's avatar
      LinuxKPI: avoid userret: Returning with with pinned thread · 46ae23a4
      Bjoern A. Zeeb authored
      Some code manually calls local_bh_disable() and spin_lock() but
      then calls spin_unlock_bh() (or vice versa).
      Our code then calls local_bh_disable() again from spin_lock()
      which means we have the thread pin count increased twice and that
      means we get out of synch and are still pinned when returning to
      user space.
      
      Avoid this by adding the explicit local_bh_{enable,disable}() to
      the spin_[un]lock_bh() versions.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	2 weeks
      Reviewed by:	hselasky
      Differential Revision: https://reviews.freebsd.org/D30711
      46ae23a4
    • Bjoern A. Zeeb's avatar
      LinuxKPI: fix sg_pcopy_from_buffer() · edfcdffe
      Bjoern A. Zeeb authored
      In sg_pcopy_from_buffer() is an error in that skip can underflow
      and lead to bogus page arithmetics which may lead to memory corruption
      or more likely panics.  Once we found a s/g page to copy into there
      is nothing to skip anymore so simply set skip to 0.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	5 days
      Reviewed by:	hselasky
      Differential Revision: https://reviews.freebsd.org/D30676
      edfcdffe
    • Bjoern A. Zeeb's avatar
      LinuxKPI: pci: cleanup some code and add support for "pcim" (managed) · d4a4960c
      Bjoern A. Zeeb authored
      Restructure some code and add support for various "managed" versions
      for PCI resource management.
      This is beyond of what iwlwifi needs but some was found with other
      wireless drivers and it mostly all goes together.
      Add one FreeBSD sepcific feature returning the resource rather than
      the handle to allow us to use bus_*() functions in drivers directly.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	10 days
      Reviewed by:	hselasky
      Differential Revision: https://reviews.freebsd.org/D30558
      d4a4960c
    • Bjoern A. Zeeb's avatar
      LinuxKPI: fix pci device devres initialisation · c3518147
      Bjoern A. Zeeb authored
      Given we are manually setting up the "device" in PCI in some cases,
      we need to initialise the list and lock for device devres here as well
      as otherwise we will panic on the uninitialised lock.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	5 days
      Reviewed by:	hselasky
      Differential Revision: https://reviews.freebsd.org/D30681
      c3518147
    • Bjoern A. Zeeb's avatar
      LinuxKPI: enhance the irq KPI for managed and threaded operations. · d16b6cb1
      Bjoern A. Zeeb authored
      Move request_irq() to an internal function which serves request_irq()
      and the newly added request_threaded_irq() and devm_request_threaded_irq().
      Likewise factor out parts of free_irq() to also be used with
      devm_free_irq().  Add the storage and call to a thread_handler in case
      of IRQ_WAKE_THREAD.
      This is needed for the iwlwifi driver.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	10 days
      Reviewed by:	hselasky
      Differential Revision: https://reviews.freebsd.org/D30549
      d16b6cb1
    • Bjoern A. Zeeb's avatar
      LinuxKPI: extend pci.h by various functions for wireless driver · 8e106c52
      Bjoern A. Zeeb authored
      Add dummy functions for dealing with "HotPlug" events which we currently
      do not support.
      
      Add pci_dev_get(), pci_find_ext_capability() and pci_pme_capable().
      
      The added pcie_find_root_port() is a bit special as we need to create
      another linux pci device;  for that make lkpinew_pci_dev() public
      which is also helpful for other cases when we want to use the Linux
      routines to check for device identifiers only and need a container
      for the "bsddev" to use natively.  This has proven to avoid basic
      checking code for the sake of rewriting it to native field names
      elsewhere.  Given we cache the newly created "root" we also need to
      make sure we clean it up.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	10 days
      Reviewed by:	hselasky
      Differential Revision: https://reviews.freebsd.org/D30521
      8e106c52
    • Bjoern A. Zeeb's avatar
      LinuxKPI: add dmam_pool_create() support · 2afeed13
      Bjoern A. Zeeb authored
      dmam_pool_create() is a "managed" version of dma_pool_create() which
      will cleanup everything left when the device goes away using the
      devres framework.  For that add an internal cleanup function to be
      called from devres release.
      This is used by at least one wireless driver.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	10 days
      Reviewed by:	hselasky
      Differential Revision: https://reviews.freebsd.org/D30520
      2afeed13
    • Bjoern A. Zeeb's avatar
      LinuxKPI: add device_reprobe() and device_release_driver() · 644b4f11
      Bjoern A. Zeeb authored
      Add two new (though untested) functions to linux/device.h which are
      dealing with manually managing the device/driver and are used by
      at least one wireless driver.  We may have to re-fine them in the
      future.
      Move the devres declarations further up so they can be used earlier
      in the file.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	10 days
      Reviewed by:	imp
      Differential Revision: https://reviews.freebsd.org/D30519
      644b4f11
    • Bjoern A. Zeeb's avatar
      mlx4/OFED: replace the struct net_device with struct ifnet · 1411f52f
      Bjoern A. Zeeb authored
      Given all the code does operate on struct ifnet, the last step in this
      longer series of changes now is to rename struct net_device to
      struct ifnet (that is what it was defined to in the LinuxKPi code).
      While mlx4 and OFED are "shared" code the decision was made years ago
      to not write it based on the netdevice KPI but the native ifnet KPI
      for most of it.  This commit simply spells this out and with that
      frees "struct netdevice" to be re-done on LinuxKPI to become a more
      native/mixed implementation over time as needed by, e.g., wireless
      drivers.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	10 days
      Reviewed by:	hselasky
      Differential Revision: https://reviews.freebsd.org/D30515
      1411f52f
    • Bjoern A. Zeeb's avatar
      LinuxKPI: add KPI for netdev_notifier_info returning ifp · 801cf532
      Bjoern A. Zeeb authored
      While currently the ifp gets cast to a net_device and then returned
      and consumers are expecting an ifp again, allow parallel usage now and
      in the future by extending and also passing the ifp directly back in
      the netdev_notifier_info.  Add a function to return the ifp instead of
      the net_device.
      
      Sponsored by:	The FreeBSD Foundation
      MFC after:	10 days
      Suggested by:	hselasky
      Reviewed by:	hselasky
      Differential Revision: https://reviews.freebsd.org/D30522
      801cf532
    • Jamie Gritton's avatar
      jail: Don't allow substitution of valueless jail parameters. · 5bf6dca2
      Jamie Gritton authored
      PR:		256544
      Reported by:	cryptogranny at gmail.com
      5bf6dca2
    • Mariusz Zaborski's avatar
      sockstat: use cap_pwd · 7ad30f58
      Mariusz Zaborski authored
      The sockstat is using password database operations to obtain
      the username. Such operations are disallowed in capability mode.
      For such operations Casper is required.
      
      Reported by:	olivier@
      Tested by:	olivier@
      7ad30f58
    • Mariusz Zaborski's avatar
      sockstat: fix core dump · bfb5947b
      Mariusz Zaborski authored
      The get_proto_type function is used before creating the Casper function.
      This is why we have to distinguish when the Casper service is allocated or not.
      
      Reported by:	olivier@
      Tested by:	olivier@
      bfb5947b
    • Warner Losh's avatar
      NOTES: fix typo · 7bd29575
      Warner Losh authored
      Noted by:		gj@
      Sponsored by:		Netflix
      7bd29575
    • Warner Losh's avatar
      man9: add hz(9) and hardclock(9) · 4c0bc591
      Warner Losh authored
      Document aspects of system time keeping. Hz is the nominal rate that we
      interrupt the system and is known and the 'tick' period of 1 / hz.
      hardclock is the routine that does various bits of timekeeping.  stathz
      and profhz are documented as historical relics that are deprecated
      and replaced by hwpmc.4 and others.
      
      Reviewed by:		phk@, mav@ and gnn@ (previous version)
      Obtained from:		hardclock.9 from NetBSD (with FreeBSD adjustments)
      Sponsored by:		Netflix
      Differential Revision:	https://reviews.freebsd.org/D30802
      4c0bc591
    • Warner Losh's avatar
      NOTES: Update the HZ entry with latest advice. · 0f882bb1
      Warner Losh authored
      Sponsored by:		Netflix
      Differential Revision:	https://reviews.freebsd.org/D30804
      0f882bb1
    • Alan Somers's avatar
      periodic: by default, skip 221.backup-gpart in jails · fcf2227a
      Alan Somers authored
      It can still be enabled as usual in /etc/periodic.conf
      
      PR:		256253
      Reported by:	delphij
      Submitted by:	Miroslav Lachman <000.fbsd@quip.cz>
      MFC after:	2 weeks
      fcf2227a
    • Ceri Davies's avatar
      secure/caroot, certctl: Rename secure/caroot/blacklisted · 64e6e1e4
      Ceri Davies authored
      Old certctl commands still work for compatability, but are deprecated.
      
      Approved by:	secteam (gordon)
      Differential Revision: https://reviews.freebsd.org/D30807
      64e6e1e4
    • Ceri Davies's avatar
      devmatch: improve naming of devmatch config variable · c43b0081
      Ceri Davies authored
      Accept the old rc.conf variable if the new one is not present for
      compatability.
      
      Approved by:	imp
      Differential Revision:	https://reviews.freebsd.org/D30806
      c43b0081
  3. 17 Jun, 2021 11 commits