]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
dim [Sat, 20 Jun 2020 20:06:52 +0000 (20:06 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
llvmorg-10.0.0-97-g6f71678ecd2 (not quite 10.0.1 rc2, as more fixes are
still pending).

MFC after: 3 weeks

3 years agoRevert -r362422.
imp [Sat, 20 Jun 2020 20:06:14 +0000 (20:06 +0000)]
Revert -r362422.

While whimsical, there's too much negative energy around minion as well as the
positive.

3 years agoVendor import of llvm-project branch release/10.x
dim [Sat, 20 Jun 2020 18:49:12 +0000 (18:49 +0000)]
Vendor import of llvm-project branch release/10.x
llvmorg-10.0.0-97-g6f71678ecd2.

3 years agoRegen after r362440.
trasz [Sat, 20 Jun 2020 18:31:02 +0000 (18:31 +0000)]
Regen after r362440.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

3 years agoAdd linux_madvise(2) instead of having Linux apps call the native
trasz [Sat, 20 Jun 2020 18:29:22 +0000 (18:29 +0000)]
Add linux_madvise(2) instead of having Linux apps call the native
FreeBSD madvise(2) directly.  While some of the flag values match,
most don't.

PR: kern/230160
Reported by: markj
Reviewed by: markj
Discussed with: brooks, kib
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25272

3 years agooce(4): Account and trace mbufs before handing to hw
cem [Sat, 20 Jun 2020 17:22:46 +0000 (17:22 +0000)]
oce(4): Account and trace mbufs before handing to hw

Once tx mbufs have been handed to hardware, nothing serializes the tx
path against completion and potential use-after-free of the outbound
mbuf.  Perform accounting and BPF tap before queueing to hardware to
avoid this race.

Submitted by: Steve Wirtz <steve_wirtz AT dell.com>
Reviewed by: markj, rstone
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D25364

3 years agoImprove debug message to be more precise and clear.
hselasky [Sat, 20 Jun 2020 14:16:24 +0000 (14:16 +0000)]
Improve debug message to be more precise and clear.

For the sake of the record, this is the last use of the words master and slave
in the FreeBSD's USB stack, drivers and subsystems.

MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agojoin(1): Add EXAMPLES section
fernape [Sat, 20 Jun 2020 11:27:59 +0000 (11:27 +0000)]
join(1): Add EXAMPLES section

Add EXAMPLES covering options -e, -o, -t, -v, -1

Approved by: 0mp@
Differential Revision: https://reviews.freebsd.org/D25186

3 years agoseq(1): complete EXAMPLES section
fernape [Sat, 20 Jun 2020 11:24:29 +0000 (11:24 +0000)]
seq(1): complete EXAMPLES section

* Add a small description before the EXAMPLES that are already in the man page
  to explicitely state what we are trying to show instead of having the user
  guess what the example is doing.

* Add two more examples to show usage of -s, -t and -f

* mandoc -Tlint reports irrelevant use of .Tn so remove them since according to
  mdoc(7) it is there only for compatibility and should not be used in new
  manuals.

Approved by: 0mp@

3 years agocmp(1): Add EXAMPLES section
fernape [Sat, 20 Jun 2020 11:20:16 +0000 (11:20 +0000)]
cmp(1): Add EXAMPLES section

Add a small number of examples depicting the use of -l, -z and byte offsets

Approved by: 0mp@

3 years agoloader: libofw build is missing sys/list.h after r362431
tsoome [Sat, 20 Jun 2020 08:22:57 +0000 (08:22 +0000)]
loader: libofw build is missing sys/list.h after r362431

Add another include path

3 years agoloader: fix libofw build after r362431
tsoome [Sat, 20 Jun 2020 07:46:43 +0000 (07:46 +0000)]
loader: fix libofw build after r362431

3 years agoloader: create single zfs nextboot implementation
tsoome [Sat, 20 Jun 2020 06:23:31 +0000 (06:23 +0000)]
loader: create single zfs nextboot implementation

We should have nextboot feature implemented in libsa zfs code.
To get there, I have created zfs_nextboot() implementation based on
two sources, our current simple textual string based approach with added
structured boot label PAD structure from OpenZFS.

Secondly, all nvlist details are moved to separate source file and
restructured a bit. This is done to provide base support to add nvlist
add/update feature in followup updates.

And finally, the zfsboot/gptzfsboot disk access functions are swapped to use
libi386 and libsa.

Sponsored by: Netflix, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25324

3 years agoMake vipw error message less cryptic
pstef [Sat, 20 Jun 2020 06:20:00 +0000 (06:20 +0000)]
Make vipw error message less cryptic

Unable to find an editor, vipw would give this error:
# env EDITOR=fnord vipw
vipw: pw_edit(): No such file or directory

vigr or crontab do better:
# env EDITOR=fnord crontab -e
crontab: no crontab for root - using an empty one
crontab: fnord: No such file or directory
crontab: "fnord" exited with status 1

After this change, vipw behaves more like vigr or crontab:
# env EDITOR=fnord vipw
vipw: fnord: No such file or directory
vipw: "fnord" exited with status 1

Reviewed by: rpokala, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25369

3 years agolibutil: remove extraneous ": " from error messages
pstef [Sat, 20 Jun 2020 06:10:42 +0000 (06:10 +0000)]
libutil: remove extraneous ": " from error messages

Each of the err() family of functions already takes care of that.

3 years agoIncrease the whimsy in this file by famring dump's work out to minions. Adjust
imp [Sat, 20 Jun 2020 04:19:17 +0000 (04:19 +0000)]
Increase the whimsy in this file by famring dump's work out to minions. Adjust
variables accordingly. Thankfully, we are able to do this without additional
banana expenditures.

3 years agoraspberry pi 4: cpufreq support
kevans [Sat, 20 Jun 2020 04:07:58 +0000 (04:07 +0000)]
raspberry pi 4: cpufreq support

The submitter notes that the bcm2835_cpufreq driver really just needs the
rpi4 compat string added to it; powerd subsequently works and the dev.cpu.0
sysctl values look sane and can be successfully manipulated.

Submitted by: James Mintram <me@jamesrm.com>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D25349

3 years agoCorrect 1BSD release date.
imp [Sat, 20 Jun 2020 04:07:44 +0000 (04:07 +0000)]
Correct 1BSD release date.

The Quarter Century of Unix book said that 1BSD was released March 1979.
However, the 1BSD tape image that's on Kirk's historical unix collection has an
earlier date.

It was common practice, at the time, to create a new copy of the tape from the
master system when a new tape was to go out, so several different versions of
1BSD, etc were shipped from Berkerely. The date on the 1BSD tape in the Berkeley
archives on Kirk's DVD is dated in January 16 1979 on the label, and has dates
as late as Jan 29 (there's an UPDATE file that says this includes updates
through this date). Note this date as well.

3 years agoUse the more descriptive src_ccb and dst_ccb for the two ccbs being merged.
imp [Sat, 20 Jun 2020 04:07:23 +0000 (04:07 +0000)]
Use the more descriptive src_ccb and dst_ccb for the two ccbs being merged.

MFC after: 1 week

3 years agoAllocate an fs_summary_info structure when creating a UFS filesystem
mckusick [Fri, 19 Jun 2020 23:32:40 +0000 (23:32 +0000)]
Allocate an fs_summary_info structure when creating a UFS filesystem
needed since introduced in -r362358.

PR:           247425
Sponsored by: Netflix

3 years agoAdd warnings for unsupported Linux clockids.
trasz [Fri, 19 Jun 2020 19:33:06 +0000 (19:33 +0000)]
Add warnings for unsupported Linux clockids.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25322

3 years agoImprove if_dwc:
mmel [Fri, 19 Jun 2020 19:26:55 +0000 (19:26 +0000)]
Improve if_dwc:
 - refactorize packet receive path. Make sure that we don't leak mbufs
   and/or that we don't create holes in RX descriptor ring
 - slightly simplify handling with TX descriptors

MFC after: 4 weeks

3 years agomd5(1): fix -c flag to work with input on stdin
allanjude [Fri, 19 Jun 2020 19:16:25 +0000 (19:16 +0000)]
md5(1): fix -c flag to work with input on stdin

Previously, the -p and -c flags were ignored when reading from stdin
Additionally, -s and -c can be used together now.

PR: 247295
Reviewed by: kevans
MFC after: 2 weeks
Relnotes: yes
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25362

3 years ago[PowerPC] Add virtio to GENERIC
bdragon [Fri, 19 Jun 2020 18:43:13 +0000 (18:43 +0000)]
[PowerPC] Add virtio to GENERIC

Due to kldxref not being able to generate hints for nonnative platforms,
any cross built VM images do not have /boot/kernel/linker.hints.

This prevents the virtio modules from being loaded, as the fallback code
will always fail the version check when the hints are missing.

Since we want to be able to generate VM images for 32 bit powerpc, add the
virtio modules to GENERIC like we do on powerpc64.

Reviewed by: jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D25271

3 years ago[PowerPC] Fix booke64 qemu infinite loop in L2 cache enable
bdragon [Fri, 19 Jun 2020 18:40:39 +0000 (18:40 +0000)]
[PowerPC] Fix booke64 qemu infinite loop in L2 cache enable

Since qemu does not implement the L2 cache, we get stuck forever waiting
for a bit to be set when trying to invalidate it.

To prevent that, we should bail out if the L2 cache is missing.
One easy way to check this is L2CFG0 == 0 (since L2CSIZE always has at
least one bit set in a valid implementation)

(tested on qemu, rb800, and x5000)

Reviewed by: jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D25225

3 years ago[PowerPC] De-giant powermac_nvram, update documentation
bdragon [Fri, 19 Jun 2020 18:36:10 +0000 (18:36 +0000)]
[PowerPC] De-giant powermac_nvram, update documentation

* Remove the giant lock requirement from powermac_nvram.
* Update manual pages to reflect current state.

Reviewed by: bcr (manpages), jhibbits
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D24812

3 years agoFinish renaming in if_dwc.
mmel [Fri, 19 Jun 2020 18:34:27 +0000 (18:34 +0000)]
Finish renaming in if_dwc.
By using DWC TRM terminology, normal descriptor format should be named
extended and alternate descriptor format should be named normal.

Should not been functional change.

MFC after: 4 weeks

3 years agoUse naming nomenclature used in DesignWare TRM.
mmel [Fri, 19 Jun 2020 18:04:41 +0000 (18:04 +0000)]
Use naming nomenclature used in DesignWare TRM.
Use naming nomenclature used in DesignWare TRM.
This driver was written by using Altera (now Intel) documentation for Arria
FPGA manual. Unfortunately this manual used very different (and in some cases
opposite naming) for registers and descriptor fields. Unfortunately,
this makes future expansion extremely hard.

Should not been functional change.

MFC after: 4 weeks

3 years agoUse the correct address when creating pci resources
andrew [Fri, 19 Jun 2020 18:00:20 +0000 (18:00 +0000)]
Use the correct address when creating pci resources

When the PCI and CPU physical addresses are identical it doesn't matter
which is used to create the resources, however on some systems, e.g.
qemu armv7 virt, they are different. This leads to a panic as we try to
map the wrong physical address into the kernel address space.

Reported by: Jenkins via trasz
Sponsored by: Innovate UK

3 years agoZFS: Allow setting checksum=skein on boot pools
allanjude [Fri, 19 Jun 2020 17:59:55 +0000 (17:59 +0000)]
ZFS: Allow setting checksum=skein on boot pools

PR: 245889
Reported by: delphij
Sponsored by: Klara Inc.

3 years agoAdapt ARMADA8k PCIe driver to newly imported 5.7 DT.
mmel [Fri, 19 Jun 2020 17:33:54 +0000 (17:33 +0000)]
Adapt ARMADA8k PCIe driver to newly imported 5.7 DT.
- temporarily disable handling with phy, we don't have driver for it yet
- always clear cause for administartive interrupt.
While I'm in, fix style(9) (mainly whitespace).

MFC after: 4 weeks

3 years agoRevert r362389, it was committed with <patch>.diff instead of <patch>.txt as
mmel [Fri, 19 Jun 2020 17:32:50 +0000 (17:32 +0000)]
Revert r362389, it was committed with <patch>.diff instead of <patch>.txt as
commit log.

3 years agoSkip ufs related tests in fstyp(8) and makefs(8) temporarily
lwhsu [Fri, 19 Jun 2020 17:32:30 +0000 (17:32 +0000)]
Skip ufs related tests in fstyp(8) and makefs(8) temporarily

They are failing after r362358 and r362359.

PR: 247425
Sponsored by: The FreeBSD Foundation

3 years agodiff --git a/sys/dev/pci/pci_dw_mv.c b/sys/dev/pci/pci_dw_mv.c
mmel [Fri, 19 Jun 2020 17:25:54 +0000 (17:25 +0000)]
diff --git a/sys/dev/pci/pci_dw_mv.c b/sys/dev/pci/pci_dw_mv.c
index 06a29fefbdd..571fc00f6c1 100644
--- a/sys/dev/pci/pci_dw_mv.c
+++ b/sys/dev/pci/pci_dw_mv.c
@@ -64,15 +64,11 @@ __FBSDID("$FreeBSD$");

 #define MV_GLOBAL_CONTROL_REG 0x8000
 #define PCIE_APP_LTSSM_EN (1 << 2)
-//#define PCIE_DEVICE_TYPE_SHIFT 4
-//#define PCIE_DEVICE_TYPE_MASK 0xF
-//#define PCIE_DEVICE_TYPE_RC 0x4/

 #define MV_GLOBAL_STATUS_REG 0x8008
 #define  MV_STATUS_RDLH_LINK_UP (1 << 1)
 #define  MV_STATUS_PHY_LINK_UP (1 << 9)

-
 #define MV_INT_CAUSE1 0x801C
 #define MV_INT_MASK1 0x8020
 #define  INT_A_ASSERT_MASK (1 <<  9)
@@ -90,11 +86,7 @@ __FBSDID("$FreeBSD$");
 #define MV_ARUSER_REG 0x805C
 #define MV_AWUSER_REG 0x8060

-
-
 #define MV_MAX_LANES 8
-
-
 struct pci_mv_softc {
  struct pci_dw_softc dw_sc;
  device_t dev;
@@ -112,7 +104,6 @@ static struct ofw_compat_data compat_data[] = {
  {NULL,     0},
 };

-
 static int
 pci_mv_phy_init(struct pci_mv_softc *sc)
 {
@@ -121,18 +112,23 @@ pci_mv_phy_init(struct pci_mv_softc *sc)
  for (i = 0; i < MV_MAX_LANES; i++) {
  rv =  phy_get_by_ofw_idx(sc->dev, sc->node, i, &(sc->phy[i]));
  if (rv != 0 && rv != ENOENT) {
-    device_printf(sc->dev, "Cannot get phy[%d]\n", i);
-    goto fail;
-    }
-    if (sc->phy[i] == NULL)
-    continue;
-    rv = phy_enable(sc->phy[i]);
-    if (rv != 0) {
-    device_printf(sc->dev, "Cannot enable phy[%d]\n", i);
-    goto fail;
-    }
-   }
-   return (0);
+ device_printf(sc->dev, "Cannot get phy[%d]\n", i);
+/* XXX revert when phy driver will be implemented */
+#if 0
+ goto fail;
+#else
+ continue;
+#endif
+ }
+ if (sc->phy[i] == NULL)
+ continue;
+ rv = phy_enable(sc->phy[i]);
+ if (rv != 0) {
+ device_printf(sc->dev, "Cannot enable phy[%d]\n", i);
+ goto fail;
+ }
+ }
+ return (0);

 fail:
  for (i = 0; i < MV_MAX_LANES; i++) {
@@ -173,13 +169,14 @@ pci_mv_init(struct pci_mv_softc *sc)
  /* Enable local interrupts */
  pci_dw_dbi_wr4(sc->dev, DW_MSI_INTR0_MASK, 0xFFFFFFFF);
  pci_dw_dbi_wr4(sc->dev, MV_INT_MASK1, 0xFFFFFFFF);
- pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFF);
+ pci_dw_dbi_wr4(sc->dev, MV_INT_MASK2, 0xFFFFFFFD);
  pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, 0xFFFFFFFF);
  pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, 0xFFFFFFFF);

  /* Errors have own interrupt, not yet populated in DTt */
  pci_dw_dbi_wr4(sc->dev, MV_ERR_INT_MASK, 0);
 }
+
 static int pci_mv_intr(void *arg)
 {
  struct pci_mv_softc *sc = arg;
@@ -188,8 +185,6 @@ static int pci_mv_intr(void *arg)
  /* Ack all interrups */
  cause1 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE1);
  cause2 = pci_dw_dbi_rd4(sc->dev, MV_INT_CAUSE2);
- if (cause1 == 0 || cause2 == 0)
- return(FILTER_STRAY);

  pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE1, cause1);
  pci_dw_dbi_wr4(sc->dev, MV_INT_CAUSE2, cause2);

3 years agoUse native-sized accesses when accessing memory from kdb.
mmel [Fri, 19 Jun 2020 16:26:42 +0000 (16:26 +0000)]
Use native-sized accesses when accessing memory from kdb.
Not all MMIO mapped devices supports byte access.

MFC after: 4 weeks

3 years agoImprove DesignWare PCIe driver:
mmel [Fri, 19 Jun 2020 16:15:06 +0000 (16:15 +0000)]
Improve DesignWare PCIe driver:
- only normal memory window is mandatory, prefetchable memory and
  I/O windows should be optional
- full PCIe configuration space is supported
- remove duplicated check from function for accessing configuration space.
  It is already contained in pci_dw_check_dev()

MFC after: 2 weeks

3 years agoAdd specific stub for ARMADA 8k SoC to Marvell RTC driver.
mmel [Fri, 19 Jun 2020 15:32:55 +0000 (15:32 +0000)]
Add specific stub for ARMADA 8k SoC to Marvell RTC driver.
The AXI bridge is different between ARMADA 38x and 8K, and both platforms
needs specific setup to mitigate HW issues with accessing RTC registers.

MFC after: 2 weeks

3 years agoAdd specialized gpio driver for ARMADA 8k SoC.
mmel [Fri, 19 Jun 2020 15:21:33 +0000 (15:21 +0000)]
Add specialized gpio driver for ARMADA 8k SoC.
Older marvell gpio blocks are to different for reusing/enhancing
existing frivers.

MFC after: 2 weeks

3 years agoAdd DTB files for ARMADA 8040 based boards.
mmel [Fri, 19 Jun 2020 14:28:56 +0000 (14:28 +0000)]
Add DTB files for ARMADA 8040 based boards.

MFC after: 2 weeks

3 years agoFix typo in apic.4
thj [Fri, 19 Jun 2020 13:09:00 +0000 (13:09 +0000)]
Fix typo in apic.4

Reviewed by: bcr (manpages)
Approved by: jtl (co-mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D25357

3 years agoRemove last argument of sctp_addr_mgmt_ep_sa(), since it is not used.
tuexen [Fri, 19 Jun 2020 12:35:29 +0000 (12:35 +0000)]
Remove last argument of sctp_addr_mgmt_ep_sa(), since it is not used.

MFC after: 1 week

3 years agoRevert r362360.
markj [Fri, 19 Jun 2020 11:04:49 +0000 (11:04 +0000)]
Revert r362360.

This commit was simply wrong since two different objects are locked.

Reported by: lwhsu, pho
Pointy hat: markj

3 years agobin/ps: Make the rtprio option actually show realtime priorities
salvadore [Fri, 19 Jun 2020 09:27:58 +0000 (09:27 +0000)]
bin/ps: Make the rtprio option actually show realtime priorities

Fix the rtprio option that for some reason was progessively becoming an
option showing the priority class of threads. In particular:

- use the constants defined in sys/sys/rtprio.h instead of those defined in
  sys/sys/priority.h: this helps making clearer that the code actually is
  about realtime priorities and not standard scheduler priorities;
- remove the PRI_ITHD case that has nothing to do with realtime priorities;
- convert the priority levels to realtime priority levels using the same
  formulas used for pri_to_rtp function in sys/kern/kern_resource.c.
- remove outdated note "101 = not a realtime process" in the man page and
  replace it with a more useful reference to man 1 rtprio.

Approved by: src (mckusick), manpages (bcr), gerald (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25266

3 years agodiff(1): Add EXAMPLES section
fernape [Fri, 19 Jun 2020 06:48:16 +0000 (06:48 +0000)]
diff(1): Add EXAMPLES section

Add examples for -r, -u, -N, -x, -q and -I

Approved by: 0mp@
Differential Revision: https://reviews.freebsd.org/D25345

3 years agomd5(1): Add EXAMPLES section
fernape [Fri, 19 Jun 2020 06:23:55 +0000 (06:23 +0000)]
md5(1): Add EXAMPLES section

Add EXAMLES covering -c, -s and -r

Approved by: bcr@, 0mp@
Differential Revision: https://reviews.freebsd.org/D25278

3 years agoRestore a check unintentionally dropped in r362361.
markj [Fri, 19 Jun 2020 04:18:20 +0000 (04:18 +0000)]
Restore a check unintentionally dropped in r362361.

MFC with: r362361

3 years agoThe actual name for MMCCAM sd block devices is sdda.
imp [Fri, 19 Jun 2020 04:09:35 +0000 (04:09 +0000)]
The actual name for MMCCAM sd block devices is sdda.

Pointed out by: kibab@

3 years agoAdd a helper function for validating VA ranges.
markj [Fri, 19 Jun 2020 03:32:04 +0000 (03:32 +0000)]
Add a helper function for validating VA ranges.

Functions which take untrusted user ranges must validate against the
bounds of the map, and also check for wraparound.  Instead of having the
same logic duplicated in a number of places, add a function to check.

Reviewed by: dougm, kib
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25328

3 years agoFix a double object unlock in vm_object_backing_collapse_wait().
markj [Fri, 19 Jun 2020 03:31:46 +0000 (03:31 +0000)]
Fix a double object unlock in vm_object_backing_collapse_wait().

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25327

3 years agoThe binary representation of the superblock (the fs structure) is written
mckusick [Fri, 19 Jun 2020 01:04:25 +0000 (01:04 +0000)]
The binary representation of the superblock (the fs structure) is written
out verbatim to the disk: see ffs_sbput() in sys/ufs/ffs/ffs_subr.c.
It contains a pointer to the fs_summary_info structure. This pointer
value inadvertently causes garbage to be stored. It is garbage because
the pointer to the fs_summary_info structure is the address the then
current stack or heap. Although a mere pointer does not reveal anything
useful (like a part of a private key) to an attacker, garbage output
deteriorates reproducibility.

This commit zeros out the pointer to the fs_summary_info structure
before writing the out the superblock.

Reviewed by:  kib
Tested by:    Peter Holm
PR:           246983
Sponsored by: Netflix

3 years agoMove the pointers stored in the superblock into a separate
mckusick [Fri, 19 Jun 2020 01:02:53 +0000 (01:02 +0000)]
Move the pointers stored in the superblock into a separate
fs_summary_info structure. This change was originally done
by the CheriBSD project as they need larger pointers that
do not fit in the existing superblock.

This cleanup of the superblock eases the task of the commit
that immediately follows this one.

Suggested by: brooks
Reviewed by:  kib
PR:           246983
Sponsored by: Netflix

3 years agoAdd support for bcm54213PE in brgphy.
karels [Thu, 18 Jun 2020 23:57:10 +0000 (23:57 +0000)]
Add support for bcm54213PE in brgphy.

This chip is used in the Rasperry Pi 4, and is supported by the if_genet
driver. Currently we use the ukphy mii driver, this patch switches over
to the brgphy mii driver instead. To support the rgmii-rxid phy mode,
which is now the default in the Linux dtb, we add support for clock
skewing.

These changes are taken from OpenBSD and NetBSD, except for the bailout
in brgphy_bcm54xx_clock_delay() in rgmii mode, which was found necessary
after testing.

Submitted by: Robert Crowston, crowston at protomail.com
Differential Revision: https://reviews.freebsd.org/D25251

3 years agoDocument that umount -A does not unmount /dev
0mp [Thu, 18 Jun 2020 23:12:55 +0000 (23:12 +0000)]
Document that umount -A does not unmount /dev

Reported by: kaktus
Reviewed by: kaktus
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25351

3 years agortld: Apply relro to itself.
kib [Thu, 18 Jun 2020 23:07:58 +0000 (23:07 +0000)]
rtld: Apply relro to itself.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25319

3 years agortld: Parse own phdr and notes.
kib [Thu, 18 Jun 2020 23:06:05 +0000 (23:06 +0000)]
rtld: Parse own phdr and notes.

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25319

3 years agohw.bus.info: rework handler
kaktus [Thu, 18 Jun 2020 21:42:54 +0000 (21:42 +0000)]
hw.bus.info: rework handler

hw.bus.info was added in r68522 as a node, but there was never anything
connected "behind" it.  Its only purpose is to return a struct u_businfo.
The only in-base consumer are devinfo(3)/devinfo(8).
Rewrite the handler as SYSCTL_PROC and mark it as MPSAFE and read-only
as there never was a writable path.

Reviewed by: kib
Approved by: kib (mentor)
Sponsored by: Mysterious Code Ltd.
Differential Revision: https://reviews.freebsd.org/D25321

3 years agoFix execution of linux binary from multithreaded non-Linux process.
kib [Thu, 18 Jun 2020 20:49:56 +0000 (20:49 +0000)]
Fix execution of linux binary from multithreaded non-Linux process.

If multithreaded non-Linux process execs Linux binary, then non-Linux
threads different from the one that execing are cleared by
single-threading at boundary, and then terminating them in
post_execve(). Since at that time the process is already switched to
linux ABI, linuxolator is involved in the thread clearing on boundary,
but cannot find the emul data.

Handle it by pre-creating emuldata for all threads in the execing process.

Also remove a code in linux_proc_exec() handler that cleared emul data
for other threads when execing from multithreaded Linux process. It is
excessive.

PR: 247020
Reported by: Martin FIlla <freebsd@sysctl.cz>
Reported by: Henrique L. Amorim, Independent Security Researcher
Reported by: Rodrigo Rubira Branco (BSDaemon), Amazon Web Services
Reviewed by: markj
Tested by: trasz
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D25293

3 years agoMerge commit 0cecafd647cc from llvm git (by Alina Sbirlea):
dim [Thu, 18 Jun 2020 20:41:43 +0000 (20:41 +0000)]
Merge commit 0cecafd647cc from llvm git (by Alina Sbirlea):

  [BasicAA] Make BasicAA a cfg pass.

  Summary:
  Part of the changes in D44564 made BasicAA not CFG only due to it
  using PhiAnalysisValues which may have values invalidated. Subsequent
  patches (rL340613) appear to have addressed this limitation.

  BasicAA should not be invalidated by non-CFG-altering passes. A
  concrete example is MemCpyOpt which preserves CFG, but we are testing
  it invalidates BasicAA.

  llvm-dev RFC:
  https://groups.google.com/forum/#!topic/llvm-dev/eSPXuWnNfzM

  Reviewers: john.brawn, sebpop, hfinkel, brzycki

  Subscribers: hiraditya, llvm-commits

  Tags: #llvm

  Differential Revision: https://reviews.llvm.org/D74353

This fixes an issue with clang's -fintegrated-cc1 feature, which could
make it output slightly different assembly code, depending on the way it
was invoked.

In r361755 we attempted to work around it by disabling the integrated
cc1 stage, but it did not solve the root cause for all situations.

Extensive testing and bisecting showed that the above change finally
makes the output deterministic, even if -fintegrated-cc1 is on.

Reported by: Fabian Keil <fk@fabiankeil.de>
PR: 246630
MFC after: 3 days

3 years agoAdd the SCTP_SUPPORT kernel option.
markj [Thu, 18 Jun 2020 19:32:34 +0000 (19:32 +0000)]
Add the SCTP_SUPPORT kernel option.

This is in preparation for enabling a loadable SCTP stack.  Analogous to
IPSEC/IPSEC_SUPPORT, the SCTP_SUPPORT kernel option must be configured
in order to support a loadable SCTP implementation.

Discussed with: tuexen
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

3 years agoMake polled request timeout less invasive.
mav [Thu, 18 Jun 2020 19:16:03 +0000 (19:16 +0000)]
Make polled request timeout less invasive.

Instead of panic after one second of polling, make the normal timeout
handler to activate, reset the controller and abort the outstanding
requests.  If all of it won't happen within 10 seconds then something
in the driver is likely stuck bad and panic is the only way out.

In particular this fixed device hot unplug during execution of those
polled commands, allowing clean device detach instead of panic.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

3 years agoFix a typo in cpuset_getdomain.2
0mp [Thu, 18 Jun 2020 19:03:20 +0000 (19:03 +0000)]
Fix a typo in cpuset_getdomain.2

PR: 247385
Reported by: Paul Floyd <paulf free.fr>
MFC after: 1 week

3 years agoRemove the unnecessary configure.ac.
jkim [Thu, 18 Jun 2020 18:16:13 +0000 (18:16 +0000)]
Remove the unnecessary configure.ac.

3 years agoMFV: r362286
jkim [Thu, 18 Jun 2020 18:09:16 +0000 (18:09 +0000)]
MFV: r362286

Merge flex 2.6.4.

3 years agoWhitespace changes, not functional change intended.
tuexen [Thu, 18 Jun 2020 16:22:09 +0000 (16:22 +0000)]
Whitespace changes, not functional change intended.

MFC after: 1 week

3 years agoMake audit tests depend on /dev/auditpipe. This should fix
trasz [Thu, 18 Jun 2020 15:41:16 +0000 (15:41 +0000)]
Make audit tests depend on /dev/auditpipe. This should fix
some 416 failing tests on armv7:

https://ci.freebsd.org/job/FreeBSD-head-armv7-test/lastCompletedBuild/testReport/

Reviewed by: asomers
MFC after: 2 weeks
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D25144

3 years agosplit(1): Add EXAMPLES section
fernape [Thu, 18 Jun 2020 15:14:10 +0000 (15:14 +0000)]
split(1): Add EXAMPLES section

Add EXAMPLES covering -d, -n and -p
Include small explanation about the size of the chunks for the -n option

Approved by: 0mp
Differential Revision: https://reviews.freebsd.org/D25198

3 years agoAdd HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8)
gbe [Thu, 18 Jun 2020 13:19:56 +0000 (13:19 +0000)]
Add HISTORY sections to banner(6), basename(1), limits(1) and vmstat(8)

Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D25019

3 years agofgetln(3): Add a Caveats Section
gbe [Thu, 18 Jun 2020 13:13:04 +0000 (13:13 +0000)]
fgetln(3): Add a Caveats Section

Reviewed by: yuripv, bcr (mentor)
Approved by: bcr (mentror)
Obtained from: OpenBSD
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D24916

3 years agoFix the --guid flag description
0mp [Thu, 18 Jun 2020 12:29:24 +0000 (12:29 +0000)]
Fix the --guid flag description

MFC after: 2 weeks

3 years agoClean up and improve manual page for fuser(1)
0mp [Thu, 18 Jun 2020 11:18:26 +0000 (11:18 +0000)]
Clean up and improve manual page for fuser(1)

- Mention option's arguments in the list of options (so that now we mention
  "-N system" instead of just "-N").
- Stylize signals and other constants like O_APPEND with Dv.
- Sort options.
- Change indentation width for readability.
- Fix a couple of typos.
- Sort symbols list.
- Use Sy instead of Cm for symbols. They are not command modifiers.
- Use Ex -std in the EXIT STATUS section for consistency with other manual
  pages.
- Use Ql instead of Dq Li for inline code examples as Li has recently been
  deprecated by mdoc.

Reviewed by: bcr
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25332

3 years agoImprove periodic(8) manual page presentation
0mp [Thu, 18 Jun 2020 10:52:51 +0000 (10:52 +0000)]
Improve periodic(8) manual page presentation

- Update synopsis to present all available arguments.
- Consistently call the argument specifying an arbitrary directory a
  "directory".
- Do not put macros into -width argument to Bl. They do not expand there.
- Stylize command modifiers like "daily" with Cm instead of Pa. While
  technically periodic(8) operates on directories with such names, it is
  confusing from the perspective of the manual page reader as Pa and Ar are
  stylized the same way. Also, I cannot recall a single manual page where
  Pa would be used to describe the syntax of command-line arguments.

MFC after: 2 weeks

3 years agotee(1): Add EXAMPLES section
fernape [Thu, 18 Jun 2020 10:48:37 +0000 (10:48 +0000)]
tee(1): Add EXAMPLES section

Probably the simplest one ever.

Approved by: gbe@, 0mp@
Differential Revision: https://reviews.freebsd.org/D25206

3 years agolockf(1): Add EXAMPLES section
fernape [Thu, 18 Jun 2020 08:31:04 +0000 (08:31 +0000)]
lockf(1): Add EXAMPLES section

 * Add pretty small EXAMPLES section
 * While here, fix a warning in line 98 (new sentence in new line)

Approved by: bcr@
Differential Revision: https://reviews.freebsd.org/D25205

3 years agonl(1): Add EXAMPLES section
fernape [Thu, 18 Jun 2020 08:26:26 +0000 (08:26 +0000)]
nl(1): Add EXAMPLES section

Add EXAMPLES section covering flags -b[ap] -n -i -s -v

Approved by: bcr@
Differential Revision: Add EXAMPLES section covering flags -b[ap] -n -i -s -v

3 years agoStop assuming we can print rman_res_t with %lx
andrew [Thu, 18 Jun 2020 06:21:00 +0000 (06:21 +0000)]
Stop assuming we can print rman_res_t with %lx

This is not the case on armv6 and armv7, where we also build this driver.
Fix by casting through uintmax_t and using %jx.

Sponsored by: Innovate UK

3 years agohdac_intr_handler: keep working until global interrupt status clears
avg [Thu, 18 Jun 2020 06:12:06 +0000 (06:12 +0000)]
hdac_intr_handler: keep working until global interrupt status clears

It is plausible that the hardware interrupts a host only when GIS goes
from zero to one.  GIS is formed by OR-ing multiple hardware statuses,
so it's possible that a previously cleared status gets set again while
another status has not been cleared yet.  Thus, there will be no new
interrupt as GIS always stayed set.  If we don't re-examine GIS then we
can leave it set and never get another interrupt again.

Without this change I frequently saw a problem where snd_hda would stop
working.  Setting dev.hdac.1.polling=1 would bring it back to life and
afterwards I could set polling back to zero.  Sometimes the problem
started right after a boot, sometimes it happened after resuming from
S3, frequently it would occur when sound output and input are active
concurrently (such as during conferencing).  I looked at HDAC_INTSTS
while the sound was not working and I saw that both HDAC_INTSTS_GIS and
HDAC_INTSTS_CIS were set, but there were no interrupts.

I have collected some statistics over a period of several days about how
many loops (calls to hdac_one_intr) the new code did for a single
interrupt:
+--------+--------------+
|Loops   |Times Happened|
+--------+--------------+
|0       |301           |
|1       |12857746      |
|2       |280           |
|3       |2             |
|4+      |0             |
+--------+--------------+
I believe that previously the sound would get stuck each time we had to loop
more than once.

The tested hardware is:
hdac1: <AMD (0x15e3) HDA Controller> mem 0xfe680000-0xfe687fff at device 0.6 on pci4
hdacc1: <Realtek ALC269 HDA CODEC> at cad 0 on hdac1

No objections: mav
MFC after: 5 weeks
Differential Revision: https://reviews.freebsd.org/D25128

3 years agoMove all of the functions in ffs_subr.c that are only used by the ufs kernel
chs [Wed, 17 Jun 2020 23:39:52 +0000 (23:39 +0000)]
Move all of the functions in ffs_subr.c that are only used by the ufs kernel
module from that file into ffs_vfsops.c.  This fixes the build for kernel
configs that don't include FFS.

PR: 247256
Submitted by: glebius
Reviewed by: mckusick (earlier version)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D25285

3 years agoClean up fstat.1
0mp [Wed, 17 Jun 2020 21:21:57 +0000 (21:21 +0000)]
Clean up fstat.1

- Sort options in the list & indent for readability.
- Pet linters
  - Use "\(em" instead of "--"
  - Remove Tn macros
- Use Ql instead of Dq Li
- Add arguments to the -M, -N, -p, and -u options in their descriptions.
- Use Sy instead of Li for field names. Li is deprecated, and Ql makes no
  sense here.
- Replace a literal block with a list for the table of special names
  related to FD.
- Use Ql instead of ``X''.
- Add a dot after etc.
- Reference fuser(1).

MFC after: 1 week

3 years agoWhen converting the static arrays to mallocarray() in r356621 I missed
bz [Wed, 17 Jun 2020 21:04:38 +0000 (21:04 +0000)]
When converting the static arrays to mallocarray() in r356621 I missed
one place where we now need to multiply the size of the struct with the
number of entries.  This lead to problems when restarting user space
daemons, as the cleanup was never properly done, resulting in MRT_ADD_VIF
EADDRINUSE.
Properly zero all array elements to avoid this problem.

PR: 246629, 206583
Reported by: (many)
MFC after: 4 days
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")

3 years agoThe call into ifa_ifwithaddr() needs to be epoch protected; ortherwise
bz [Wed, 17 Jun 2020 20:58:37 +0000 (20:58 +0000)]
The call into ifa_ifwithaddr() needs to be epoch protected; ortherwise
we'll panic on an assertion.
While here, leave a comment that the ifp was never protected and stable
(as glebius pointed out) and this needs to be fixed properly.

Discovered while working on: PR 246629
Reviewed by: glebius
MFC after: 4 days
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")

3 years agoImport flex 2.6.4.
jkim [Wed, 17 Jun 2020 19:57:19 +0000 (19:57 +0000)]
Import flex 2.6.4.

3 years agoClean up the pci host generic driver
andrew [Wed, 17 Jun 2020 19:56:17 +0000 (19:56 +0000)]
Clean up the pci host generic driver

 - Support Prefetchable Memory.
 - Use the correct rman when allocating memory and ioports.
 - Translate PCI addresses in bus_alloc_resource to allow physical
   addresses that are different than pci addresses.

Reviewed by: Robert Crowston <crowston_protonmail.com>
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D25121

3 years agoSupport pmap_extract_and_hold on arm64 stage 2 mappings
andrew [Wed, 17 Jun 2020 19:45:05 +0000 (19:45 +0000)]
Support pmap_extract_and_hold on arm64 stage 2 mappings

Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D24469

3 years agoFix admin qpair leak if detached during initial reset.
mav [Wed, 17 Jun 2020 17:51:40 +0000 (17:51 +0000)]
Fix admin qpair leak if detached during initial reset.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

3 years agoRemove vfs_statfs and vnode_mount macros from NFS
asomers [Wed, 17 Jun 2020 16:20:19 +0000 (16:20 +0000)]
Remove vfs_statfs and vnode_mount macros from NFS

These macro definitions are no longer needed as the NFS OSX port is long
dead.  The vfs_statfs macro conflicts with the vfsops field of the same
name.

Submitted by: shivank@
Reviewed by: rmacklem
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2020)
Differential Revision: https://reviews.freebsd.org/D25263

3 years agoFix installation of magic file.
delphij [Wed, 17 Jun 2020 15:57:59 +0000 (15:57 +0000)]
Fix installation of magic file.

Reported by: lwhsu
MFC after: 2 weeks
X-MFC-with: r362258

3 years agoComplete the ACPI support for ARM Coresight:
br [Wed, 17 Jun 2020 15:54:51 +0000 (15:54 +0000)]
Complete the ACPI support for ARM Coresight:
o Parse the ACPI DSD (Device Specific Data) graph property and record
  device connections.
o Split-out FDT support to a separate file.
o Get the corresponding (FDT/ACPI) Coresight platform data in
  the device drivers.

Sponsored by: DARPA, AFRL

3 years agoAllow the self reference to be NULL in case the timer was stopped.
tuexen [Wed, 17 Jun 2020 15:27:45 +0000 (15:27 +0000)]
Allow the self reference to be NULL in case the timer was stopped.

Submitted by: Timo Voelker
MFC after: 1 week

3 years agoAdd header definition for RFC4340, Datagram Congestion Control Protocol
thj [Wed, 17 Jun 2020 13:27:13 +0000 (13:27 +0000)]
Add header definition for RFC4340, Datagram Congestion Control Protocol

Add a header definition for DCCP as defined in RFC4340. This header definition
is required to perform validation when receiving and forwarding DCCP packets.
We do not currently support DCCP.

Reviewed by: gallatin, bz
Approved by: bz (co-mentor)
MFC after: 1 week
MFC with: 350749
Differential Revision: https://reviews.freebsd.org/D21179

3 years agoctime(3): Bump .Dd after r362165
gbe [Wed, 17 Jun 2020 11:57:48 +0000 (11:57 +0000)]
ctime(3): Bump .Dd after r362165

Reported by: bcr (mentor)
Reviewed by: bcr (mentor)
Approved by: bcr (mentor)
X-MFC-With: r362165

3 years agoAdd all the TCR_EL1 fields
andrew [Wed, 17 Jun 2020 11:56:10 +0000 (11:56 +0000)]
Add all the TCR_EL1 fields

These will be used when adding support for new Armv8 extensions.

Sponsored by: Innovate UK

3 years agoFix HW TLS offload regression issue after r359919, in mlx5en(4).
hselasky [Wed, 17 Jun 2020 11:14:54 +0000 (11:14 +0000)]
Fix HW TLS offload regression issue after r359919, in mlx5en(4).

Changes in the mbuf layout regarding HW TLS, resulted in wrong detection
of starting mbuf. Use a boolean variable to handle this and pass m_adj()
the top mbuf, so that the packet header is adjusted correctly.

MFC after: 1 week
Sponsored by: Mellanox Technologies

3 years agoAllow multicast packets to be received in promiscious mode, in mlx4en(4).
hselasky [Wed, 17 Jun 2020 11:12:10 +0000 (11:12 +0000)]
Allow multicast packets to be received in promiscious mode, in mlx4en(4).

Make sure we disable the multicast filter in promiscious mode aswell as when
the all multicast flag is set.

MFC after: 1 week
Found by: Tycho Nightingale <tychon@freebsd.org>
Sponsored by: Mellanox Technologies

3 years agoloader: r362262 did miss the pathlen check
tsoome [Wed, 17 Jun 2020 10:56:58 +0000 (10:56 +0000)]
loader: r362262 did miss the pathlen check

While we are checking the "/dev/" prefix, we can skip the paths shorter than
this prefix.

Sponsored by: Netflix, Klara Inc.

3 years agoUpdate opencsd to 0.14.2
andrew [Wed, 17 Jun 2020 10:42:20 +0000 (10:42 +0000)]
Update opencsd to 0.14.2

Sponsored by: Innovate UK

3 years agoloader: strings in nvlist are counted strings, not c-strings
tsoome [Wed, 17 Jun 2020 10:41:01 +0000 (10:41 +0000)]
loader: strings in nvlist are counted strings, not c-strings

We need to fetch both string size and data, then handle the data.

Reviewed by: allanjude
Sponsored by: Netflix, Klara Inc.

3 years agoRe-apply r333944 to unbreak ports
antoine [Wed, 17 Jun 2020 10:11:54 +0000 (10:11 +0000)]
Re-apply r333944 to unbreak ports

3 years agoevdev: Add AT translated set1 scancodes for 'Eisu' & 'Kana' keys.
wulf [Wed, 17 Jun 2020 08:35:35 +0000 (08:35 +0000)]
evdev: Add AT translated set1 scancodes for 'Eisu' & 'Kana' keys.

PR: 247292
Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>
MFC after: 1 week

3 years agoloader: vidc_init should also erase the screen
tsoome [Wed, 17 Jun 2020 08:08:57 +0000 (08:08 +0000)]
loader: vidc_init should also erase the screen

Inject \e[J to erase the initial loader screen. We have two options,
find where out cursor is and use BIOS scroll for data from boot2 or erase the
display and start from origin. Erasing the screen is easier and we also
get the screen buffer initialized.

Sponsored by: Netflix, Klara Inc.

3 years agoMFV r362254: file 5.39.
delphij [Wed, 17 Jun 2020 07:41:28 +0000 (07:41 +0000)]
MFV r362254: file 5.39.

MFC after: 2 weeks