Commit Graph

283179 Commits

Author SHA1 Message Date
Zhenlei Huang
6f96b5487f elf.5: Fix conjugation of holds
MFC after:	1 week
2023-04-25 18:21:52 +08:00
Peter Holm
883a49e5a1 stress2: Update the exclude list 2023-04-25 11:42:04 +02:00
Andrew Turner
6a9c2e63be Add padding for future use on arm64
Allow new features to be supported without changing the size of
existing structures.

Reviewed by:	kib
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39777
2023-04-25 10:23:15 +01:00
Vladimir Kondratyev
19c804b74f bcm5974(4): Make Magic Trackpad 2 support endian-safe.
While here make touch orientation event matching with Linux

MFC after:	1 month
2023-04-25 12:20:53 +03:00
Val Packett
ef8397c28e bcm5974(4): add Magic Trackpad 2 (USB only) support
The MT2 uses a compact report format, but otherwise is similar in many
ways to the internal trackpads, it even uses the same mode switching
commands.

Reviewed by:	wulf
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D34437
2023-04-25 12:20:53 +03:00
Stefan Eßer
88a795e80c sys/fs: do not report blocks allocated for synthetic file systems
The pseudo file systems (devfs, fdescfs, procfs, etc.) report total
and available blocks and inodes despite being synthetic with no
underlying storage device to which those values could be applied.

The current code of these file systems tends to report a fixed number
of total blocks but no free blocks, and in the case of procfs,
libprocfs, linsysfs also no free inodes.

This can be irritating in e.g. the "df" output, since 100% of the
resources seem to be in use, but it can also create warnings in
monitoring tools used for capacity management.

This patch makes these file systems return the same value for the
total and free parameters, leading to 0% in use being displayed by
"df". Since there is no resource that can be exhausted, this appears
to be a sensible result.

Reviewed by:	mckusick
Differential Revision:	https://reviews.freebsd.org/D39442
2023-04-25 09:59:15 +02:00
Stefan Eßer
0728695c63 fs/msdosfs: Fix potential panic and size calculations
Some combinations of FAT12 file system parameters could cause a kernel
panic due to an unmapped access if the size of the FAT was larger than
the CPU page size. The reason is that FAT12 uses 3 bytes to store
2 FAT pointers, leading to partial FAT pointers at the end of buffers
of a size that is not a multiple of 3.

With a typical page size of 4 KB, this caused the FAT entry at byte
offsets 4095 and 4096 to cross the page boundary, with only the first
page mapped. This was fixed by adjusting the mapping to always cover
both bytes of each FAT entry.

Testing revealed 2 other inconsistencies that are fixed by this commit:

1) The calculation of the size of the data area did not take into
   account the fact that the first two data block numbers are reserved
   and that the data area starts with block 2. This could cause a
   FAT12 file system created with the maximum supported number of
   blocks to be incorrectly identified as FAT16.

2) The root directory does not take up space in the data area of a
   FAT12 or FAT16 file system, since it is placed into a reserved
   area outside of that data area. This commits makes stat() report
   the logical size of the root directory, but with 0 blocks allocated
   from the data area.

PR:		270587
Reviewed by:	mckusick
Differential Revision:	https://reviews.freebsd.org/D39386
2023-04-25 09:58:29 +02:00
Simon J. Gerraty
4b932c2c9e Set MK_host_egacy=yes earlier
If we need to set MK_host_egacy=yes we might need to check it
in local.toolchain.mk so set it earlier in local.meta.sys.env.mk

Leave the default MK_host_egacy?=no in local.sys.mk so it can
be tested in Makefiles without concern for build mode.
2023-04-25 00:26:35 -07:00
Konstantin Belousov
04d815f115 netipsec/key.c: use designated initializers for arrays
Also de-expand nitems() use in related asserts, and fix maxsize array
name in the assert message.

Sponsored by:	NVidia networking
2023-04-25 09:41:24 +03:00
Konstantin Belousov
fcc7aabdca netipsec: some style
Sponsored by:	NVidia networking
2023-04-25 09:39:51 +03:00
Corvin Köhne
7959d80d99
bhyve: make use of qemus acpi table loader
Add all acpi tables to qemus acpi table loader. This passes the acpi
tables by fwcfg to the guest.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38439
2023-04-25 08:29:29 +02:00
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
Simon J. Gerraty
cb3c414f2f bmake does not need libegacy 2023-04-24 16:55:45 -07:00
Simon J. Gerraty
8c973ee23d Merge bmake-20230414
Merge commit '51d8a8b4ac1dd7265e891149e470a803906de2a7'
2023-04-24 16:50:16 -07:00
Simon J. Gerraty
51d8a8b4ac Import bmake-20230414
Relevant/interesting changes:

	* make.1: document seemingly unexplained Error code 6.
	o compat.c: CompatDeleteTarget skip .PHONY targets to be
	consistent with JobDeleteTarget.
	o job.c: fix memory leak in handling sysv :from=to modifiers
	o unit tests for .MAKE.META.IGNORE_{FILTER,PATHS,PATTERNS}
	o var.c: fix parsing of unevaluated subexpressions with
	unbalanced '{}'
	o cond.c: reduce complexity of evaluating expressions
2023-04-24 16:44:30 -07:00
Cheng Cui
1f782fcc0c
Remove unused fields in siftr_stats. Thus, update the man page as well.
Summary: Remove unused fields in siftr_stats. Thus, update the man page as well.

Test Plan: Tested in Emulab testbed.

Reviewers: rscheff, tuexen
Approved by: rscheff, tuexen
Subscribers: imp, melifaro, glebius
Differential Revision: https://reviews.freebsd.org/D39776
2023-04-24 15:31:15 -04:00
Cheng Cui
8aa2be695e
Correct the value of macro TF2_TCP_ACCOUNTING.
Summary: Make sure the values are in order.

Reviewers: rscheff, tuexen, #transport!
Approved by: rscheff, tuexen, glebius
Subscribers: imp, melifaro, glebius
Differential Revision: https://reviews.freebsd.org/D39716
2023-04-24 15:28:41 -04:00
Olivier Certner
6a5e614015 vn_open_vnode(): fix locking around VOP_CLOSE() on advisory lock error
In the case of a FIFO or if trying to open a file for writing, an
exclusive lock is necessary.

Reviewed by:	kib
MFC after:	1 week
2023-04-25 01:37:58 +03:00
Olivier Certner
faec42a3ef sys/dirent.h: comment update, 'd_off' is offset of next entry
This is the historical (and still current) behavior, as well as that of
NetBSD, OpenBSD, illumos and Linux (getdents()/getdents64()).

Reviewed by:	kib
MFC after:	3 days
2023-04-25 00:32:10 +03:00
Konstantin Belousov
a718431c30 lookup(): ensure that openat("/", "..", O_RESOLVE_BENEATH) fails
PR:	269780
Reported by:	Dan Gohman <dev@sunfishcode.online>
Reviewed by:	emaste, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39773
2023-04-25 00:32:10 +03:00
John Baldwin
77d2a2d065 depend-cleanup.sh: Handle kqueue1() becoming a wrapper around kqueuex().
For a brief period kqueue1() was a system call and stale dependencies
cause it to not be re-built.
2023-04-24 14:05:18 -07:00
Simon J. Gerraty
644d346d99 We do not need readpassphrase from openssh
When building tar for linux, just disable HAVE_READPASSPHRASE
in config_freebsd.h and libarchive will provide for readpassphrase
Otherwise the two conflict.
2023-04-24 13:50:18 -07:00
Graham Perrin
b6d173e44b share/misc/committers-doc.dot: dru: 2020, not 202
Dru Lavigne's doc commit bit was taken in 2020-05-05

https://cgit.freebsd.org/doc/commit/access?h=refs/internal/admin&id=fb28136a81580786a66ab2494da40b01f4b7a75b

Fixes: 52f5764598 committers-doc.dot: bring file up to date
2023-04-24 20:00:45 +01:00
Simon J. Gerraty
976ba7f02a Enable building tar for non-FreeBSD host
For DIRDEPS_BUILD we need Makefile.depend.options to
force libegacy to be built on older FreeBSD and non-FreeBSD hosts.

Add readpassphrase to libegacy to avoid the need for libbsd on Linux

src.opts.mk disable TESTS for host if MK_host_egacy is yes

Reviewed by:	imp
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D39766
2023-04-24 10:20:17 -07:00
Mateusz Guzik
c5b5f2d808 cp: Revert "If copy_file_range(2) fails with EXDEV, use fall-back."
This reverts commit 6433365490.

The error is not valid per api contract, it showed up as a regression
after 15f0b8c309

15f0b8c309 ("zfs: merge openzfs/zfs@9cd71c860 (master)") and was
subsequently in d012836fb6 ("zfs: fix up EXDEV handling for
clone_range").

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-24 16:04:53 +00:00
John Baldwin
9b02f2daf4 powerpc: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39733
2023-04-24 08:53:50 -07:00
John Baldwin
4640fd28a1 netstat: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39731
2023-04-24 08:53:50 -07: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
John Baldwin
0a04bb7a4f fdisk: Use valid prototypes for function declarations with no arguments.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39726
2023-04-24 08:53:49 -07:00
John Baldwin
76318a013d libsmdb: Silence -Wstrict-prototype warnings.
Presumably upstream will fix this eventually.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39725
2023-04-24 08:53:49 -07:00
John Baldwin
14b57ade94 zlib: Silence -Wstrict-prototype warnings.
Presumably upstream will fix this eventually.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39724
2023-04-24 08:53:49 -07:00
Andrew Turner
c94e4d91da Clean up PCI DEN0115 driver probing
Rather than checking for the SMCCC version check if the PCI_VERSION
call returns a valid version.

Sponsored by:	Arm Ltd
2023-04-24 16:34:21 +01:00
Warner Losh
d4c78130f4 powerpc: syscalls.c is standard
No need to add it here, much less make it optional on ktr.

Sponsored by:		Netflix
2023-04-24 09:25:42 -06:00
Justin Hibbits
02f3b17fa5 Mechanically convert Xen netfront/netback(4) to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37800
2023-04-24 09:54:23 -04:00
Justin Hibbits
7814374b7c IfAPI: Hide the macros that touch ifnet members
Nothing should be directly touching the ifnet members, which are hidden
in <net/if_private.h>, so hide them in the same header to avoid errors
from users.

Sponsored by:	Juniper Networks, Inc.
2023-04-24 09:54:23 -04:00
Justin Hibbits
97583aa256 linuxkpi: Migrate to IfAPI
Summary:
Trivial changes for LinuxKPI to use IfAPI.  The 'bsdifp' looks unused,
so removed it instead of converting it to a pointer.

Bump __FreeBSD_version for change to struct net_device.

Reviewed by:	bz, hselasky
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39491
2023-04-24 09:54:22 -04:00
Andrew Turner
c3785c3eb0 Remove unneeded SMMU macros
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39186
2023-04-24 12:48:01 +01:00
Andrew Turner
cdd34e0038 Remove virtual addresses from smmu_pmap_remove_pages
This function needs to unmap all memory in a given SMMU context. Have
it iterate over all page table entries to find what has been mapped
rather than looking at virtual addresses.

While here use SMMU specific macros.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39185
2023-04-24 12:47:55 +01:00
Andrew Turner
b97e94d91e Move to a SMMU specific struct for the smmu pmap
This is not managed through the VM subsystem so only needs to hold the
data the SMMU driver needs.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39184
2023-04-24 12:47:50 +01:00
Andrew Turner
49ee1a7ef0 Create a common function to get the SMMU sid
Now the PCI drivers have a common interface to read the IOMMU xref
and SID create a common function to read it. This fixes an issue where
we will call into an ACPI specific function when booting with FDT when
both are enabled.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39183
2023-04-24 12:47:44 +01:00
Andrew Turner
913d04deed Add PCI_ID_OFW_IOMMU to the pci ecam ACPI driver
Teach the pci host generic ACPI attachment about PCI_ID_OFW_IOMMU. This
will be used by the arm64 smmu IOMMU driver to read the xref and ID
this interface provides in a bus-agnostic way.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39182
2023-04-24 12:47:38 +01:00
Andrew Turner
117beba8a8 arm64: Clean up smmu fdt xref handling
Use the xref from OF_xref_from_node for the smmu xref. We already have
a valid xref ID, there is no need to convert this to a memory address.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39181
2023-04-24 12:47:31 +01:00
Andrew Turner
8bc94f256e Remove redundant data from pci host generic
The bus tag and handle fields are already stored in the resource. Use
this with the bus_read/bus_write helper macros.

Sponsored by:	Arm Ltd
2023-04-24 12:33:50 +01:00
Andrew Turner
078a69abcb Use a uint64_t to store the arm64 mpidr
Use a single uint64_t to hole the mpidr register as we can break the
KBI on 14. Keep the macro so code can still be MFCd to 13.

Sponsored by:	Arm Ltd
2023-04-24 12:33:50 +01:00
Andrew Turner
c9a05c0722 Add a PCI driver that follows the Arm DEN0115 spec
Add a n attachment to the pci_host_generic driver for the Arm DEN0115
PCI Configuration Space Access Firmware Interface [1]. This can be used
when PCI controllers need to implement quirks in the PCI root bus.
To handle this the firmware implements a SMCCC interface the driver can
use to read and write the configuration register.

This has been tested on a Raspberry Pi 4 booting with EDK2.

[1] https://developer.arm.com/documentation/den0115/latest

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39228
2023-04-24 12:33:50 +01:00
Andrew Turner
7029f2c887 Allow pci_host_generic attachments to manage registers
To allow for attachments that don't use memory mapped registers add
a flag they can set when the base driver shouldn't map them.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39227
2023-04-24 12:33:50 +01:00
Andrew Turner
fb421e96c0 Make arm64 pcb padding explicit
There is padding between some fields. Mark those I have found so they
can be reused later if needed.

Sponsored by:	Arm Ltd
2023-04-24 12:33:50 +01:00