FreeBSD/src 342104head/sys/dev/tpm tpm_tis.c tpm_crb.c

Fix error check for ACPI_ID_PROBE in the TPM2.0 driver

Updated API does not return pointer, so adjust the
TPM2.0 driver accordingly.

Reported by: jhb
Obtained from: Semihalf
Sponsored by: Stormshield

FreeBSD/src 342103stable 11, stable/11/etc crontab

MFC: r334909 | imp

Set the  $PATH in /etc/crontab like it is set by the cron(8)
daemon, for consistency.

Submitted by: Ben RUBSON
Pull Request: https://github.com/freebsd/freebsd/pull/155

FreeBSD/src 342102head/sys/dev/iicbus/twsi twsi.h mv_twsi.c

[twsi] Make extres/clk part conditional based on the EXT_RESOURCES option value

This should fix kernel build for ARMADA38X and possibly some other ARM configs

Approved by:    manu

FreeBSD/src 342101head/lib/libnv msgio.c

Allow bootstrapping libnv on macOS and Linux

MacOS/Linux do not define struct cmsgcred but we need to bootstrap libnv
when building on non-FreeBSD systems. Since they are not used during
bootstrap we can just omit these two functions there.

Reviewed By:    emaste
Differential Revision: https://reviews.freebsd.org/D18472

FreeBSD/src 342100head/sys/riscv/riscv trap.c

Add some more checking to the RISC-V page fault handler.

- Panic immediately if witness says we're holding non-sleepable locks.
  This helps ensure that we don't recurse on the pmap lock in
  pmap_fault_fixup().
- Panic if the kernel faults on a user address without setting an
  onfault handler.
- Panic if the fault occurred in a critical section or interrupt
  handler, like we do on other platforms.
- Fix some style issues in trap_pfault().

Reviewed by:    jhb
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D18561

FreeBSD/src 342099head/sys/riscv/riscv pmap.c

Avoid needless TLB invalidations in pmap_remove_pages().

pmap_remove_pages() is called during process termination, when it is
guaranteed that no other CPU may access the mappings being torn down.
In particular, it unnecessary to invalidate each mapping individually
since we do a pmap_invalidate_all() at the end of the function.

Also don't call pmap_invalidate_all() while holding a PV list lock, the
global pvh lock is sufficient.

Reviewed by:    jhb
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D18562

FreeBSD/src 342098head/sys/riscv/riscv pmap.c

Assume that pmap_l1() will return a PTE.

pmaps on RISC-V always have an L1 page table page, so we don't need to
check for this when performing lookups.

Reviewed by:    jhb
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D18563

FreeBSD/src 342097head/sys/riscv/conf QEMU

Add a QEMU config for RISC-V.

Reviewed by:    jhb
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D18560

FreeBSD/src 342096head/sys/riscv/conf GENERIC

Enable witness(4) in the RISC-V GENERIC config.

Reviewed by:    jhb
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D18559

FreeBSD/src 342095head/sys/mips/include atomic.h

atomic_cmpset return value is also an int.

FreeBSD/src 342094head/sys/mips/include atomic.h

atomic_fcmpset* return int, not the type of *.

fcmpset returns true/false as a int, so make the return types and
variables match the int to be consistent with other arch.

Reviewed by: cognet@
Differential Revision: https://reviews.freebsd.org/D18557

FreeBSD/src 342093head/sys/riscv/riscv pmap.c

Clean up the riscv pmap_bootstrap() implementation.

- Build up phys_avail[] in a single loop, excluding memory used by
  the loaded kernel.
- Fix an array indexing bug in the aforementioned phys_avail[]
  initialization.[1]
- Remove some unneeded code copied from the arm64 implementation.

PR:            231515 [1]
Reviewed by:    jhb
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D18464

FreeBSD/src 342092stable 12, stable/12/sys/riscv/include vmparam.h

MFC r341694:
Update the description of the address space layout on RISC-V.

FreeBSD/src 342091head/sys/arm/allwinner aw_pwm.c

allwinner: aw_pwm: Read value at attach

The booloaded might have configured the pwm controller so read the values.

FreeBSD/src 342090stable 12, stable/12/sys/riscv/include cpufunc.h

MFC r341693:
Rename sptbr to satp per v1.10 of the privileged architecture spec.

FreeBSD/src 342089stable 12, stable/12/lib/libcasper/services/cap_syslog cap_syslog.c

MFC r341692:
Let the cap_syslog capability inherit stdio descriptors.

FreeBSD/src 342088head/usr.sbin/pwm pwm.c pwm.8

pwm(8): Add percentage value support for duty cycle

FreeBSD/src 342087head/sys/arm/allwinner aw_pwm.c, head/sys/dev/pwm pwm_if.m pwmbus_if.m

pwm: Convert period and duty to unsigned int

We don't need a 64 bits value to store nanoseconds

Discused with:  ian, jhibbits

FreeBSD/src 342086head/sys/dev/nfe if_nfe.c if_nfereg.h

Add support for the nForce MCP89 adapter.

PR:            234015
Submitted by:   Andrejs Bogdanovs <sinchiroca86 at gmail.com>
MFC after:      1 week

FreeBSD/src 342085head/sys/dev/tpm tpm_crb.c tpm_tis.c

Fix TPM driver compilation from r342084

Include recent ACPI_ID_PROBE API change.

FreeBSD/src 342084head/sys/conf files.amd64, head/sys/dev/tpm tpm_tis.c tpm_crb.c

Introduce driver for TPM 2.0 in CRB and FIFO (TIS) modes

It was written basing on:
TCG PC Client Platform TPM Profile (PTP) Specification Version 22, Revision 1.03.
It only supports Locality 0. Interrupts are only supported in FIFO mode.

The driver in FIFO mode was tested on x86 with Infineon SLB9665 discrete TPM chip.
Driver in both modes was also tested on qemu with swtpm running on host.

Submitted by: Kornel Duleba <mindal at semihalf.com>
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D18048

FreeBSD/src 342083stable 12, stable/12/usr.sbin/bhyve pci_virtio_scsi.c bhyve.8

MFC r341829: Allow CTL device specification in bhyve virtio-scsi.

There was a large refactoring done in CTL to allow multiple ioctl frontend
ports (and respective devices) to be created, particularly for bhyve.
Unfortunately, respective part of bhyve functionality got lost somehow from
the original virtio-scsi commit.  This change allows wanted device path to
be specified in either of two ways:
 -s 6,virtio-scsi,/dev/cam/ctl1.1
 -s 6,virtio-scsi,dev=/dev/cam/ctl2.3
If neither is specified, the default /dev/cam/ctl device is used.

While there, remove per-queue CTL device opening, which makes no sense at
this point.

FreeBSD/src 342082stable 12, stable/12/usr.sbin/bhyve pci_virtio_scsi.c

MFC r341706: Make virtio-scsi pass SCSI Task Attributes to CTL.

FreeBSD/src 342081stable 12, stable/12/usr.sbin/bhyve pci_virtio_scsi.c

MFC r341704: Fill initid explicitly on requests.

Unfortunately ctl_scsi_zero_io() wipes that field, so it was always zero.
While there, targ_port is set by kernel, so user-space should not fill it.

FreeBSD/src 342080stable 12, stable/12/usr.sbin/bhyve iov.c iov.h

MFC r341705: Fix several iov handling bugs in bhyve virtio-scsi backend.

 - buf_to_iov() does not use buflen parameter, allowing out of bound read.
 - buf_to_iov() leaks memory if seek argument > 0.
 - iov_to_buf() doesn't need to reallocate buffer for every segment.
 - there is no point to use size_t for iov counts, int is more then enough.
 - some iov function arguments can be constified.
 - pci_vtscsi_request_handle() used truncate_iov() incorrectly, allowing
   getting out of buffer and possibly corrupting data.
 - pci_vtscsi_controlq_notify() written returned status at wrong offset.
 - pci_vtscsi_controlq_notify() leaked one buffer per event.

FreeBSD/src 342079head/sys/dev/mrsas mrsas_cam.c

Compilation failure on ppc and mips due to Revision 342066.
Adding extra memset on chain frame.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342078stable 11, stable/11/sys/arm/include atomic-v6.h

MFC r341679:

  Fix cut&paste typo in atomic_fetchadd_64().

FreeBSD/src 342077stable 12, stable/12/sys/arm/include atomic-v6.h

MFC r341679:

  Fix cut&paste typo in atomic_fetchadd_64().

FreeBSD/src 342076head/sys/arm/allwinner axp81x.c

arm64: allwinner: axp81x: Fix double invertion for FLDO1

This fix booting on A64 boards when disabling the unused regulators at boot.
We did disable all the regulator handled by register 0x13 which of course contain
mandatory regulators for the board to be up.

Reported by:    Mark Millard <marklmi at yahoo.com>
X-MFC-With:     r340848

FreeBSD/src 342075stable 11, stable/11/libexec/rtld-elf/aarch64 reloc.c rtld_start.S

MFC r341511,r341512,r341513:

  r341511:
    Fix style(9). Not a functional change.
  r341512:
    Implement arm64 version of __tls_get_addr().
  r341513:
    Tidy up arm64 reloc_jmpslots() implementation.
    - don't relocate jump slots multiple times (if LD_BIND_NOW is defined).
    - process only R_AARCH64_JUMP_SLOT here, other relocation types are
      handled by reloc_plt().

FreeBSD/src 342074stable 12, stable/12/libexec/rtld-elf/aarch64 reloc.c rtld_start.S

MFC r341511,r341512,r341513:

  r341511:
    Fix style(9). Not a functional change.
  r341512:
    Implement arm64 version of __tls_get_addr().
  r341513:
    Tidy up arm64 reloc_jmpslots() implementation.
    - don't relocate jump slots multiple times (if LD_BIND_NOW is defined).
    - process only R_AARCH64_JUMP_SLOT here, other relocation types are
      handled by reloc_plt().

FreeBSD/src 342073head/sys/dev/ichwd ichwd.c ichwd.h

ichwd: add Sunrise Point-LP ID

Submitted by:   Tetsuya Uemura <t_uemura at macome.co.jp>
Tested by:      Tetsuya Uemura <t_uemura at macome.co.jp>
MFC after:      2 weeks
Relnotes:       maybe

FreeBSD/src 342072head/sys/dev/ichwd ichwd.c ichwd.h

ichwd: add support for clearing No Reboot bit in TCOv4

This is based on a patch developed by
Tetsuya Uemura <t_uemura at macome.co.jp>.
Many thanks!

Submitted by:   Tetsuya Uemura <t_uemura at macome.co.jp> (earlier version)
Tested by:      Tetsuya Uemura <t_uemura at macome.co.jp>
MFC after:      2 weeks

FreeBSD/src 342071head/share/man/man4 ng_bpf.4

ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode

PR:            102719
MFC after:      3 days

FreeBSD/src 342070stable 12, stable/12/sys/dev/netmap ixgbe_netmap.h if_ixl_netmap.h

MFC r341680

netmap: remove dead code obsoleted by iflib

The iflib subsystem implements netmap support in a driver-independent
way (sys/net/iflib.c). We can therefore remove the headers that
used to implement netmap support for all the drivers now supported
by iflib (em, igb, ixl, ixgbe, lem).

FreeBSD/src 342069head/sys/dev/mrsas mrsas.h

Driver version upgrade 07.708.02.00-fbsd

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342068head/sys/dev/mrsas mrsas.c

This patch will increase debug level as current logging level has
very minimal prints and even few important messages will not get logged.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342067head/sys/dev/mrsas mrsas.c mrsas.h

Change IOC INIT wait time to 180 secs to keep it inline with timeout
used by internal DCMDs.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342066head/sys/dev/mrsas mrsas_cam.c mrsas.h

This patch will add support for NVME PRPs creation by driver for fastpath
capable IOs. NVME specification supports specific type of scatter gather list
called as PRP (Physical Region Page) for IO data buffers. Since NVME drive is
connected behind SAS3.5 tri-mode adapter, MegaRAID driver/firmware has to convert
OS SGLs in native NVMe PRP format. For IOs sent to firmware, MegaRAID firmware
does this job of OS SGLs to PRP translation and send PRPs to backend NVME device.
For fastpath IOs, driver will do this OS SGLs to PRP translation.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342065head/sys/dev/mrsas mrsas.h mrsas.c

This patch will add support for new DCMD to get PD information and a single data structure
to specify LD and JBOD.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342064head/sys/dev/mrsas mrsas_cam.c mrsas.c

To improve RAID 1/10 Write performance, OS drivers need to issue the
required Write IOs as Fast Path IOs (after the appropriate checks
allowing Fast Path to be used) to the appropriate physical drives
(translated from the OS logical IO) and wait for all Write IOs to complete.

Design: A write IO on RAID volume will be examined if it can be sent in
Fast Path based on IO size and starting LBA and ending LBA falling on to
a Physical Drive boundary. If the underlying RAID volume is a RAID 1/10,
driver issues two fast path write IOs one for each corresponding physical
drive after computing the corresponding start LBA for each physical drive.
Both write IOs will have the same payload and are posted to HW such that
replies land in the same reply queue.

If there are no resources available for sending two IOs, driver will send
the original IO from upper layer to RAID volume through the Firmware.

When both IOs are completed by HW, the resources will be released
and SCSI IO completion handler will be called.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342063head/sys/dev/mrsas mrsas_cam.c mrsas.c

Detect sequential Write IOs and pass the hint that it is part of sequential
stream to help HBA Firmware do the Full Stripe Writes. For read IOs on
certain RAID volumes like Read Ahead volumes,this will help driver to
send it to Firmware even if the IOs can potentially be sent to
hardware directly (called fast path) bypassing firmware.

Design: 8 streams are maintained per RAID volume as per the combined
firmware/driver design. When there is no stream detected the LRU stream
is used for next potential stream and LRU/MRU map is updated to make this
as MRU stream. Every time a stream is detected the MRU map
is updated to make the current stream as MRU stream.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342062head/sys/dev/mrsas mrsas.h mrsas_cam.c

This patch will add new interface to support more than 256 JBODs.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342061head/sys/dev/mrsas mrsas_cam.c mrsas.h

This patch will add support for divert bitmap in RAID map. Divert bitmap is supported for
SAS3.5 adapters only.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342060head/sys/dev/mrsas mrsas_fp.c mrsas.h

This patch will add support for new Dynamic RaidMap to have different sizes
for different number of supported VDs for SAS3.5 MegaRAID adapters.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342059head/sys/dev/mrsas mrsas.c mrsas.h

This patch will add support for next generation(SAS3.5) of Tri mode(SAS, SATA, NVMe)
MegaRAID adapters.

Submitted by: Sumit Saxena <sumit.saxena at broadcom.com>
Reviewed by:  Kashyap Desai <Kashyap.Desai at broadcom.com>
Approved by:  ken
MFC after:  3 days
Sponsored by:   Broadcom Inc

FreeBSD/src 342058head/sys/kern kern_descrip.c vfs_lookup.c, head/sys/sys filedesc.h

vfs: mostly depessimize NDINIT_ALL

1) filecaps_init was unnecesarily a function call
2) an asignment at the end was preventing tail calling of cap_rights_init

Sponsored by:   The FreeBSD Foundation

FreeBSD/src 342057head/crypto/openssl/crypto/engine eng_devcrypto.c

Do not complain when /dev/crypto does not exist.

Now the new devcrypto engine is enabled since r342009, many users started
seeing "Could not open /dev/crypto: No such file or directory".  Disable
the annoying error message as it is not very useful anyway.

Note the patch was submitted upstream.

https://github.com/openssl/openssl/pull/7896

FreeBSD/src 342056head/sys/contrib/dev/acpica changes.txt, head/sys/contrib/dev/acpica/compiler aslerror.c aslcompile.c

MFV:    r342049

Merge ACPICA 20181213.

FreeBSD/src 342055head/stand/efi/loader efi_main.c

Cast error message in efi_main.c to CHAR16* to avoid build error