]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
18 months agoping: split the visual part of -f into a new option -.
Piotr Pawel Stefaniak [Mon, 11 Apr 2022 14:58:24 +0000 (16:58 +0200)]
ping: split the visual part of -f into a new option -.

Differential Revision: https://reviews.freebsd.org/D34882

(cherry picked from commit d399eb3ef7f8a8189b73d179e07119b30127efb9)

18 months agols(1): add a -v flag to sort naturally
Aymeric Wibo [Sun, 23 Oct 2022 07:46:27 +0000 (09:46 +0200)]
ls(1): add a -v flag to sort naturally

Differential Revision: https://reviews.freebsd.org/D36407

(cherry picked from commit e2662256cdbc6ca9be49a66837f9725081cfa9d3)

18 months agoMFV: xz 5.2.9
Xin LI [Fri, 9 Dec 2022 07:46:09 +0000 (23:46 -0800)]
MFV: xz 5.2.9

(cherry picked from commit 0ca90ed42a495074392a8316ae58a9bbf4eda01a)

18 months agoimgact_binmisc: Optionally pre-open the interpreter vnode
Doug Rabson [Thu, 17 Nov 2022 10:48:20 +0000 (10:48 +0000)]
imgact_binmisc: Optionally pre-open the interpreter vnode

This allows the use of chroot and/or jail environments which depend on
interpreters registed with imgact_binmisc to use emulator binaries from
the host to emulate programs inside the chroot.

Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D37432

(cherry picked from commit 5eeb4f737f11b253ac330ae459b05e30fd16d0e8)

18 months agogeom: add vinum as a recognized class
Ed Maste [Mon, 12 Dec 2022 17:13:58 +0000 (12:13 -0500)]
geom: add vinum as a recognized class

And note that it is deprecated.

PR: 236569
Reported by: bcran
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37678

(cherry picked from commit d181a912670558d40bb3a7fcda2703608e152774)

18 months agogeom: minor man page updates suggested by igor(1)
Ed Maste [Mon, 12 Dec 2022 21:26:00 +0000 (16:26 -0500)]
geom: minor man page updates suggested by igor(1)

Reviewed by: pauamma
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37681

(cherry picked from commit 94db10b2db29f897e4934544a5efeaa704d06aa3)

18 months agoAdd deprecation notices to ce,cp sync serial drivers
Ed Maste [Mon, 2 Mar 2020 17:31:52 +0000 (12:31 -0500)]
Add deprecation notices to ce,cp sync serial drivers

And the related sconfig utility.  Sync serial (e.g. E1/T1) interfaces
are obsolete, and nobody responded to several inquires on the mailing
lists about use of these drivers.

Relnotes: Yes
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D23928

(cherry picked from commit 20dfe27b2d031c4000f5be94fd1db8872167a537)

18 months agovmm: Fix AP startup with old userspace binaries.
John Baldwin [Wed, 26 Oct 2022 21:22:56 +0000 (14:22 -0700)]
vmm: Fix AP startup with old userspace binaries.

Older binaries that do not request IPI exits to userspace do not
start user threads for other vCPUs until a STARTUP IPI triggers a
VM_EXITCODE_SPINUP_AP exit to userland.  This means that those vcpus
are not yet active (in terms of vm_active_cpus) when the INIT and
STARTUP IPIs are delivered to the vCPUs.

The changes in commit 0bda8d3e9f7a changed the INIT and STARTUP IPIs
to reuse the existing vlapic_calcdest() function.  This function
silently ignores IPIs sent to inactive vCPUs.  As a result, when using
an old bhyve binary, the INIT and STARTUP IPIs sent to wakeup APs were
ignored.

To fix, restructure the compat code for the INIT and STARTUP IPIs to
ignore the results of vlapic_calcdest() and manually parse the APIC ID
and resulting vcpuid.  As part of this, make the compat code always
conditonal on the ipi_exit capability being disabled.

Reviewed by: c.koehne_beckhoff.com, markj
Differential Revision: https://reviews.freebsd.org/D37093

(cherry picked from commit 769b884e2e2eb84d25eca2a5462ae0a6c4dcd2a7)

18 months agovmm: validate icr value
Corvin Köhne [Wed, 12 Oct 2022 09:19:32 +0000 (11:19 +0200)]
vmm: validate icr value

Not all combinations of icr values are allowed. Neither Intel nor AMD
document what happens when an invalid value is written to the icr.
Ignore the IPI. So, the guest will note that the IPI wasn't delivered.

Reviewed by: jhb
Differential Revision:  https://reviews.freebsd.org/D36946
Sponsored by:           Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 2a2a64c4b93f1a135f62f54db54f4ec2f89f9127)

18 months agovmm: increase vlapic version
Corvin Köhne [Mon, 10 Oct 2022 12:56:00 +0000 (14:56 +0200)]
vmm: increase vlapic version

Mac os panics on apic versions lower than 0x14.

See https://opensource.apple.com/source/xnu/xnu-7195.81.3/osfmk/i386/lapic_native.c.auto.html

Additionally, an upcoming commit will validate the icr values written by
the guest. Older intel processors allow some different combinations than
the newer ones. AMD documents that only the newer combinations are
allowed. So, bumping the version allows us to avoid a differentiation
between AMD and Intel.

Intel documents that newer processors than the P6 are using the new
combinations. Sadly, Intel does not document which apic version belongs
to those processors. Linux identifies newer apics by a version larger or
equal to 0x14. Intel and AMD allow apic version between 0x10 and 0x15.
So, using 0x14 seems to be fine.

See https://github.com/torvalds/linux/blob/3eba620e7bd772a0c7dc91966cb107872b54a910/arch/x86/kernel/apic/apic.c#L238

Reviewed by: jhb
Differential Revision:  https://reviews.freebsd.org/D36945
Sponsored by:           Beckhoff Automation GmbH & Co. KG

(cherry picked from commit f56801d6d9777ba0a7e398d370bb755de8102697)

18 months agosys/conf: Remove an unneeded flag variable
Mark Johnston [Wed, 14 Dec 2022 14:32:17 +0000 (09:32 -0500)]
sys/conf: Remove an unneeded flag variable

After commit fac6dee9eb58 ("Remove tests for obsolete compilers in the
build system"), we always set -fdebug-prefix-map, so there's no point in
defining and testing _MAP_DEBUG_PREFIX.  No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit ab8b2d108c7c4e63ed850148fdc237633077fcd3)

18 months agosizeof(7): miscellaneous edits
Konstantin Belousov [Tue, 13 Dec 2022 14:07:32 +0000 (16:07 +0200)]
sizeof(7): miscellaneous edits

(cherry picked from commit 9e0d976d95fa4468ac423bc872bda0e93fa4bc18)

18 months agosizeof(7): remove "All rights reserved"
Jan Schaumann [Wed, 14 Dec 2022 04:58:23 +0000 (06:58 +0200)]
sizeof(7): remove "All rights reserved"

(cherry picked from commit 57bee0817f777721a3e253c77f266c7e851a589d)

18 months agoAdd sizeof(7) manual page
Jan Schaumann [Tue, 13 Dec 2022 04:35:11 +0000 (06:35 +0200)]
Add sizeof(7) manual page

PR: 268310

(cherry picked from commit 0b75997f4c5a15f02e6d5eee981a1b752dd0fd59)

18 months agorb_tree: fix stable/13 linux/rbtree.h post ABI fix
Doug Moore [Mon, 19 Dec 2022 22:03:13 +0000 (16:03 -0600)]
rb_tree: fix stable/13 linux/rbtree.h post ABI fix

Rearranging the left, right, and parent pointers for backward
compatibility with stable/13 in
d8a88ec381498f5942403088d28ee325b92e9a78 is incomplete because it does
not change linux/rbtree.h so that it too knows how rb_left and
rb_right are redefined. So complete it.

Reported by: jon_xyinn.org, jgibbons@protogate.org
Tested by: manu, jon_xyinn.org
Differential Revision: https://reviews.freebsd.org/D37743

18 months agobridge: Fix a potential memory leak in bridge_enqueue()
Mark Johnston [Sun, 11 Dec 2022 16:40:12 +0000 (11:40 -0500)]
bridge: Fix a potential memory leak in bridge_enqueue()

A comment at the beginning of the function notes that we may be
transmitting multiple fragments as distinct packets.  So, the function
loops over all fragments, transmitting each mbuf chain.  If if_transmit
fails, we need to free all of the fragments, but m_freem() only frees an
mbuf chain - it doesn't follow m_nextpkt.

Change the error handler to free each untransmitted packet fragment, and
count each fragment as a separate error since we increment OPACKETS once
per fragment when transmission is successful.

Reviewed by: zlei, kp
MFC after: 1 week
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37635

(cherry picked from commit 51088797305c8aba43e8ded60b99eef5baa14071)

18 months agolibdtrace: Change the binding of USDT probe symbols to STB_WEAK
Mark Johnston [Sun, 11 Dec 2022 16:27:22 +0000 (11:27 -0500)]
libdtrace: Change the binding of USDT probe symbols to STB_WEAK

Otherwise, if multiple object files contain references to the same
probe, newish lld will refuse to link them by default, raising a
duplicate global symbol definition error.  Previously, duplicate global
symbols with identical absolute st_values were permitted by both lld and
GNU ld.

Since dtrace has no use for probe function symbols after the relocation
performed by dtrace -G, make the symbols weak as well, following a
suggestion from MaskRay.

Reported by: dim
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit be39466a1035ffb13268cd63723e976898e9b91e)

18 months agojail: fix a NULL pointer derefence in parsing ip6.addr settings.
Jamie Gritton [Thu, 15 Dec 2022 00:47:55 +0000 (16:47 -0800)]
jail: fix a NULL pointer derefence in parsing ip6.addr settings.

This is the counterpart to bd24e861b4ef, which did the same for ip4.

PR: 268377
Reported by: ahkithaama at proton.me

(cherry picked from commit e8d7ae918a105f252cf06249787d82f43e023ba8)

18 months agobhyve virtio-scsi: Fix residual reporting.
Alexander Motin [Sat, 3 Dec 2022 15:08:20 +0000 (10:08 -0500)]
bhyve virtio-scsi: Fix residual reporting.

CTL does not really use residual field and it always returned zero.
Use ext_data_filled instead.

MFC after: 2 weeks

(cherry picked from commit b81ac5cdc355029b4d5723fcdfcbcbedeb94dcd9)

18 months agorpcb_clnt.c: Do not force use of UDP
Rick Macklem [Sun, 13 Nov 2022 20:16:06 +0000 (12:16 -0800)]
rpcb_clnt.c: Do not force use of UDP

Without this patch, the code in the rpcbind client forces
the use of UDP.  A comment notes that some rpcbind servers
only support UDP.  This makes NFSv3 mounts to Azure servers
impossible, since they require use of TCP for rpcbind.
Since the comment is very old (imported from NetBSD in 2001)
and I do not believe any UDP only rpcbind servers will
still exist, this patch comments out the code that forces
use of UDP, so that NFSv3 mounts to Azure servers can work.

For an NFSv3 mount, the "udp" mount option will still
make mount_nfs use UDP for rpcbind so that can be used
as a workaround for any old NFSv3 server that only
supports rpcbind over UDP (if any such server still exists).

I asked if doing this change is appropriate on freebsd-fs@
and I only got one reply (off list) that supported doing
the change.

PR: 267301
(cherry picked from commit 032b04626b671ec16deacd479569998b96c96142)

19 months agopkgbase: do not record dependency on non-existent liby package
Ed Maste [Thu, 17 Nov 2022 19:22:33 +0000 (14:22 -0500)]
pkgbase: do not record dependency on non-existent liby package

liby-dev provides (only) liby.a.  liby has no headers or man pages, and
there is no liby package.  Add a special case to record no dependency on
the package that does not exist.

PR: 266923
Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37429

(cherry picked from commit 1e9c9ab5957795acc0d436ce21ad07373081d990)

19 months agorb_tree: restore binary compat w/ 13
Doug Moore [Fri, 16 Dec 2022 09:15:28 +0000 (03:15 -0600)]
rb_tree: restore binary compat w/ 13

A change to RB_COLOR_INSERT, when merged into stable/13, broke binary
compatibility. For 13, call the new function RB_DO_COLOR_INSERT, and
restore the old function with the original name and parameters. Define
RB_COLOR_INSERT in tree.h, and remove changes to the linux rbtree
header.

Another change altered the order of pointers in the RB_ENTRY struct.
For 13, restore the original order.

Reported by: manu
Reviewed by: hselasky
Tested by: manu
Differential Revision: https://reviews.freebsd.org/D37716

19 months agoman9: Add MLINKS for dpcpu macros
Mark Johnston [Thu, 8 Dec 2022 20:07:53 +0000 (15:07 -0500)]
man9: Add MLINKS for dpcpu macros

MFC after: 1 week

(cherry picked from commit b1ef176eb52877b06541ba5019c7d2a3c78fbdc3)

19 months agobhyve: Disable thread safety analysis
Mark Johnston [Fri, 18 Nov 2022 19:04:19 +0000 (14:04 -0500)]
bhyve: Disable thread safety analysis

The warnings that arise are bogus and have to be muted with
__no_lock_analysis in most cases.  As a step towards enabling the
default warning level for bhyve, just disable them.

Reviewed by: corvink, jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D37295

(cherry picked from commit 1a8e52391be837bb2851065b4bad6c163db9edef)

19 months agobhyve: Address an unused parameter warning in the smbios code
Mark Johnston [Fri, 18 Nov 2022 19:06:44 +0000 (14:06 -0500)]
bhyve: Address an unused parameter warning in the smbios code

The compiler was warning that the "size" parameter to
smbios_generic_initializer() was unused.  This parameter is apparently
used to populate the "maximum structure size" field in the SMBIOS entry
point, but we were always setting it to zero.

Implement it instead in the main loop of the smbios table builder.

MFC after: 2 weeks
Reviewed by: corvink, jhb
Differential Revision: https://reviews.freebsd.org/D37294

(cherry picked from commit bd634fc733d4d00858174c4e7368c31f3cced3b5)

19 months agoRevert "LinuxKPI: Add pci_power querying for drm-kmod"
Emmanuel Vadot [Thu, 15 Dec 2022 09:55:11 +0000 (10:55 +0100)]
Revert "LinuxKPI: Add pci_power querying for drm-kmod"

This reverts commit 5a612b4409286d2dad5d4b482fca6ccbd8c43186.

This break KBI for drm-kmod.
I prefer to not have full debugfs and that drm-kmod still work.

This is a direct commit to stable/13

Sponsored by: Beckhoff Automation GmbH & Co. KG

19 months agoProvide more precise mount(8) failure message.
Kirk McKusick [Mon, 5 Dec 2022 22:47:24 +0000 (14:47 -0800)]
Provide more precise mount(8) failure message.

PR:           19683

(cherry picked from commit 08e5f519b21dfcc7543c41c14d066b2d015fbf5c)

19 months agobhyve: build SPCR ACPI table
Corvin Köhne [Wed, 30 Nov 2022 14:46:19 +0000 (15:46 +0100)]
bhyve: build SPCR ACPI table

OVMF ships some static ACPI tables. This worked in the past but won't
work in the future when we support devices like tpms. They require a TPM
ACPI table. So, we have to dynamically create ACPI tables depending on
the bhyve configuration.

Bhyve has much more information about the system than OVMF. Therefore,
it's easier for bhyve to build up some ACPI tables. For that reason, it
would be much better to use the ACPI tables provided by bhyve instead of
building some tables by OVMF.

At the moment, OVMF always creates a SPCR table. Maybe someone depends
on it. So, we have to build it by bhyve too before we can patch OVMF to
install the tables provided by bhyve.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37591

(cherry picked from commit b972e7cbb4f9f44ab77be24857c674c0733785cf)

19 months agoCTL: Use atomics for tags in ioctl frontend.
Alexander Motin [Tue, 13 Dec 2022 01:15:53 +0000 (20:15 -0500)]
CTL: Use atomics for tags in ioctl frontend.

This direct commits is a part of 0acc026dda9e in main.

19 months agoheimdal: kadm5_c_get_principal() should check return code
Cy Schubert [Fri, 9 Dec 2022 14:06:04 +0000 (06:06 -0800)]
heimdal: kadm5_c_get_principal() should check return code

kadm5_c_get_principal() should check the return code from
kadm5_ret_principal_ent(). As it doesn't it assumes success when
there is none and can lead to potential vulnerability. Fix this.

Reported by: rtm@csail.mit.edu

(cherry picked from commit f6d5d31cd5d5b409851b3bf82c41a477a643a486)

19 months agoheimdal: Properly ix bus fault when zero-length request received
Cy Schubert [Thu, 8 Dec 2022 23:22:43 +0000 (15:22 -0800)]
heimdal: Properly ix bus fault when zero-length request received

Zero length client requests result in a bus fault when attempting to
free malloc()ed pointers within the requests softc. Return an error
when the request is zero length.

This properly fixes PR/268062 without regressions.

PR: 268062
Reported by: Robert Morris <rtm@lcs.mit.edu>

(cherry picked from commit 3deefb0d147d71047a13ec2328b1b721da2ce256)

19 months agoMFC: pw(8): fix combination of modes -N and -w random
Eugene Grosbein [Mon, 28 Nov 2022 14:22:39 +0000 (21:22 +0700)]
MFC: pw(8): fix combination of modes -N and -w random

The command "pw usermod nobody -Nw random" (or useradd)
generates random password and prints it in encrypted form
but skips choosen random string that makes not much sense
and contradicts the manual page pw.8

Fix it by showing random password in plain text with -N and
without it equally. Add yet another example of how to generate
pw-style random password.

(cherry picked from commit 1cbe5012cfe10226dd365af325a01de5d4c15f5d)

19 months agoFix compile for 32-bit architectures.
Kirk McKusick [Sun, 11 Dec 2022 01:20:08 +0000 (17:20 -0800)]
Fix compile for 32-bit architectures.

19 months agoAdd support for managing UFS/FFS snapshots to fsck_ffs(8).
Kirk McKusick [Wed, 9 Nov 2022 18:44:03 +0000 (10:44 -0800)]
Add support for managing UFS/FFS snapshots to fsck_ffs(8).

(cherry picked from commit 460ed6106cf0854caff62e4eeba8ffcd00ab0690)
(cherry picked from commit 689a9368eb60f061e10e1924f388b99e8f6c2cb2)
(cherry picked from commit 5f7acd18583116c3036e0f6e35a6f385e7e85741)

Sponsored by: The FreeBSD Foundation

19 months agoClarify error messages about bad inodes.
Kirk McKusick [Tue, 6 Sep 2022 23:16:24 +0000 (16:16 -0700)]
Clarify error messages about bad inodes.

(cherry picked from commit 2ddf8cdbe085fb72ba68643709bf01d6fcc079dc)

Sponsored by: The FreeBSD Foundation

19 months agoFormatting cleanups and debugging fix.
Kirk McKusick [Mon, 5 Sep 2022 19:06:58 +0000 (12:06 -0700)]
Formatting cleanups and debugging fix.

(cherry picked from commit 4b4cc78a762cd381111207a53ec094dd8d714506)

Sponsored by: The FreeBSD Foundation

19 months agoProperly handle the replacement of a partially allocated root directory.
Kirk McKusick [Sat, 3 Sep 2022 21:46:50 +0000 (14:46 -0700)]
Properly handle the replacement of a partially allocated root directory.

(cherry picked from commit f4fc3895243b9a8ae0577e731a3e450377071196)
(cherry picked from commit 2aa6ed881d22e4ed095d04ecb8a11f178274a644)
(cherry picked from commit 2567b60f62534bf5b243972f85b4921bba837439)

Sponsored by: The FreeBSD Foundation

19 months agoFlush and close getnextino cache when done using it in Pass 1b.
Kirk McKusick [Sat, 3 Sep 2022 21:15:50 +0000 (14:15 -0700)]
Flush and close getnextino cache when done using it in Pass 1b.

(cherry picked from commit cf17c2ff11a9e027e92bebdb3eb3fec6727c9c03)

Sponsored by: The FreeBSD Foundation

19 months agoCorrect calculation of inode location in getnextino cache.
Kirk McKusick [Mon, 29 Aug 2022 06:44:35 +0000 (23:44 -0700)]
Correct calculation of inode location in getnextino cache.

(cherry picked from commit 827622937efa741d5d84d72968cf1580a8c597d8)

Sponsored by: The FreeBSD Foundation

19 months agoCorrect calculation of inode location in getnextino cache.
Kirk McKusick [Mon, 29 Aug 2022 06:08:49 +0000 (23:08 -0700)]
Correct calculation of inode location in getnextino cache.

(cherry picked from commit 2e4da012d57edab9d71dc7a67dc706b6a9b7800d)

Sponsored by: The FreeBSD Foundation

19 months agoCorrect diagnostic messages for bad cylinder groups.
Kirk McKusick [Fri, 26 Aug 2022 07:31:44 +0000 (00:31 -0700)]
Correct diagnostic messages for bad cylinder groups.

(cherry picked from commit 27c6009e7237597a502521e0255a74164ff6bea7)

Sponsored by: The FreeBSD Foundation

19 months agoProvide better diagnostic messages for bad cylinder groups.
Kirk McKusick [Fri, 26 Aug 2022 06:56:31 +0000 (23:56 -0700)]
Provide better diagnostic messages for bad cylinder groups.

(cherry picked from commit 495b1baac32774e00a9a975d4cedd2aa9f7d81b2)

Sponsored by: The FreeBSD Foundation

19 months agoProvide cache coherency between getnextinode() and ginode()
Kirk McKusick [Wed, 24 Aug 2022 06:48:40 +0000 (23:48 -0700)]
Provide cache coherency between getnextinode() and ginode()

(cherry picked from commit 345bfec1090571ea219263c99eed29de27e143c8)

Sponsored by: The FreeBSD Foundation

19 months agoUpdate standard superblock when successful using an alternate superblock.
Kirk McKusick [Wed, 24 Aug 2022 06:28:30 +0000 (23:28 -0700)]
Update standard superblock when successful using an alternate superblock.

(cherry picked from commit be639cc8eef01a2b8849939eb07cfde476146794)

Sponsored by: The FreeBSD Foundation

19 months agoDrop checks with last alternate superblock in fsck_ffs(8).
Kirk McKusick [Thu, 4 Aug 2022 23:06:43 +0000 (16:06 -0700)]
Drop checks with last alternate superblock in fsck_ffs(8).

(cherry picked from commit 23c8b19c1d13b8fbd10c5941de0f2618f59db1c9)

Sponsored by: The FreeBSD Foundation

19 months agoClean up comments in fsck.h.
Kirk McKusick [Tue, 10 May 2022 23:05:05 +0000 (16:05 -0700)]
Clean up comments in fsck.h.

(cherry picked from commit bf46c0a9ae4e544e07ec460f31962618dffd2b1e)

Sponsored by: The FreeBSD Foundation

19 months agoProperly specify the level of indirect block being looked up.
Kirk McKusick [Thu, 5 May 2022 23:57:03 +0000 (16:57 -0700)]
Properly specify the level of indirect block being looked up.

(cherry picked from commit 262b581d1791fa5905d8771bef7fc201ed46d790)

Sponsored by: The FreeBSD Foundation

19 months agonvmecontrol: Fix IEEE OUI Identifier output
Wanpeng Qian [Sun, 20 Nov 2022 03:06:36 +0000 (19:06 -0800)]
nvmecontrol: Fix IEEE OUI Identifier output

Current sequence of IEEE OUI Identifier output is wrong.

For Intel, current output is e4 d2 5c, specification is 5CD2E4h
For Samsung, current output is 38 25 00, specification is 002538h
also check with Linux nvme-cli.

(cherry picked from commit 41be508d31a594f5212ef9e717df1f3e9ca295d8)

19 months agogetservent.3: Mention the service.db
Gordon Bergling [Wed, 7 Dec 2022 09:26:13 +0000 (10:26 +0100)]
getservent.3: Mention the service.db

- reference /var/db/services.db
- reference services_mkdb(8)

Obtained from: NetBSD

(cherry picked from commit 0393604aa86c7177162a0e6a288a8542a139273e)

19 months agoprotocols.5: Update the description of /etc/protocols
Gordon Bergling [Wed, 7 Dec 2022 11:31:44 +0000 (12:31 +0100)]
protocols.5: Update the description of /etc/protocols

The reference to the "DARPA Internet" seems not quite
up to date in 2022, so move that to the HISTORY section.

Mention RFC 2780 and RFC 5237.

Obtained from: NetBSD

(cherry picked from commit 899edecdbe92f678c3c96572c8877cdbc6763e9a)

19 months agofreebsd-update: restart sshd after upgrade
Ed Maste [Mon, 2 May 2022 17:16:19 +0000 (13:16 -0400)]
freebsd-update: restart sshd after upgrade

Sometimes the parent-child sshd protocol changes during an upgrade, and
when this happens sshd will not accept new connections until it is
restarted.

PR: 263489
Reviewed by: kevans, gjb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35109

(cherry picked from commit 6cd1bc53160973fc421c59f66aaa7e4b37a8cebe)

19 months agoRevert "heimdal: Fix bus fault when zero-length request received"
Cy Schubert [Thu, 8 Dec 2022 16:08:50 +0000 (08:08 -0800)]
Revert "heimdal: Fix bus fault when zero-length request received"

This is the wrong fix for PR/268062.

This reverts commit 6742ff42ab3b6e65239f975314060b1393e22d62.

(cherry picked from commit 5319949668a5cb4d182d7252ce26799506b3585d)

19 months agovmm: permit some IPIs to be handled by userspace
Corvin Köhne [Wed, 7 Sep 2022 07:07:03 +0000 (09:07 +0200)]
vmm: permit some IPIs to be handled by userspace

Add VM_EXITCODE_IPI to permit returning unhandled IPIs to userland.
INIT and STARTUP IPIs are now returned to userland. Due to backward
compatibility reasons, a new capability is added for enabling
VM_EXITCODE_IPI.

Reviewed by: jhb
Differential Revision:  https://reviews.freebsd.org/D35623
Sponsored by:           Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 0bda8d3e9f7a5c04881219723436616b23041e5f)

19 months agobhyve: create all vcpus on startup
Corvin Köhne [Wed, 7 Sep 2022 07:05:36 +0000 (09:05 +0200)]
bhyve: create all vcpus on startup

vcpus could be restarted by the guest by sending an INIT SIPI SIPI
sequence to a vcpu. That's not supported by bhyve yet but it will be
supported in a future commit. So, create the vcpu threads only once on
startup to make restarting a vcpu easier.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35621
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 9cc9abf409cc9d761f42b16b0dc8f5c0cc4f9a44)

19 months agobhyve: Initialize more registers in vcpu_reset()
Corvin Köhne [Wed, 27 Jul 2022 14:41:02 +0000 (16:41 +0200)]
bhyve: Initialize more registers in vcpu_reset()

- Clear CR2, EFER, and R8-15 to zero.
- Reset DR6 and DR7 to their documented reset values.
- Reset interrupt shadow state.
- Document the reason CR0 is reset to a value that doesn't match its
documented value.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35622
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 56b8f5b11171375bf5da484577926b53ce56a3be)

19 months agobhyve: fix spelling mistake in passthru emulation
Corvin Köhne [Wed, 27 Jul 2022 14:43:01 +0000 (16:43 +0200)]
bhyve: fix spelling mistake in passthru emulation

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35707
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 50526f522bc4e26e7bd610e376d85bb897c2686c)

19 months agovmm: emulate INVD by ignoring it
Corvin Köhne [Wed, 27 Jul 2022 14:39:47 +0000 (16:39 +0200)]
vmm: emulate INVD by ignoring it

On physical systems the ram isn't initialized on boot. So, coreboot uses
the cache as ram in this boot phase. When exiting cache as ram, coreboot
calls INVD for making the cache consistent.

In a virtual environment ram is always initialized and the cache is
always consistent. So, we can safely ignore this call.

Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D35620
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 4eadbef92493ea8d375207b2c2a0bd3a22603750)

19 months agoacpi: Tell SMM we will handle CPPC notifications
Tom Jones [Mon, 10 Oct 2022 13:46:25 +0000 (14:46 +0100)]
acpi: Tell SMM we will handle CPPC notifications

Buggy SMM implementations can hang while processing CPPC notifications.
This leads to some laptops (notably Thinkpads) hanging when the
hwpstate_intel driver is loaded.

Tell the SMM that we will handle CPPC notifications as described in:

- Intel® Processor Vendor-Specific ACPI
- Intel® 64 and IA-32 Architectures Software Developer’s Manual

CPPC events default to masked (disabled) so while we do not do any
handling right now this does not seem to lead to any issues.

This approach was found via this Linux Kernel patch:
https://lkml.org/lkml/2016/3/17/563

PR: 253288
Reviewed by: imp, jhb
Sponsored by: Modirum
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D36699

(cherry picked from commit 67f2a563bfcad75c16536ca500b06ddc9306dfa0)
(cherry picked from commit eee0f7aea42564fe005c74f004d63f8cc170ef59)
(cherry picked from commit 15bd2f366d3e878f5a8bc1628368d59ef318af5f)

19 months agobhyve: add varfile option to nvlist of lpc device
Corvin Köhne [Thu, 3 Mar 2022 07:45:20 +0000 (22:45 -0900)]
bhyve: add varfile option to nvlist of lpc device

Use seperate nvlist entries for the romfile and the varfile.

While here, don't leak varfd in bootrom_loadrom().

Reviewed by:    jhb, markj
Differential Revision:  https://reviews.freebsd.org/D33433

(cherry picked from commit 87f6367f10614f58e5f93130b7be3364d2f83068)

19 months agobhyve: Support a _VARS.fd file for bootrom
Rebecca Cran [Sun, 28 Nov 2021 16:34:33 +0000 (09:34 -0700)]
bhyve: Support a _VARS.fd file for bootrom

OVMF creates two separate .fd files, a _CODE.fd file containing
the UEFI code, and a _VARS.fd file containing a template of an
empty UEFI variable store.

OVMF decides to write variables to the memory range just below the
boot rom code if it detects a CFI flash device. So here we add
just the barest facsimile of CFI command handling to bootrom.c
that is needed to placate OVMF.

Submitted by: D Scott Phillips <d.scott.phillips@intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19976
MFC After: 1 week

(cherry picked from commit 866036f46c6e8884cc7a2aa029408366ede40a23)

19 months agolinuxkpi/dmi: don't match exactly on DMI_MATCH
Corvin Köhne [Fri, 3 Jun 2022 14:20:45 +0000 (16:20 +0200)]
linuxkpi/dmi: don't match exactly on DMI_MATCH

Linux has two defines to check dmi data. DMI_MATCH checks if the dmi
string includes substr. DMI_EXACT_MATCH checks if the dmi string exactly
matches substr. Compat layer should have the same behaviour.

The new definition of dmi_strmatch shouldn't break any driver. A driver
would break if it uses the highest bit of the slot field. Nevertheless,
linux uses the same definition and FreeBSD uses dmi_field values as slot
which are lower than 128.

Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35395

(cherry picked from commit 99902b1c52219bae4b9f3684e3ebd83152a1add4)

LinuxKPI: Fix dmi_matches() function

Make sure to check for NULL pointers and also check all search criterias,
not only the first one!

Bump the FreeBSD version.

Reviewed by: manu@
Differential Revision: https://reviews.freebsd.org/D35403
MFC after: 1 week
Sponsored by: NVIDIA Networking

(cherry picked from commit 85d7875d42913c2cb10a007a1be05b210dc6aab2)

19 months agokillall(1): allow sending signals to processes with control terminal on pts(4)
Daniel Dowse [Thu, 1 Dec 2022 02:42:35 +0000 (04:42 +0200)]
killall(1): allow sending signals to processes with control terminal on pts(4)

PR: 268093

(cherry picked from commit e442917ee41986c416afea1d152ad03c5daeeac4)

19 months agozfs: merge openzfs/zfs@21bd76613 (zfs-2.1-release) into stable/13
Martin Matuska [Tue, 6 Dec 2022 18:40:45 +0000 (19:40 +0100)]
zfs: merge openzfs/zfs@21bd76613 (zfs-2.1-release) into stable/13

OpenZFS release 2.1.7

Notable upstream pull requeset merges:
  #13680 Add options to zfs redundant_metadata property
  #13782 Fix setting the large_block feature after receiving a snapshot
  #13839 quota: extend quota for dataset
  #13938 Bring per_txg_dirty_frees_percent back to 30
  #13939 Fix panic in dsl_process_sub_livelist for EINTR
  #13973 Fix memory leaks in dmu_send()/dmu_send_obj()
  #13978 PAM: Fix unchecked return value from zfs_key_config_load()
  #13998 zvol_wait logic may terminate prematurely
  #14001 FreeBSD: Fix a pair of bugs in zfs_fhtovp()
  #14003 Stop ganging due to past vdev write errors
  #14050 Fix draid2+2s metadata error on simultaneous 2 drive failures
  #14062 zed: Avoid core dump if wholedisk property does not exist
  #14077 Propagate extent_bytes change to autotrim thread
  #14079 FreeBSD: vn_flush_cached_data: observe vnode locking contract
  #14093 Fix ARC target collapse when zfs_arc_meta_limit_percent=100
  #14119 Deny receiving into encrypted datasets if the keys are not
         loaded
  #14120 Fix arc_p aggressive increase
  #14129 zed: Prevent special vdev to be replaced by hot spare
  #14133 Expose zfs_vdev_open_timeout_ms as a tunable
  #14135 FreeBSD: Fix out of bounds read in zfs_ioctl_ozfs_to_legacy()
  #14161 Handle and detect #13709's unlock regression
  #14197 Don't leak packed recieved proprties
  #14204 Lua: Fix bad bitshift in lua_strx2number()

Obtained from: OpenZFS
OpenZFS tag: zfs-2.1.7
OpenZFS commit: 21bd7661334cd865d17934bebbcaf8d3356279ee
Relnotes: yes

19 months agoarm64: add a spin-table implementation for Apple Silicon
Kyle Evans [Fri, 11 Nov 2022 19:50:29 +0000 (13:50 -0600)]
arm64: add a spin-table implementation for Apple Silicon

The M1 has no EL3, so we're limited to a spin-table implementation if we
want to eventually use bhyve on it.  Implement spin-table now, but note
that we still prefer PSCI where possible.

Reviewed by: mmel

(cherry picked from commit 753a23ac152c5024de34f9eb02a2fdccf2881085)

19 months agoinit: fix shutdown race
Corvin Köhne [Tue, 6 Sep 2022 07:06:51 +0000 (09:06 +0200)]
init: fix shutdown race

When calling shutdown, shutdown sends a signal to init and exits. This
causes a race condition for the waitpid function. If the signal wins the
race, wpid will be set to -1 and init calls death_single. If shutdown
wins the race, wpid will be set to the pid of the shutdown process and
the requested_transition will be ignored.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36356
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

(cherry picked from commit 203f2c14c4b3c7a3e8f51a5a248201e1eb091886)

19 months agolibc: remove unneeded sys/types.h include from several synopses
Guilherme Janczak [Mon, 28 Nov 2022 22:57:37 +0000 (00:57 +0200)]
libc: remove unneeded sys/types.h include from several synopses

PR: 268028

(cherry picked from commit a6d40b0ad2c51e16a8c99750d5ed6f9aea2be7d4)

19 months agoheimdal: Fix bus fault when zero-length request received
Cy Schubert [Thu, 1 Dec 2022 00:11:18 +0000 (16:11 -0800)]
heimdal: Fix bus fault when zero-length request received

Zero length client requests result in a bus fault when attempting to
free malloc()ed pointers within the requests softc. Return an error
when the request is zero length.

PR: 268062
Reported by: Robert Morris <rtm@lcs.mit.edu>

(cherry picked from commit 6742ff42ab3b6e65239f975314060b1393e22d62)

19 months agoheimdal: Add additional checks for bad kadmind input
Cy Schubert [Wed, 30 Nov 2022 23:53:49 +0000 (15:53 -0800)]
heimdal: Add additional checks for bad kadmind input

Check return codes for bad input.

(cherry picked from commit d24b27283290e404dfa2bf38cd0769e92092e384)

19 months agopf: make pfsync_state_import appease an assert in pf_free_state
Mateusz Guzik [Tue, 6 Sep 2022 14:56:29 +0000 (16:56 +0200)]
pf: make pfsync_state_import appease an assert in pf_free_state

The newly created state failed to be inserted anywhere. This follows
other places.

Reviewed by: kp
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 69ce6ae21acd71b8e46d1f22176063e9d243511a)

19 months agoriscv: improve parsing of riscv,isa property strings
Mitchell Horne [Fri, 28 Oct 2022 16:28:08 +0000 (13:28 -0300)]
riscv: improve parsing of riscv,isa property strings

This code was originally written under the assumption that the ISA
string would only contain single-letter extensions. The RISC-V
specification has extended its description of the format quite a bit,
allowing for much longer ISA strings containing multi-letter extension
names.

Newer versions of QEMU (7.1.0) will append to the riscv,isa property
indicating the presence of multi-letter standard extensions such as
Zfencei. This triggers a KASSERT about the expected length of the
string, preventing boot.

Increase the size of the isa array significantly, and teach the code
to parse (skip over) multi-letter extensions, and optional extension
version numbers. We currently ignore them completely, but this will
change in the future as we start supporting supervisor-level extensions.

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

(cherry picked from commit 701923e2a4105be606c5263181b6eb6f546f1a84)

19 months agoddb(4): document some missing commands
Mitchell Horne [Fri, 11 Nov 2022 18:22:29 +0000 (14:22 -0400)]
ddb(4): document some missing commands

This is not exhaustive, just what I collected while working on
mac_ddb(4).

Reviewed by: pauamma, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation (in part)
Differential Revision: https://reviews.freebsd.org/D37333

(cherry picked from commit 831979ae0fb91a2ff674b7b1ab7d2c252a17e27d)

19 months agoddb(4): misc updates
Mitchell Horne [Fri, 11 Nov 2022 18:21:29 +0000 (14:21 -0400)]
ddb(4): misc updates

 - Describe optional 'addr' argument to many show commands
 - Remove obsolete commands (show cbstat)
 - 'show jails' was renamed to 'show prison'
 - Remove superfluous commentary about sleepqueues
 - Fix an xref to gdb(4)
 - Fix issues reported by mandoc -Tlint
 - Plus a couple other inaccuracies/inconsistencies

Reviewed by: pauamma, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation (in part)
Differential Revision: https://reviews.freebsd.org/D37332

(cherry picked from commit 94f6ee56e316be5648054e15f58dde9bd2c1c2c6)

19 months agoddb(4): improve wording
Warner Losh [Mon, 12 Jul 2021 21:13:13 +0000 (15:13 -0600)]
ddb(4): improve wording

Incorporate feedback overlooked in revew by wblock@

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D4860

(cherry picked from commit dc5a0d6d6d0c4ad88d032762f036876fb64eb0d5)

19 months agohier(7): remove text describing /usr/src layout
Mitchell Horne [Tue, 1 Nov 2022 15:15:18 +0000 (12:15 -0300)]
hier(7): remove text describing /usr/src layout

It poses a maintenance burden, since much of the information is
duplicated in the src tree's README.md file. Readers who are interested
enough in learning about the structure of the src tree can download it,
or browse the README online. Have hier(7) just point them there instead.

PR: 261349
Discussed with: freebsd-arch@, freebsd-doc@ lists
Reviewed by: imp, emaste
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37135

(cherry picked from commit f0e4e021103c13ff3da4cdf1f9395754d069cbfb)

19 months agodevelopment(7): redirect users from hier(7)
Mitchell Horne [Tue, 1 Nov 2022 15:18:53 +0000 (12:18 -0300)]
development(7): redirect users from hier(7)

The layout of the source tree is now only described in README.md. Retain
the cross-reference to hier(7) in SEE ALSO; it is still useful to
readers.

Reviewed by: imp, emaste
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37136

(cherry picked from commit 6028a56562bf912a86ffcb7521a58e4165937e6e)

19 months agoREADME.md: shift description of kernel config files
Mitchell Horne [Tue, 1 Nov 2022 15:14:41 +0000 (12:14 -0300)]
README.md: shift description of kernel config files

Document it in sys/README.md instead. Describe the purpose of LINT
config files as well.

Reviewed by: imp
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37134

(cherry picked from commit 9e0dcd0ab296ddcdee60a4952435175ae3f7bdb3)

19 months agosys/README.md: source roadmap improvements
Mitchell Horne [Tue, 1 Nov 2022 15:13:31 +0000 (12:13 -0300)]
sys/README.md: source roadmap improvements

Tweak the existing descriptions slightly. Add entries for several
directories which are not yet documented, but not exhaustively.

Reviewed by: imp (previous version), emaste
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37133

(cherry picked from commit 397013385d4b88ee7e6d9b13bd8c017ca9dfdad5)

19 months agoCreate sys/README.md
Mitchell Horne [Tue, 1 Nov 2022 15:12:14 +0000 (12:12 -0300)]
Create sys/README.md

Add this primarily to document the sys/ subdirectories of the source tree.

This is a straight copy from the contents of hier(7). Improvements will
follow in other changes.

Reviewed by: imp, emaste
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37132

(cherry picked from commit d1087fe8436dbe369b218854fffe901ccc7602c1)

19 months agobhyve: use dynamic ACPI table offsets
Corvin Köhne [Wed, 6 Apr 2022 09:10:44 +0000 (11:10 +0200)]
bhyve: use dynamic ACPI table offsets

Now that all ACPI tables are build by basl, basl can dynamically
calculate the offset for each table.

Reviewed by: jhb, markj (older version)
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37002

(cherry picked from commit 67654ffd4424a55ab04091f0ccdf472516c140d8)

19 months agobhyve: build RSDP table by basl
Corvin Köhne [Wed, 6 Apr 2022 09:10:43 +0000 (11:10 +0200)]
bhyve: build RSDP table by basl

Building the RSDP table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by: jhb, markj (older version)
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37001

(cherry picked from commit 03e7111fa6061b886dc756802d2e91dcafbfc054)

19 months agobhyve: build RSDT table by basl
Corvin Köhne [Wed, 6 Apr 2022 09:10:43 +0000 (11:10 +0200)]
bhyve: build RSDT table by basl

Building the RSDT table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by: jhb, markj (older version)
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37000

(cherry picked from commit f3dcdf8be4cc1cd6878f6e962a749dca372d5982)

19 months agobhyve: build XSDT table by basl
Corvin Köhne [Wed, 6 Apr 2022 09:10:42 +0000 (11:10 +0200)]
bhyve: build XSDT table by basl

Building the XSDT table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by: jhb, markj (older version)
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36999

(cherry picked from commit 4a60470f053dd035df6023457c153d3d86bc7123)

19 months agobhyve: build FADT table by basl
Corvin Köhne [Wed, 6 Apr 2022 09:10:42 +0000 (11:10 +0200)]
bhyve: build FADT table by basl

Building the FADT table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by: jhb, markj (older version)
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36998

(cherry picked from commit 6a75de903b10c3114e4f2205ba962deceb44b726)

19 months agobhyve: build MADT table by basl
Corvin Köhne [Wed, 6 Apr 2022 09:10:42 +0000 (11:10 +0200)]
bhyve: build MADT table by basl

Building the MADT table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by: jhb, markj (older version)
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36997

(cherry picked from commit 897fe59adf7b160fc2cf7a3f10334b236853c15a)

19 months agobhyve: build HPET table by basl
Corvin Köhne [Wed, 6 Apr 2022 09:10:41 +0000 (11:10 +0200)]
bhyve: build HPET table by basl

Building the HPET table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by: jhb, markj (older version)
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36996

(cherry picked from commit d61d71229902f4963e269a394b36ce67ba910cab)

19 months agobhyve: add helper to fill a ACPI_GENERIC_ADDRESS
Corvin Köhne [Wed, 16 Nov 2022 09:45:17 +0000 (10:45 +0100)]
bhyve: add helper to fill a ACPI_GENERIC_ADDRESS

Reviewed by: jhb
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37407

(cherry picked from commit 60277ad75ec905d25182368d1022f56f43b490d5)

19 months agobhyve: build MCFG table by basl
Corvin Köhne [Wed, 6 Apr 2022 09:10:41 +0000 (11:10 +0200)]
bhyve: build MCFG table by basl

Building the MCFG table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by: jhb, markj (older version)
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36995

(cherry picked from commit 2c2bd1553218248aab0ed9267d6b7d22cf96c1c5)

19 months agobhyve: add helper to append a basl table without a header
Corvin Köhne [Wed, 16 Nov 2022 08:31:29 +0000 (09:31 +0100)]
bhyve: add helper to append a basl table without a header

The common style for build an ACPI table will be:

1. basl_table_create
2. basl_table_append_header
3. setup an ACPI_TABLE_* struct
4. basl_table_append_bytes (without header)

Add a helper for the last step.

Reviewed by: jhb, markj
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37406

(cherry picked from commit 8897b562abbf1dbc2d6c83d31ed673d5220c3da3)

19 months agobhyve: make basl_table_add_* functions public
Corvin Köhne [Wed, 16 Nov 2022 08:15:12 +0000 (09:15 +0100)]
bhyve: make basl_table_add_* functions public

The code will be more readable if we use struct definitions from ACPI-CA
to build ACPI tables. We can fill out the struct and append it to the
basl_table by using basl_table_append_bytes. After that, we have to
declare which checksums, length and pointers should be patched by basl.
That's done by the add_* functions.

Reviewed by: jhb, markj
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37405

(cherry picked from commit 7263419f387db306340ed39fc058580872b64f3b)

19 months agobhyve: build FACS table by basl
Corvin Köhne [Wed, 6 Apr 2022 09:10:41 +0000 (11:10 +0200)]
bhyve: build FACS table by basl

Building the FACS table by basl will allow it to be loaded by qemu's
ACPI table loader in the future.

Reviewed by: jhb, markj (older version)
Approved by: manu (mentor)
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36994

(cherry picked from commit bdbb1da75a8ca10efff8c56e4ecd6944fdfd3268)

19 months agoIncrease the maximum size of the journaled soft-updates journal.
Kirk McKusick [Fri, 21 Oct 2022 18:00:00 +0000 (11:00 -0700)]
Increase the maximum size of the journaled soft-updates journal.

(cherry picked from commit 243a0eda9ace2f4d9cdd5291c352816ddc9ebdb2)

Sponsored by: The FreeBSD Foundation

19 months agoClean up error output for extended attributes in fsck_ffs(8).
Kirk McKusick [Mon, 7 Nov 2022 22:31:59 +0000 (14:31 -0800)]
Clean up error output for extended attributes in fsck_ffs(8).

(cherry picked from commit f515a279f7200fb69763fedd716b1a5e32e2cae9)

Sponsored by: The FreeBSD Foundation

19 months agoAdditional diagnostic output when running fsck_ffs with debugging flag (-d)
Kirk McKusick [Sun, 30 Oct 2022 21:59:44 +0000 (14:59 -0700)]
Additional diagnostic output when running fsck_ffs with debugging flag (-d)

(cherry picked from commit 595746df6fe946363233bd3eb73abe34e4457359)

Sponsored by: The FreeBSD Foundation

19 months agoImprove handling of missing '.' and '..' in UFS directories.
Kirk McKusick [Wed, 17 Aug 2022 21:19:59 +0000 (14:19 -0700)]
Improve handling of missing '.' and '..' in UFS directories.

(cherry picked from commit 6bae6625e0e06816c80ac4971dfccf0643abe3f0)

Sponsored by: The FreeBSD Foundation

19 months agoExplicitly initialize rather than reading newly allocated UFS inodes.
Kirk McKusick [Sat, 13 Aug 2022 20:50:08 +0000 (13:50 -0700)]
Explicitly initialize rather than reading newly allocated UFS inodes.

(cherry picked from commit 6b9d4fbb7fe550788d82168e7beeabcd5ad238ce)

Sponsored by: The FreeBSD Foundation

19 months agoCorrectness cleanups in fsck_ffs(8).
Kirk McKusick [Sat, 13 Aug 2022 20:27:37 +0000 (13:27 -0700)]
Correctness cleanups in fsck_ffs(8).

(cherry picked from commit 6e821c35d68d4041640b27419837464ffab65cff)

Sponsored by: The FreeBSD Foundation

19 months agoFix compilation issue when kernel built without FFS defined.
Kirk McKusick [Sun, 4 Dec 2022 05:20:39 +0000 (21:20 -0800)]
Fix compilation issue when kernel built without FFS defined.

This is not cherry-picked because it occurs only in 13 and not
in 14 or later kernels.

Reported by:  Boris Korzun
Tested by:    Boris Korzun
PR:           263979
Sponsored by: The FreeBSD Foundation

19 months agofetch: support EAI_ADDRFAMILY error, correct two error messages
Mike Karels [Wed, 2 Nov 2022 15:59:09 +0000 (10:59 -0500)]
fetch: support EAI_ADDRFAMILY error, correct two error messages

With the change to return EAI_ADDRFAMILY from getaddrinfo(), fetch
would print "Unknown resolver error" for that error.  Add that error
and its string to libfetch's table, using an #ifdef just in case.
Correct error strings for EAI_NODATA (although it is currently unused)
and EAI_NONAME.  Should maybe rework the code to use gai_strerror(3),
but that doesn't map directly, and the current strings are shortened.

Reviewed in https://reviews.freebsd.org/D37139 with related changes.

Reviewed by:    bz

(cherry picked from commit 631b82aca0fd41c8e0d48eebdb9c4e38b7306472)

19 months agogetaddrinfo: distinguish missing addrs from unresolvable names
Mike Karels [Wed, 2 Nov 2022 15:57:59 +0000 (10:57 -0500)]
getaddrinfo: distinguish missing addrs from unresolvable names

Rework getaddrinfo(3) to return different error values for unresolvable
names (same as before, EAI_NONAME) and those without a requested addr
(EAI_ADDRFAMILY) when using DNS.  This is implemented via an added
error in the nsswitch layer, NS_ADDRFAMILY, which is used only by
getaddrinfo().  The error is passed through nsdispatch(3), but that
routine has no changes to handle this error.  The error originates in
the getaddrinfo DNS layer called via nsdispatch(), and is processed
by the search layer that calls nsdispatch().

While here, add a little style to returns near those that were
modified.

Reviewed in https://reviews.freebsd.org/D37139 with related changes.

Reviewed by:    bz

(cherry picked from commit 144361386696582c04592f200a4c2e3339c81a25)

19 months agogai_strerror.[c3]: re-enable EAI_ADDRFAMILY, EAI_NODATA
Mike Karels [Wed, 2 Nov 2022 15:55:32 +0000 (10:55 -0500)]
gai_strerror.[c3]: re-enable EAI_ADDRFAMILY, EAI_NODATA

gai_strerror.c still has messages for EAI_ADDRFAMILY and EAI_NODATA,
but not the man page.  Re-add to the man page, and update comments
in the source.  Document the errors that are not in RFC 3493 or
POSIX.

Reviewed in https://reviews.freebsd.org/D37139 with related changes.

Reviewed by:    bz, pauamma

(cherry picked from commit e34adc71d3724a8b1add483310efbc63db9290a6)