Commit Graph

20005 Commits

Author SHA1 Message Date
Corvin Köhne
f565b4d630
bhyve: add helper struct for qemus acpi table loader
The hypervisor is aware of all system properties. For the guest bios
it's hard and complex to detect all system properties. For that reason,
it would be better if the hypervisor creates acpi tables instead of the
guest. Therefore, the hypervisor has to send the acpi tables to the
guest. At the moment, bhyve just copies the acpi tables into the guest
memory. This approach has some restrictions. You have to keep sure that
the guest doesn't overwrite them accidentally. Additionally, the size of
acpi tables is limited.

Providing a plain copy of all acpi tables by fwcfg isn't possible. Acpi
tables have to point to each other. So, if the guest copies the acpi
tables into memory by it's own, it has to patch the tables. Due to
different layouts for different acpi tables, there's no generic way to
do that.  For that reason, qemu created a table loader interface. It
contains commands for the guest for loading specific blobs into guest
memory and patching those blobs.

This commit adds a qemu_loader class which handles the creation of qemu
loader commands. At the moment, the WRITE_POINTER command isn't
implement. It won't be required by bhyve's acpi table generation yet.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38438
2023-04-25 08:29:25 +02:00
John Baldwin
672eba2435 ppp: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39730
2023-04-24 08:53:49 -07:00
John Baldwin
4b75b42ddb ndp: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39729
2023-04-24 08:53:49 -07:00
John Baldwin
bd22d268d3 rpc.umntall: Use valid prototype for function declaration with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39728
2023-04-24 08:53:49 -07:00
John Baldwin
7b043ce598 rpc.lockd: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39727
2023-04-24 08:53:49 -07:00
Val Packett
b344bd3a7d ext2fs: extract crc16 into sys/crc16.h
deduplicate this as it might be needed for other drivers (e.g. Apple SPI-HID)

Sponsored by:	https://www.patreon.com/valpackett
Reviewed by:	chuck, imp
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D32879
2023-04-24 12:41:52 +03:00
Yuri Pankov
336c4682b6 tzsetup: add baseline file to control parsed zonetab contents
Introduce undocumented option -d to dump parsed zonetab file contents
and add a "baseline" target along with instructions on updating it.

Reviewed by:	philip
Differential Revision:	https://reviews.freebsd.org/D39634
2023-04-23 10:32:02 +02:00
Colin Percival
df53ae0fdd Remove portsnap(8)
Rather than having a tool in the FreeBSD base system for obtaining
the FreeBSD ports tree, users are encouraged to `pkg install git`
and then `git clone https://git.FreeBSD.org/ports.git /usr/ports`.

The portsnap servers will continue operating until FreeBSD 13 reaches
its End-of-Life, and portsnap is available from the ports tree as
ports-mgmt/portsnap.

Requested by:	portmgr
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D39563
X-MFC:		no
2023-04-22 18:12:37 -07:00
Simon J. Gerraty
188bf8876f Build host tools on non-FreeBSD host with DIRDEPS_BUILD
Add Makefile.depend.options to libnetbsd, mkimg and makefs
to ensure libegacy is build if needed.

targets/pseudo/stage/Makefile avoid the need for mtree
the staging process creates target dirs as needed anyway.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39757
2023-04-22 13:13:22 -07:00
Rick Macklem
33906122e1 nfsuserd.c: Replace slave with server 2023-04-22 08:18:02 -07:00
Simon J. Gerraty
0c3627f44d bsdinstall avoid subdir depending on parent
When not doing tree walks, it is bad for sub-dirs to depend on
parents.  Move the generation of opt_osname.h to distextract
and have others that need that depend on it.

In usr.sbin/bsdinstall use SUBDIR_DEPEND_ so tree walking still works.

Reviewed by:	obrien
Differential Revision:	https://reviews.freebsd.org/D39742
2023-04-20 22:00:40 -07:00
Ed Maste
dd9059b3e9 makefs: set cd9660 Rock Ridge timestamps for . and ..
DOT and DOTDOT entries have special handling, and previously only Rock
Ridge PX (POSIX attributes) entries were attached.  Add TF (timestamp)
entries as well.

PR:		203531
Reported by:	Thomas Schmitt <scdbackup@gmx.net>
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39662
2023-04-20 12:20:56 -04:00
Yuri Pankov
4fee5114c3 tzsetup(8): update paths to zone tab and tzdata source
tzsetup now uses zone1970.tab and zoneinfo source is located in
contrib/tzdata, update the man page accordingly.

While here, drop obsolete Tn macros and insert vertical breaks (mostly
before Dl in examples) to improve readability.

Reviewed by:	pauamma_gundo.com (manpages)
Differential Revision:	https://reviews.freebsd.org/D39643
2023-04-19 13:56:58 +02:00
Simon J. Gerraty
d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
John Baldwin
35a624c549 keyserv: Use C89 function definitions.
Also use more accurate function pointer types, and trim some duplicate
(but incomplete) function prototypes.

Reviewed by:	zlei
Differential Revision:	https://reviews.freebsd.org/D39533
2023-04-18 11:30:51 -07:00
John Baldwin
69b5038738 yp: Use more accurate function pointer types.
Trim a few duplicate (but incomplete) function prototypes as well.

Reviewed by:	zlei, imp
Differential Revision:	https://reviews.freebsd.org/D39532
2023-04-18 11:28:57 -07:00
John Baldwin
2541accb79 rpc.lockd: Use C89 function definitions.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39530
2023-04-18 11:28:24 -07:00
John Baldwin
e93f27e3ae cron: Use C89 function definitions.
Reviewed by:	zlei
Differential Revision:	https://reviews.freebsd.org/D39529
2023-04-18 11:28:07 -07:00
John Baldwin
525438ea71 sendmail: Silence -Wdeprecated-non-prototype warnings.
These will hopefully be fixed upstream eventually, but silence the
warnings until then.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39518
2023-04-18 11:19:48 -07:00
Ed Maste
79ead08497 makefs: remove unused variable
Reported by:	Clang
Sponsored by:	The FreeBSD Foundation
2023-04-17 08:22:12 -04:00
Ed Maste
10854bf517 makefs: use unsigned and %u for rock_ridge_move_count
For diff reduction against NetBSD's makefs.  Based on NetBSD git mirror
commit 00991aee8248.

With this change our makefs cd9660 support should be in sync up to
NetBSD commit bdae6c9dc792 ("makefs(8): Nix trailing whitespace.").

Sponsored by:	The FreeBSD Foundation
2023-04-17 08:21:28 -04:00
Ed Maste
e5551216d8 makefs: call brelse from bread
This matches NetBSD and rationalizes makefs with the kernel API.

This reverts commit 370e009188.

Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
Obtained from:	NetBSD 0a62dad69f62, 0c4125e1a19f, cb6a5a3575fd
Differential Revision:	https://reviews.freebsd.org/D39070
2023-04-16 15:45:17 -04:00
Ed Maste
c753f49f70 makefs: remove unused cd9660 options
Makefs defined "follow-symlinks" and "help" options, but they did
nothing.  Remove them.

Obtained from:	OpenBSD a8f1645688c2
Sponsored by:	The FreeBSD Foundation
2023-04-16 09:38:02 -04:00
Ihor Antonov
8935a39932 daemon: use kqueue for all events
Refactor daemon to use kqueue/kevent instead of signals.

This changes allows to simplify the code in several ways:
- the execution flow is now linear, no async events.
- several variables became redundant and got removed.
- all event handling is now concentrated inside of the event loop, which
  makes code reading and comprehension easier.
- new kqueuex(2) call is used for CLOEXEC, but maintained closing the
  kq fd prior to execve() to ease later MFC

No UX/API changes are intended.

Reviewed by:	kevans
Pull Request:	https://github.com/freebsd/freebsd-src/pull/701
2023-04-14 00:12:21 -05:00
Corvin Köhne
158adced65
bhyve: save softc of ACPI devices
This will be useful for writing device specific ACPI tables or DSDT
methods.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39322
2023-04-13 08:00:09 +02:00
Corvin Köhne
305edaa479
bhyve: add QEMU_FWCFG_INDEX_MAX_CPUS item
Requested-by:		coreboot
Reviewed by:		<If someone else reviewed your modification.>
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39315
2023-04-12 09:35:33 +02:00
Corvin Köhne
b6e67875a3
bhyve: add hook for PCI header of passthru devices
Most register of the PCI header are either constant values or require
emulation anyway. The command and status register are the only exception which
require hardware access. So, we're adding an emulation handler for all
other register.

As this emulation handler will be reused by some future features like
GPU passthrough, we directly export it.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33010
2023-04-12 09:22:24 +02:00
Corvin Köhne
931bb7bf1c
bhyve: define array to protect passthru regs
GPU passthrough requires a special handling of some PCI config register.
Therefore, we need a flexible approach for implementing it. Adding an
array of handler meets this condition.

Start by using the default handler for all accesses to the PCI config
space. In upcoming commits, we can start to split the default handler
into several handler for each register that requires emulation.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39291
2023-04-12 09:22:19 +02:00
Corvin Köhne
e976464a50
bhyve: allow device specific DSDT entries
This feature will be used by future commits to implement a device
specific method (_DSM) for TPM devices.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39321
2023-04-12 08:33:47 +02:00
Corvin Köhne
ab34ea4711
bhyve: check for errors when writing device specific DSDT entries
At the moment, this function can't fail. This behaviour will change in
the future. In preparation to that, convert the return type to int in
order to be able to check for errors.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39422
2023-04-12 08:33:29 +02:00
Corvin Köhne
0926566f6f
bhyve: allow building device specific ACPI tables
Some ACPI devices require a device specific acpi table. E.g. a TPM2
device requires a TPM2 table. Use the acpi_device_emul struct to define
such a device specific table.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39320
2023-04-12 08:27:04 +02:00
Ed Maste
af7624ed31 makefs: use %s and __func__ in printf messages
For diff reduction against NetBSD.

Obtained from:	NetBSD 0c4125e1a19f
Sponsored by:	The FreeBSD Foundation
2023-04-11 11:21:36 -04:00
Corvin Köhne
0d29d750b9
bhyve: do not exit if LPC finds no host selector
The host selector is only required when the user likes to use the same
LPC device IDs as the physical LPC device. This is an uncommon use case.
For that reason, it makes no sense to exit when we don't find the host
selector.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39311
2023-04-11 08:39:21 +02:00
Ed Maste
22db5e5d03 makefs: set the validation entry system type
Obtained from:	NetBSD c3cb4dcc9c43
Sponsored by:	The FreeBSD Foundation
2023-04-10 19:07:14 -04:00
Ed Maste
1d1ffa2efd makefs: use size_t or ssize_t where appropriate
Obtained from:	NetBSD af7bc97830ac
2023-04-10 18:50:27 -04:00
Ed Maste
c02e6ca7c2 makefs: simplify filename conversion handling
Obtained from:	OpenBSD 4095a2e01d18
Sponsored by:	The FreeBSD Foundation
2023-04-10 12:03:06 -04:00
Ed Maste
d73acb32d3 makefs: remove some unused cd9660 types and defines
Obtained from:	OpenBSD
Sponsored by:	The FreeBSD Foundation
2023-04-10 11:15:34 -04:00
Ed Maste
7bc4ccf3ae makefs: avoid uninitialized memory in root directory date
Move date setting into cd9660_populate_iso_dir_record so there is no
path that leaves it unset.

PR:		203531
Reported by:	Thomas Schmitt <scdbackup@gmx.net>
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39258
2023-04-06 13:47:35 -04:00
Christos Margiolis
f21faa67ab makefs(8): do not print comma after the last super-block
Reviewed by:	markj, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39430
2023-04-05 18:25:19 -04:00
Ed Maste
2f11df6337 makefs: remove CD9660MAXPATH #define
It was used only in constructing the host path that contains file
content, which is not related to anything CD9660-specific.  PATH_MAX is
the appropriate limit.  See OpenBSD commit 299d8950f319.

Obtained from:	OpenBSD
Sponsored by:	The FreeBSD Foundation
2023-04-05 14:05:49 -04:00
Corvin Köhne
acd0088c44
bhyve: introduce acpi_device_emul struct
It'll be easier to add new properties to the ACPI device emulation if we
have a struct which holds all device specific properties. In some future
commits the acpi_device_emul struct will be expanded to include some
device specific functions to build ACPI tables.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39319
2023-04-05 09:06:41 +02:00
Corvin Köhne
76fa62b523
bhyve: add missing include to qemu_fwcfg.c
Fixes:			e46be58cca ("bhyve: add QEMU_FWCFG_INDEX_NB_CPUS item")
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
2023-04-04 13:28:37 +02:00
Corvin Köhne
e46be58cca
bhyve: add QEMU_FWCFG_INDEX_NB_CPUS item
Requested-by:		OVMF (qemu)
Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39316
2023-04-04 10:26:15 +02:00
Martin Matuska
2a58b312b6 zfs: merge openzfs/zfs@431083f75
Notable upstream pull request merges:
  #12194 Fix short-lived txg caused by autotrim
  #13368 ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()
  #13392 Implementation of block cloning for ZFS
  #13741 SHA2 reworking and API for iterating over multiple implementations
  #14282 Sync thread should avoid holding the spa config write lock
         when possible
  #14283 txg_sync should handle write errors in ZIL
  #14359 More adaptive ARC eviction
  #14469 Fix NULL pointer dereference in zio_ready()
  #14479 zfs redact fails when dnodesize=auto
  #14496 improve error message of zfs redact
  #14500 Skip memory allocation when compressing holes
  #14501 FreeBSD: don't verify recycled vnode for zfs control directory
  #14502 partially revert PR 14304 (eee9362a7)
  #14509 Fix per-jail zfs.mount_snapshot setting
  #14514 Fix data race between zil_commit() and zil_suspend()
  #14516 System-wide speculative prefetch limit
  #14517 Use rw_tryupgrade() in dmu_bonus_hold_by_dnode()
  #14519 Do not hold spa_config in ZIL while blocked on IO
  #14523 Move dmu_buf_rele() after dsl_dataset_sync_done()
  #14524 Ignore too large stack in case of dsl_deadlist_merge
  #14526 Use .section .rodata instead of .rodata on FreeBSD
  #14528 ICP: AES-GCM: Refactor gcm_clear_ctx()
  #14529 ICP: AES-GCM: Unify gcm_init_ctx() and gmac_init_ctx()
  #14532 Handle unexpected errors in zil_lwb_commit() without ASSERT()
  #14544 icp: Prevent compilers from optimizing away memset()
         in gcm_clear_ctx()
  #14546 Revert zfeature_active() to static
  #14556 Remove bad kmem_free() oversight from previous zfsdev_state_list
         patch
  #14563 Optimize the is_l2cacheable functions
  #14565 FreeBSD: zfs_znode_alloc: lock the vnode earlier
  #14566 FreeBSD: fix false assert in cache_vop_rmdir when replaying ZIL
  #14567 spl: Add cmn_err_once() to log a message only on the first call
  #14568 Fix incremental receive silently failing for recursive sends
  #14569 Restore ASMABI and other Unify work
  #14576 Fix detection of IBM Power8 machines (ISA 2.07)
  #14577 Better handling for future crypto parameters
  #14600 zcommon: Refactor FPU state handling in fletcher4
  #14603 Fix prefetching of indirect blocks while destroying
  #14633 Fixes in persistent error log
  #14639 FreeBSD: Remove extra arc_reduce_target_size() call
  #14641 Additional limits on hole reporting
  #14649 Drop lying to the compiler in the fletcher4 code
  #14652 panic loop when removing slog device
  #14653 Update vdev state for spare vdev
  #14655 Fix cloning into already dirty dbufs
  #14678 Revert "Do not hold spa_config in ZIL while blocked on IO"

Obtained from:	OpenZFS
OpenZFS commit:	431083f75b
2023-04-03 16:49:30 +02:00
Navdeep Parhar
4913a24e79 cxgbetool(8): Add support for tracing loopback traffic for a port.
Use lo<n> to tap the loopback for port <n>.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2023-04-01 17:50:57 -07:00
Ed Maste
c6ed8694ac makefs: improve some cd9660 error messages
Obtained from:	OpenBSD
Sponsored by:	The FreeBSD Foundation
2023-03-31 10:03:05 -04:00
Corvin Köhne
d3e03d235e
bhyve: scan PCI device functions to find host LPC
At least on some AMD devices the host LPC bridge could be located as
seperate function of another PCI device.

Fixes:			f4ceaff56d
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39310
2023-03-31 08:00:06 +02:00
Ed Maste
f0bef3d20e makefs: #define Apple Partition bits
NetBSD defines these in sys/bootblock.h, which we don't have.  Add local
defintions in cd9660_eltorito.c (as OpenBSD did) to reduce diffs between
the three makefs implementations.

Obtained from:	OpenBSD
Sponsored by:	The FreeBSD Foundation
2023-03-30 18:27:30 -04:00
Ed Maste
efe6a1574e makefs: correct "filname" typo
Obtained from:	NetBSD cd9660.c r1.58
2023-03-30 12:21:26 -04:00
Corvin Köhne
e37edc91b6
bhyve: return EEXIST when adding a fwcfg item twice
Reviewed by:		rew
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39338
2023-03-30 18:10:31 +02:00