]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
22 months agomakefs: Fix issues building as a cross-tool on non-FreeBSD
Jessica Clarke [Thu, 18 Aug 2022 01:46:28 +0000 (02:46 +0100)]
makefs: Fix issues building as a cross-tool on non-FreeBSD

This adds missing includes, uses the standard dirent.h rather than the
BSD-specific sys/dirent.h subset (which works on macOS but not Linux)
and works around Linux's lack of st_birthtim.

This allows usr.sbin/makefs to be added to LOCAL_XTOOL_DIRS again on
macOS and Linux so that disk images can be cross-built.

Reviewed by: markj
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Differential Revision: https://reviews.freebsd.org/D36135

22 months agotools/build: Provide fls* when cross-building on Linux
Jessica Clarke [Thu, 18 Aug 2022 01:46:28 +0000 (02:46 +0100)]
tools/build: Provide fls* when cross-building on Linux

flsll is needed for makefs's new ZFS support, and the others are added
for completeness.

Reviewed by: emaste, arichardson
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Differential Revision: https://reviews.freebsd.org/D36134

22 months agotools/build: Provide FreeBSD's bitstring API when cross-building
Jessica Clarke [Thu, 18 Aug 2022 01:46:27 +0000 (02:46 +0100)]
tools/build: Provide FreeBSD's bitstring API when cross-building

This is needed for building makefs as a cross-tool since the ZFS code
uses these APIs.

Reviewed by: emaste
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Differential Revision: https://reviews.freebsd.org/D36133

22 months agosys: Extract __bitcount* from sys/types.h to new sys/bitcount.h
Jessica Clarke [Thu, 18 Aug 2022 01:46:27 +0000 (02:46 +0100)]
sys: Extract __bitcount* from sys/types.h to new sys/bitcount.h

This will allow the code to be reused by the cross-build sys/types.h
wrapper in order to provide the APIs for greater compatibility. This
also provides a path towards eventually removing the definitions from
sys/types.h altogether if so desired by gradually migrating users to
including sys/bitcount.h explicitly, but that is not the primary goal
here.

Note that the copyright header is a direct copu of sys/types.h's given
that's where this code comes from. This could be replaced in future with
a more specific one restricted to just the code in question, depending
on what the copyright for that code is.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D36132

22 months agomakefs: Fix 32-bit issues in ZFS time attributes setting
Jessica Clarke [Thu, 18 Aug 2022 01:46:27 +0000 (02:46 +0100)]
makefs: Fix 32-bit issues in ZFS time attributes setting

Currently the code copies a struct timespec's raw bits as a pair of
uint64_t. On 64-bit systems this has the same representation, but on
32-bit issues there are two issues:

1. tv_sec is a time_t which is 32-bit on i386 specifically
2. tv_nsec is a long not a 64-bit integer

On i386, this means the assertion should fire as the size doesn't match.
On other 32-bit systems there are 4 bytes of padding after tv_nsec,
which in practice are probably 0, as this data is ultimately coming from
the kernel, so it's deterministic (though the padding bytes are not
required to be preserved by the compiler, so are strictly unspecified).
However, on 32-bit big-endian systems, the padding bytes are in the
wrong half to be harmless, resulting in the nanoseconds being multiplied
by 2^32.

Fix this all by marshalling via a real uint64_t pair like is done by the
real ZFS_TIME_ENCODE.

Reviewed by: markj
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Differential Revision: https://reviews.freebsd.org/D36131

22 months agodevelopment(7): Update URLs
Li-Wen Hsu [Thu, 18 Aug 2022 01:24:53 +0000 (09:24 +0800)]
development(7): Update URLs

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

22 months agogit-arc: Use --head to avoid changing the checkout.
John Baldwin [Wed, 17 Aug 2022 23:19:31 +0000 (16:19 -0700)]
git-arc: Use --head to avoid changing the checkout.

Rather than using 'git checkout' to move to the commit in question for
create and update, use the '--head' argument to 'arc diff'.  This
avoids the need to alter the current checkout and the related bits to
save/restore HEAD in the current checkout.

Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D36248

22 months agoip6_input: explicitly include <sys/eventhandler.h>
Gleb Smirnoff [Wed, 17 Aug 2022 21:54:46 +0000 (14:54 -0700)]
ip6_input: explicitly include <sys/eventhandler.h>

On most architectures/kernels it was included implicitly, but powerpc
MPC85XX got broken.

Fixes: 81a34d374ed6e5a7b14f24583bc8e3abfdc66306

22 months agomakefs tests: Add test cases for handling of multiple staging dirs
Mark Johnston [Wed, 17 Aug 2022 21:27:06 +0000 (17:27 -0400)]
makefs tests: Add test cases for handling of multiple staging dirs

Sponsored by: The FreeBSD Foundation

22 months agomakefs tests: Whitespace fixes
Mark Johnston [Wed, 17 Aug 2022 19:17:11 +0000 (15:17 -0400)]
makefs tests: Whitespace fixes

Sponsored by: The FreeBSD Foundation

22 months agomakefs: Handle multiple staging directories when creating ZFS pools
Mark Johnston [Wed, 17 Aug 2022 19:56:57 +0000 (15:56 -0400)]
makefs: Handle multiple staging directories when creating ZFS pools

The fsnode tree traversal routines used in ZFS mode assume that all
children of a (directory) fsnode can be accessed using a directory fd
for the parent and the child name.  This is true when populating the
image using an mtree manifest or from a single staging directory, but
doesn't work when multiple staging directories are specified.

Change the traversal routines to use absolute path lookups when an mtree
manifest is not in use.  This isn't ideal, but it's the simplest way to
fix the problem.

Reported by: imp
Sponsored by: The FreeBSD Foundation

22 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.

The UFS filesystem expects to find '.' and '..' as the first two entries
in a directory. The kernel's UFS name cache can become quite confused
when these two entries are not present as the first two entries.

Prior to this change, when the fsck_ffs(8) utility detected that
'.' and/or '..' were missing, it would report them, but only offered
to replace them if the space at the beginning of the directory was
available. Otherwise it was left to the system administrator to
move the offending file(s) out of the way and then rerun fsck_ffs(8)
to create the '.' and '..' entries.

With this change, fsck_ffs(8) will always be able to create the '.'
and/or '..' entries. It moves any files in the way elsewhere in the
directory block. If there is no room in the directory block to which
to move them, they are placed in the lost+found directory.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation

22 months agoWhen reading backup UFS superblocks, report reason if they cannot be used.
Kirk McKusick [Wed, 17 Aug 2022 20:52:41 +0000 (13:52 -0700)]
When reading backup UFS superblocks, report reason if they cannot be used.

When either searching for backup UFS superblocks or when explicitly asked
to use one with the -b option, report the reason for failure if it cannot
be used.

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation

22 months agovirtio_mmio: Improve V1 spec conformance
Bryan Venteicher [Wed, 17 Aug 2022 20:15:04 +0000 (15:15 -0500)]
virtio_mmio: Improve V1 spec conformance

Implement the virtio_bus_finalize_features method so the FEATURES_OK
status bit is set. Implement the virtio_bus_config_generation method
to ensure larger than 4-byte reads are consistent.

Reviewed by: cperciva
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36150

22 months agoarm64 pmap: Convert PC_IS_FREE into an inline function.
John Baldwin [Wed, 17 Aug 2022 19:10:35 +0000 (12:10 -0700)]
arm64 pmap: Convert PC_IS_FREE into an inline function.

This permits inlining the comparisons even in the 16K page case.
Note that since PC_FREEN is -1, values can be compared efficiently
without having to fetch words of pc_freemask from memory via the
'cmn <reg>, #0x1' instruction.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D36218

22 months agoarm64 pmap: Simplify logic around pv_chunk sizes.
John Baldwin [Wed, 17 Aug 2022 19:10:12 +0000 (12:10 -0700)]
arm64 pmap: Simplify logic around pv_chunk sizes.

- Define PC_FREEL and _NPCM in terms of _NPCPV rather than via magic
  numbers.

- Remove assertions about _NPC* values from pmap.c.  This is less
  relevant now that PC_FREEL and _NPCM are derived from _NPCPV.

- Add a helper inline function pc_is_full() which uses a loop to check
  if pc_map is all zeroes.  Use this to replace three places that
  check for a full mask assuming there are only 3 entries in pc_map.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D36217

22 months agoprotosw: refactor protosw and domain static declaration and load
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:32 +0000 (11:50 -0700)]
protosw: refactor protosw and domain static declaration and load

o Assert that every protosw has pr_attach.  Now this structure is
  only for socket protocols declarations and nothing else.
o Merge struct pr_usrreqs into struct protosw.  This was suggested
  in 1996 by wollman@ (see 7b187005d18ef), and later reiterated
  in 2006 by rwatson@ (see 6fbb9cf860dcd).
o Make struct domain hold a variable sized array of protosw pointers.
  For most protocols these pointers are initialized statically.
  Those domains that may have loadable protocols have spacers. IPv4
  and IPv6 have 8 spacers each (andre@ dff3237ee54ea).
o For inetsw and inet6sw leave a comment noting that many protosw
  entries very likely are dead code.
o Refactor pf_proto_[un]register() into protosw_[un]register().
o Isolate pr_*_notsupp() methods into uipc_domain.c

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D36232

22 months agoprotosw: retire PRU_ flags and their char names
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:32 +0000 (11:50 -0700)]
protosw: retire PRU_ flags and their char names

For many years only TCP debugging used them, but relatively recently
TCP DTrace probes also start to use them.  Move their declarations
into tcp_debug.h, but start including tcp_debug.h unconditionally,
so that compilation with DTrace and without TCPDEBUG is possible.

22 months agounix: use private enum as argument for unp_connect2()
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
unix: use private enum as argument for unp_connect2()

instead of using historic PRU_ flags that are now not used by anything
rather than TCP debugging.

22 months agoip_reass: separate ipreass_init() into global and VIMAGE parts
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
ip_reass: separate ipreass_init() into global and VIMAGE parts

Should have been done in 89128ff3e42.

22 months agotcp: move tcp_drain() verbatim before tcp_init()
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
tcp: move tcp_drain() verbatim before tcp_init()

22 months agoprotosw: retire pr_drain and use EVENTHANDLER(9) directly
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
protosw: retire pr_drain and use EVENTHANDLER(9) directly

The method was called for two different conditions: 1) the VM layer is
low on pages or 2) one of UMA zones of mbuf allocator exhausted.
This change 2) into a new event handler, but all affected network
subsystems modified to subscribe to both, so this change shall not
bring functional changes under different low memory situations.

There were three subsystems still using pr_drain: TCP, SCTP and frag6.
The latter had its protosw entry for the only reason to register its
pr_drain method.

Reviewed by: tuexen, melifaro
Differential revision: https://reviews.freebsd.org/D36164

22 months agoprotosw: retire pr_slowtimo and pr_fasttimo
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
protosw: retire pr_slowtimo and pr_fasttimo

They were useful many years ago, when the callwheel was not efficient,
and the kernel tried to have as little callout entries scheduled as
possible.

Reviewed by: tuexen, melifaro
Differential revision: https://reviews.freebsd.org/D36163

22 months agofrag6: use callout(9) directly instead of pr_slowtimo
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
frag6: use callout(9) directly instead of pr_slowtimo

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D36162

22 months agomld6: use callout(9) directly instead of pr_slowtimo, pr_fasttimo
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
mld6: use callout(9) directly instead of pr_slowtimo, pr_fasttimo

While here remove recursive network epoch entry in mld_fasttimo_vnet(),
as this function is already in epoch.

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D36161

22 months agoigmp: use callout(9) directly instead of pr_slowtimo, pr_fasttimo
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
igmp: use callout(9) directly instead of pr_slowtimo, pr_fasttimo

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D36160

22 months agotcp: use callout(9) directly instead of pr_slowtimo
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
tcp: use callout(9) directly instead of pr_slowtimo

Modern TCP stacks uses multiple callouts per tcpcb, and a global
callout is ancient artifact.  However it is still used to garbage
collect compressed timewait entries.

Reviewed by: melifaro, tuexen
Differential revision: https://reviews.freebsd.org/D36159

22 months agoip_reass: use callout(9) directly instead of pr_slowtimo
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
ip_reass: use callout(9) directly instead of pr_slowtimo

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D36236

22 months agoprotosw: separate pr_input and pr_ctlinput out of protosw
Gleb Smirnoff [Wed, 17 Aug 2022 18:50:31 +0000 (11:50 -0700)]
protosw: separate pr_input and pr_ctlinput out of protosw

The protosw KPI historically has implemented two quite orthogonal
things: protocols that implement a certain kind of socket, and
protocols that are IPv4/IPv6 protocol.  These two things do not
make one-to-one correspondence. The pr_input and pr_ctlinput methods
were utilized only in IP protocols.  This strange duality required
IP protocols that doesn't have a socket to declare protosw, e.g.
carp(4).  On the other hand developers of socket protocols thought
that they need to define pr_input/pr_ctlinput always, which lead to
strange dead code, e.g. div_input() or sdp_ctlinput().

With this change pr_input and pr_ctlinput as part of protosw disappear
and IPv4/IPv6 get their private single level protocol switch table
ip_protox[] and ip6_protox[] respectively, pointing at array of
ipproto_input_t functions.  The pr_ctlinput that was used for
control input coming from the network (ICMP, ICMPv6) is now represented
by ip_ctlprotox[] and ip6_ctlprotox[].

ipproto_register() becomes the only official way to register in the
table.  Those protocols that were always static and unlikely anybody
is interested in making them loadable, are now registered by ip_init(),
ip6_init().  An IP protocol that considers itself unloadable shall
register itself within its own private SYSINIT().

Reviewed by: tuexen, melifaro
Differential revision: https://reviews.freebsd.org/D36157

22 months agostand: Flesh out the zfs image creation
Warner Losh [Wed, 17 Aug 2022 17:33:58 +0000 (11:33 -0600)]
stand: Flesh out the zfs image creation

Move the mbr non-geli zfs cases to no-priv creation with makefs / mkimg.
Add comments about the weird thing we do for MBR + ZFS + Legacy.  Add
comments about other architectures. Still need to think through how to
leverage a completed universe to do all the architectures...

Sponsored by: Netflix

22 months agoIndicate which port gpg.1 comes from.
Jens Schweikhardt [Wed, 17 Aug 2022 17:23:57 +0000 (19:23 +0200)]
Indicate which port gpg.1 comes from.

22 months agoIndicate which port gdb.1 and kgdb.1 come from.
Jens Schweikhardt [Wed, 17 Aug 2022 17:13:22 +0000 (19:13 +0200)]
Indicate which port gdb.1 and kgdb.1 come from.

22 months agobhyve e1000: Skip packets with a small header.
John Baldwin [Wed, 17 Aug 2022 17:01:16 +0000 (10:01 -0700)]
bhyve e1000: Skip packets with a small header.

Certain operations such as checksum insertion and VLAN insertion
require the device model to rewrite the packet header.  The first step
in rewriting the packet header is to copy the existing packet header
from the source packet.  This copy is done by copying data from an
iovec array that corresponds to the S/G entries described by transmit
descriptors.  However, if the total packet length is smaller than the
headers that need to be copied as the initial template, this copy can
overflow the iovec array and use garbage values as the source pointer
to memcpy.  The PR used a single descriptor with a length of 0 in its
PoC.

To fix, track the total packet length and drop requests to transmit
packets whose payload is smaller than the required header length.

While here, fix another issue where the final descriptor could have an
invalid length (too short) that could underflow 'len' when stripping
the checksum.  Skip those requests instead, too.

PR: 264372
Reported by: Robert Morris <rtm@lcs.mit.edu>
Reviewed by: grehan, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36182

22 months agobhyve xhci: Cache the value of MaxPStreams when initializing an endpoint.
John Baldwin [Wed, 17 Aug 2022 17:00:36 +0000 (10:00 -0700)]
bhyve xhci: Cache the value of MaxPStreams when initializing an endpoint.

This avoids type confusion where a malicious guest could rewrite the
MaxPStreams field in an endpoint context after the endpoint was
initialized causing the device model to interpret a guest provided
address (stored in ep_ringaddr of the "software" endpoint state) as a
bhyve host process address (ep_sctx_trbs).  It also prevents a malicious
guest from triggering overflows of ep_sctx_trbs[] by increasing the
number of streams after the endpoint has been initialized.

Rather than re-reading the MaxPStreams value out of the endpoint context
in guest memory on subsequent operations, cache the value in the software
endpoint state.  Possibly the device model should raise errors if the
value of MaxPStreams changes while an endpoint is running.  This approach
simply ignores any such changes by the guest.

PR: 264294, 264347
Reported by: Robert Morris <rtm@lcs.mit.edu>
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36181

22 months agobhyve: Style fix for read/write_config.
John Baldwin [Wed, 17 Aug 2022 17:00:09 +0000 (10:00 -0700)]
bhyve: Style fix for read/write_config.

22 months agoRevert "vm: use atomic fetchadd in vm_page_sunbusy"
Mateusz Guzik [Wed, 17 Aug 2022 16:24:14 +0000 (16:24 +0000)]
Revert "vm: use atomic fetchadd in vm_page_sunbusy"

This reverts commit f6ffed44a8eb5d1ab89a18e60fb056aab2105be7.

fetchadd will fail the waiters flag, which can cause other
code to wait when it should not with nothing clear it

Revert until I sort this out.

Reported by: markj

22 months agoiwlwifi: add FreeBSD specific debugging
Bjoern A. Zeeb [Wed, 17 Aug 2022 16:11:47 +0000 (16:11 +0000)]
iwlwifi: add FreeBSD specific debugging

"Invalid TXQ id" and "Queue <n> is stuck <x> <y>" are two errors seen
more commonly by FreeBSD users.  Try to gather some extra data the
"easy way" adding more error logging for these situations in the hope
to find a clue or at least do more targetd debugging in the future.
Note that for one of the errors the Linux Intel driver has a TODO to
print register data.  If that will show up in future versions of the
driver this may also help.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

22 months agoipsec: isolate knowledge about protocols that are last header
Gleb Smirnoff [Wed, 17 Aug 2022 15:24:11 +0000 (08:24 -0700)]
ipsec: isolate knowledge about protocols that are last header

Retire PR_LASTHDR protosw flag.

Reviewed by: ae
Differential revision: https://reviews.freebsd.org/D36155

22 months agoipfw: make it possible to specify MTU for "unreach needfrag" action
Gleb Smirnoff [Wed, 17 Aug 2022 15:24:11 +0000 (08:24 -0700)]
ipfw: make it possible to specify MTU for "unreach needfrag" action

Reviewed by: ae, pauamma
Differential revision: https://reviews.freebsd.org/D36140

22 months agoixgbe: fix software vlan handling
Kristof Provost [Thu, 11 Aug 2022 12:45:01 +0000 (14:45 +0200)]
ixgbe: fix software vlan handling

If hardware vlan tagging is disabled (after a vlan has been added) we
receive double-tagged packets, even if the packet on the wire only has a

single VLAN tag.  That looks like this:

17:29:30.370787 00:51:82:11:22:02 > 90:ec:77:1f:8a:5f, ethertype 802.1Q (0x8100), length 64: vlan 0, p 0, ethertype 802.1Q, vlan 1001, p 0, ethertype ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.101.0.12 is-at 00:51:82:11:22:02, length 42

This happens because the ixgbe driver does not clear the vlan flags in
the hardware (such as IXGBE_RXDCTL_VME) if IFCAP_VLAN_HWTAGGING is
cleared.

Add code to do so, which fixes this issue.

Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36139

22 months agopipe: try to skip locking the pipe if a non-blocking fd is used
Mateusz Guzik [Mon, 8 Aug 2022 18:02:15 +0000 (18:02 +0000)]
pipe: try to skip locking the pipe if a non-blocking fd is used

Reviewed by: markj (previous version)
Differential Revision: https://reviews.freebsd.org/D36082

22 months agomac: cheaper check for mac_pipe_check_read
Mateusz Guzik [Mon, 8 Aug 2022 19:14:09 +0000 (19:14 +0000)]
mac: cheaper check for mac_pipe_check_read

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D36082

22 months agopipe: change pipemapping cnt/pos to u_int
Mateusz Guzik [Wed, 17 Aug 2022 14:20:09 +0000 (14:20 +0000)]
pipe: change pipemapping cnt/pos to u_int

This matches the case using regular buffers and avoids an ifdef later.

Suggested by: markj

22 months agovm: use atomic fetchadd in vm_page_sunbusy
Mateusz Guzik [Fri, 5 Aug 2022 14:27:55 +0000 (14:27 +0000)]
vm: use atomic fetchadd in vm_page_sunbusy

This also fixes a bug where not-last unbusy failed to post a release
fence.

Reviewed by: markj (previous version), kib (previous version)
Differential Revision: https://reviews.freebsd.org/D36084

22 months agoObsoleteFiles.inc: fix path of a few manual pages
Antoine Brodin [Wed, 17 Aug 2022 08:01:54 +0000 (08:01 +0000)]
ObsoleteFiles.inc: fix path of a few manual pages

22 months agobhyve nvme: Switch to POSIX standard functions
Chuck Tuffli [Wed, 17 Aug 2022 00:16:06 +0000 (17:16 -0700)]
bhyve nvme: Switch to POSIX standard functions

Switch bzero to memset and bcopy to memcpy

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

22 months agobasic_signal test: really skip trap_signal_test on i386
Li-Wen Hsu [Wed, 17 Aug 2022 00:15:10 +0000 (08:15 +0800)]
basic_signal test: really skip trap_signal_test on i386

PR: 265889
Fixes: c04721e35ff0e8220c88d5b10f068dba18629f7e
Sponsored by: The FreeBSD Foundation

22 months agoUpdate date in tunefs(8) manual page.
Kirk McKusick [Tue, 16 Aug 2022 23:46:12 +0000 (16:46 -0700)]
Update date in tunefs(8) manual page.

Requested by: Li-Wen Hsu
PR:           261944
Sponsored by: The FreeBSD Foundation

22 months agobasic_signal test: temporarily skip trap_signal_test on i386
Li-Wen Hsu [Tue, 16 Aug 2022 22:03:37 +0000 (06:03 +0800)]
basic_signal test: temporarily skip trap_signal_test on i386

This case crashes a bhyve VM.

PR: 265889
Sponsored by: The FreeBSD Foundation

22 months agostand: Make makeroot.sh use makefs for ZFS
Warner Losh [Tue, 16 Aug 2022 17:29:25 +0000 (11:29 -0600)]
stand: Make makeroot.sh use makefs for ZFS

Start to use makefs for ZFS. This covers the gpt nogeli variants.  ZFS
MBR booting is tricky and complicated, so will need some additional
tweaks that makefs/mkimg isn't able to do at the moment. This means that
all gpt nogeli amd64 combinations can be built w/o root.

In addition, tweak the generated qemu.sh files to use stdio for the
console. We grep the output for SUCCESS and report each of the booting
types. Create a all.sh that will run these automatically. These all can
also run w/o root.

In the future, I'll add support for a make univers followed by this
script to create other architectures' tests and/or generate stand tests
for /usr/tests...

Sponsored by: Netflix

22 months agobsdinstall: add variables to allow skipping over some phases of the install
Brad Davis [Tue, 16 Aug 2022 21:11:44 +0000 (15:11 -0600)]
bsdinstall: add variables to allow skipping over some phases of the install

Reviewed by: allanjude, dteske
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35357

22 months agoDisallow invalid PT_GNU_STACK
Ed Maste [Fri, 18 Mar 2022 17:56:32 +0000 (13:56 -0400)]
Disallow invalid PT_GNU_STACK

Stack must be at least readable and writable.

PR: 242570
Reviewed by: kib, markj
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35867

22 months agoudp: call UDP methods from UDP over IPv6 directly
Gleb Smirnoff [Tue, 16 Aug 2022 19:40:36 +0000 (12:40 -0700)]
udp: call UDP methods from UDP over IPv6 directly

Both UDP and UDP Lite use same methods on sockets.  Both UDP over IPv4
and over IPv6 use same methods.  Don't pretend that methods can switch
and remove this unneeded complexity.

Reviewed by: melifaro
Differential revision: https://reviews.freebsd.org/D36154

22 months agobuf.h: Fix declaration of unmapped_buf
Sebastian Huber [Tue, 19 Jul 2022 18:09:43 +0000 (20:09 +0200)]
buf.h: Fix declaration of unmapped_buf

For architectures with a small-data area, the __read_mostly section must
present at the object declaration.

(emaste note: This does not appear to have an affect within FreeBSD, but
may be needed by downstream projects that handle __read_mostly /
__section(".data.read_mostly") differently.)

Pull Request: https://github.com/freebsd/freebsd-src/pull/608

22 months agosdp: garbage collect sdp_ctlinput
Gleb Smirnoff [Tue, 16 Aug 2022 19:38:15 +0000 (12:38 -0700)]
sdp: garbage collect sdp_ctlinput

The pr_ctlinput method was a feature of IPv4/IPv6 with exception of
pfctlinput(), which broadcasted a call to pr_ctlinput on all protocols
ever registered statically or with pf_proto_register().  Now that
this broadcast call is gone, the only protocols that get their
pr_ctlinput ever called are those that have registered itselves with
ipproto_register() or ip6proto_register().

It is entirely possible that code deleted now was dead code from very
beginning. Just a copy-paste from TCP.

Reviewed by: rstone
Differential revision: https://reviews.freebsd.org/D36208

22 months agopkgbase: Put accounting utilities in the acct package
Emmanuel Vadot [Thu, 21 Jul 2022 15:09:34 +0000 (17:09 +0200)]
pkgbase: Put accounting utilities in the acct package

22 months agolib: Gate libfigpar under MK_DIALOG
Emmanuel Vadot [Thu, 21 Jul 2022 14:52:24 +0000 (16:52 +0200)]
lib: Gate libfigpar under MK_DIALOG

libfigpar is only used by dpv and dpv isn't built if WITHOUT_DIALOG
is set.

22 months agopkgbase: Put mount_nfs in the FreeBSD-nfs package
Emmanuel Vadot [Fri, 22 Jul 2022 11:23:14 +0000 (13:23 +0200)]
pkgbase: Put mount_nfs in the FreeBSD-nfs package

22 months agopkgbase: mtree: Correctly tag /var/db entries
Emmanuel Vadot [Fri, 22 Jul 2022 09:21:44 +0000 (11:21 +0200)]
pkgbase: mtree: Correctly tag /var/db entries

22 months agopkgbase: mtree: Correctly tag /var/run entries
Emmanuel Vadot [Fri, 22 Jul 2022 09:14:40 +0000 (11:14 +0200)]
pkgbase: mtree: Correctly tag /var/run entries

22 months agoOops, wlan(4) is not the removed an(4). Restore that paragraph.
Jens Schweikhardt [Tue, 16 Aug 2022 19:08:17 +0000 (21:08 +0200)]
Oops, wlan(4) is not the removed an(4). Restore that paragraph.

22 months agoThe wi(4) and an(4) drivers have been removed. Delete dead xrefs.
Jens Schweikhardt [Tue, 16 Aug 2022 19:05:01 +0000 (21:05 +0200)]
The wi(4) and an(4) drivers have been removed. Delete dead xrefs.

22 months agoIndicate the port where the referenced man pages come from.
Jens Schweikhardt [Tue, 16 Aug 2022 18:57:30 +0000 (20:57 +0200)]
Indicate the port where the referenced man pages come from.

22 months agobhyve: Sprinkle const qualifiers where appropriate
Mark Johnston [Tue, 16 Aug 2022 17:13:12 +0000 (13:13 -0400)]
bhyve: Sprinkle const qualifiers where appropriate

No functional change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

22 months agobhyve: Mark variables and functions as static where appropriate
Mark Johnston [Tue, 16 Aug 2022 17:12:32 +0000 (13:12 -0400)]
bhyve: Mark variables and functions as static where appropriate

Mark them const as well when it makes sense to do so.  No functional
change intended.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

22 months agobhyve: Use "void" instead of empty parameter lists
Mark Johnston [Tue, 16 Aug 2022 17:10:58 +0000 (13:10 -0400)]
bhyve: Use "void" instead of empty parameter lists

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

22 months agomakefs: Style
Mark Johnston [Tue, 16 Aug 2022 17:07:46 +0000 (13:07 -0400)]
makefs: Style

Reported by: rpokala
Fixes: 187084dddd3e ("makefs: Align the block buffer used in ZFS mode")
Sponsored by: The FreeBSD Foundation

22 months agoImport bionic's x86_64 optimized string routines
Ed Maste [Tue, 16 Aug 2022 17:26:59 +0000 (13:26 -0400)]
Import bionic's x86_64 optimized string routines

Add 'contrib/bionic-x86_64-string/' from commit 'd77520609f5240f5fad18fa1fd2275ac1de7cbb5'

git-subtree-dir: contrib/bionic-x86_64-string
git-subtree-mainline: 715f82e4f5c51c04314904dee8090c8abbbe2156
git-subtree-split: d77520609f5240f5fad18fa1fd2275ac1de7cbb5

Requested by: mjg
Sponsored by: The FreeBSD Foundation

22 months agoImport bionic's x86_64 string routines to vendor
Ed Maste [Mon, 15 Aug 2022 21:24:08 +0000 (17:24 -0400)]
Import bionic's x86_64 string routines to vendor

Obtained from https://android.googlesource.com/platform/bionic
libc/arch-x86_64/string/ at commit
919fb7f2e0e0c877dd5e9bbaa71d4c4a73e50ad3

Requested by: mjg
Sponsored by: The FreeBSD Foundation

22 months agobhyve nvme: Support minimal Controller list
Chuck Tuffli [Tue, 16 Aug 2022 16:15:53 +0000 (09:15 -0700)]
bhyve nvme: Support minimal Controller list

Controllers must support the Identify Controller list if they support
Namespace Management. But the UNH NVMe tests use this command regardless
of whether the device under test supports Namespace Management.

This implementation returns an empty Controller list (i.e., Number of
Identifiers is zero).

Fixes UNH Test 1.1.2

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

22 months agobhyve nvme: Fix reported SANICAP value
Chuck Tuffli [Tue, 16 Aug 2022 16:14:43 +0000 (09:14 -0700)]
bhyve nvme: Fix reported SANICAP value

The NVMe specification only allows Controllers compliant with the
revision 1.3 and earlier specification to report a value of 0x0 in the
No-Deallocate Modifies Media After Sanitize (NODMMAS) field.

For our revision 1.4 Controller, report that media is not modified after
Sanitize as the implementation does not implement Sanitize.

Fixes UNH Test 1.1.2

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

22 months agomakefs tests: Re-enable the ZFS snapshot test
Mark Johnston [Tue, 16 Aug 2022 14:35:51 +0000 (10:35 -0400)]
makefs tests: Re-enable the ZFS snapshot test

This reverts commit 35b587464afce15ff62600c3499d38cbb5b9f3d5.

PR: 265849
Sponsored by: The FreeBSD Foundation

22 months agomakefs: Fix space accounting for the root DSL directory
Mark Johnston [Tue, 16 Aug 2022 14:15:53 +0000 (10:15 -0400)]
makefs: Fix space accounting for the root DSL directory

Space used by the MOS is summed after all on-disk data structures are
finalized, so the MOS DSL directory represents a special case when
counting bytes used for each directory.  The DSL layer failed to update
the MOS DSL directory's parent, the root directory, accordingly, so the
root directory reported less space used than was used in reality.  Be
careful to update the root directory after the MOS is finalized.

PR: 265849
Sponsored by: The FreeBSD Foundation

22 months agomakefs: Align the block buffer used in ZFS mode
Mark Johnston [Tue, 16 Aug 2022 14:02:09 +0000 (10:02 -0400)]
makefs: Align the block buffer used in ZFS mode

For some dnode types, particularly ZAPs, we want the buffer to have
uint64_t alignment.

Sponsored by: The FreeBSD Foundation

22 months agoDisable promotion on pcpu memory on arm64
Andrew Turner [Fri, 29 Apr 2022 09:30:38 +0000 (10:30 +0100)]
Disable promotion on pcpu memory on arm64

We need to be careful to not promote or demote the memory containing
the per-CPU structures as the exception handlers will dereference it
so any time it's invalid may cause recursive exceptions.

Add a new pmap function to set a flag in the pte marking memory that
cannot be promoted or demoted and use it to mark pcpu memory.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35434

22 months agoexports.5: Clean up EXAMPLES and STANDARDS
Mateusz Piotrowski [Tue, 16 Aug 2022 13:03:20 +0000 (15:03 +0200)]
exports.5: Clean up EXAMPLES and STANDARDS

There was a missing sentence in the description of the second mount
entry in the example. Fix that and some other bits in the EXAMPLES
section.

Also, make the STANDARDS section a bit more readable.

MFC after: 1 week
Sponsored by: Klara Inc.

22 months agoAdd support for RockChip RK356X to DWC3 driver.
Søren Schmidt [Tue, 16 Aug 2022 12:24:44 +0000 (12:24 +0000)]
Add support for RockChip RK356X to DWC3 driver.
For RK356x platform, we can set bit 26 of DWC3_GUCTL1 register
for usb 2.0 device.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D36211

22 months agovfs: plug a dead store in kern_linkat_vp
Mateusz Guzik [Tue, 16 Aug 2022 10:45:48 +0000 (10:45 +0000)]
vfs: plug a dead store in kern_linkat_vp

Reported by: clang --analyze

22 months agovfs: plug dead store in vn_io_fault1
Mateusz Guzik [Tue, 16 Aug 2022 10:44:31 +0000 (10:44 +0000)]
vfs: plug dead store in vn_io_fault1

Reported by: clang --analyze

22 months agoTPM: do not set device description if probe fails
Konrad Sewiłło-Jopek [Tue, 16 Aug 2022 07:27:36 +0000 (09:27 +0200)]
TPM: do not set device description if probe fails

device_set_desc should be called only if driver probes successfully.

Approved by: mw(mentor)
Reviewed by: mw, kd
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35998

22 months agocxgbe(4): Add a knob to request that clocks be gated on suspend.
Navdeep Parhar [Tue, 16 Aug 2022 07:48:21 +0000 (00:48 -0700)]
cxgbe(4): Add a knob to request that clocks be gated on suspend.

MFC after: 3 months
Sponsored by: Chelsio Communications

22 months agocxgbe(4): Decode and display some more bits in the PL interrupt handler.
Navdeep Parhar [Sat, 13 Aug 2022 04:11:13 +0000 (21:11 -0700)]
cxgbe(4): Decode and display some more bits in the PL interrupt handler.

MFC after: 1 week
Sponsored by: Chelsio Communications

22 months agocxgbe(4): Update firmwares to 1.27.0.0.
Navdeep Parhar [Sun, 14 Aug 2022 23:57:39 +0000 (16:57 -0700)]
cxgbe(4): Update firmwares to 1.27.0.0.

Changes since 1.26.6.0 are listed here.  This list comes from the
Release Notes for "Chelsio Unified Wire 3.17.0.0 for Linux" dated
2022-07-29.

Fixes
-----

BASE:
- Enabled all MA parity interrupt bits.
- Use config file value to override number of rx channel. nrxch=1 was not
  handled in the firmware.
- Replaced read only registers with new registers EDC_H_BIST_USER_WDATA0,
  EDC_H_BIST_USER_WDATA1 and EDC_H_BIST_CMD_LEN to dump the uP memory parity
  error status registers.
- 10G simplex module support enabled.

Obtained from: Chelsio Communications
MFC after: 1 month
Sponsored by: Chelsio Communications

22 months agoAdd RockChip rk809/rk817 pmic support to existing
Søren Schmidt [Tue, 16 Aug 2022 07:55:18 +0000 (07:55 +0000)]
Add RockChip rk809/rk817 pmic support to existing
RockChip pmic drivers.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D36149

22 months agolibc/locale tests: temporarily skip lib.libc.locale.c16rtomb_test.c16rtomb_utf_8_test
Li-Wen Hsu [Tue, 16 Aug 2022 05:18:15 +0000 (13:18 +0800)]
libc/locale tests: temporarily skip lib.libc.locale.c16rtomb_test.c16rtomb_utf_8_test

This test case starts failing after iconv changes on 2022-08-11.

PR: 265871
Sponsored by: The FreeBSD Foundation

22 months agocontrib/tzdata: import tzdata 2022c
Philip Paeps [Tue, 16 Aug 2022 02:54:37 +0000 (10:54 +0800)]
contrib/tzdata: import tzdata 2022c

Changes: https://github.com/eggert/tz/blob/2022c/NEWS

MFC after: 1 day

22 months agoObsoleteFiles: don't delete zoneinfo/GMT
Herbert J. Skuhra [Tue, 16 Aug 2022 02:53:08 +0000 (10:53 +0800)]
ObsoleteFiles: don't delete zoneinfo/GMT

The tzdata2022b import restored the zoneinfo/GMT link.
Don't delete it again with 'make delete-old'.

MFC after: 1 day

22 months agoImport tzdata 2022c
Philip Paeps [Tue, 16 Aug 2022 02:34:28 +0000 (10:34 +0800)]
Import tzdata 2022c

22 months agoAdd a description of soft updates journaling to tunefs(8).
Kirk McKusick [Mon, 15 Aug 2022 20:44:49 +0000 (13:44 -0700)]
Add a description of soft updates journaling to tunefs(8).

Add a descrition to the tunefs(8) -j (journal enablement) flag
that explains what soft updates journaling does, the tradeoffs
to using it, and the limitations that it imposes.

Requested by: Graham Perrin
PR:           261944
Sponsored by: The FreeBSD Foundation

22 months agorouting: G/C rt_exportinfo declaration
Mateusz Guzik [Mon, 15 Aug 2022 20:38:31 +0000 (20:38 +0000)]
routing: G/C rt_exportinfo declaration

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

22 months agoIndicate that xrefs to *roff,tbl,eqn et al are found in ports/textproc/groff.
Jens Schweikhardt [Mon, 15 Aug 2022 20:14:15 +0000 (22:14 +0200)]
Indicate that xrefs to *roff,tbl,eqn et al are found in ports/textproc/groff.

22 months agoAdjust function definition in riscv's db_trace.c to avoid clang 15 warning
Dimitry Andric [Mon, 15 Aug 2022 18:48:17 +0000 (20:48 +0200)]
Adjust function definition in riscv's db_trace.c to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/riscv/riscv/db_trace.c:56:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    db_md_list_watchpoints()
                          ^
                           void

This is because db_md_list_watchpoints() is declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after: 3 days

22 months agoAdjust function definitions in mp_cpudep.c.c to avoid clang 15 warnings
Dimitry Andric [Mon, 15 Aug 2022 18:46:44 +0000 (20:46 +0200)]
Adjust function definitions in mp_cpudep.c.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/powerpc/booke/mp_cpudep.c:54:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cpudep_ap_bootstrap()
                       ^
                        void
    sys/powerpc/booke/mp_cpudep.c:97:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cpudep_ap_setup()
                   ^
                    void

This is because cpudep_ap_bootstrap() and cpudep_ap_setup() are declared
with (void) argument lists, but defined with empty argument lists. Make
the definitions match the declarations.

MFC after: 3 days

22 months agoAdjust function definition in moea64_native.c to avoid clang 15 warning
Dimitry Andric [Mon, 15 Aug 2022 18:44:30 +0000 (20:44 +0200)]
Adjust function definition in moea64_native.c to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/powerpc/aim/moea64_native.c:306:22: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    moea64_install_native()
                         ^
                          void

This is because moea64_install_native() is declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after: 3 days

22 months agoFix unused variable warning in mmu_radix.c
Dimitry Andric [Mon, 15 Aug 2022 18:42:51 +0000 (20:42 +0200)]
Fix unused variable warning in mmu_radix.c

With clang 15, the following -Werror warning is produced:

    sys/powerpc/aim/mmu_radix.c:5409:22: error: variable 'freed' set but not used [-Werror,-Wunused-but-set-variable]
            int allfree, field, freed, idx;
                                ^

The 'freed' variable is only used when PV_STATS is defined. Ensure it is
only declared and set in that case.

MFC after: 3 days

22 months agoAdjust function definitions in mmu_radix.c to avoid clang 15 warnings
Dimitry Andric [Mon, 15 Aug 2022 18:37:14 +0000 (20:37 +0200)]
Adjust function definitions in mmu_radix.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/powerpc/aim/mmu_radix.c:786:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    mmu_radix_tlbie_all()
                       ^
                        void
    sys/powerpc/aim/mmu_radix.c:3615:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    mmu_radix_init()
                  ^
                   void
    sys/powerpc/aim/mmu_radix.c:6081:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    mmu_radix_scan_init()
                       ^
                        void

This is because mmu_radix_tlbie_all(), mmu_radix_init(), and
mmu_radix_scan_init() are declared with (void) argument lists, but
defined with empty argument lists. Make the definitions match the
declarations.

MFC after: 3 days

22 months agoAdjust function definitions in mmu_oea64.c to avoid clang 15 warnings
Dimitry Andric [Mon, 15 Aug 2022 18:33:25 +0000 (20:33 +0200)]
Adjust function definitions in mmu_oea64.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/powerpc/aim/mmu_oea64.c:1947:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    moea64_init()
               ^
                void
    sys/powerpc/aim/mmu_oea64.c:3257:17: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    moea64_scan_init()
                    ^
                     void

This is because moea64_init() and moea64_scan_init() are declared with
(void) argument lists, but defined with empty argument lists. Make the
definitions match the declarations.

MFC after: 3 days

22 months agoAdjust function definition in aim_machdep.c to avoid clang 15 warning
Dimitry Andric [Mon, 15 Aug 2022 18:27:56 +0000 (20:27 +0200)]
Adjust function definition in aim_machdep.c to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/powerpc/aim/aim_machdep.c:750:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    mpc745x_sleep()
                 ^
                  void

This is because mpc745x_sleep() is declared with a (void) argument list,
but defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

22 months agoFix unused variable warnings in tcp_hpts.c
Dimitry Andric [Mon, 15 Aug 2022 18:14:39 +0000 (20:14 +0200)]
Fix unused variable warnings in tcp_hpts.c

With clang 15, the following -Werror warning is produced:

    sys/netinet/tcp_hpts.c:1114:10: error: variable 'paced_cnt' set but not used [-Werror,-Wunused-but-set-variable]
            int32_t paced_cnt = 0;
                    ^
    sys/netinet/tcp_hpts.c:1112:11: error: variable 'total_slots_processed' set but not used [-Werror,-Wunused-but-set-variable]
            uint64_t total_slots_processed = 0;
                     ^

The 'paced_cnt' variable was in tcp_hpts.c when it was first added, and
the 'total_slots_processed' variable was added in d7955cc0ffdf9, but
both appear to have been debugging aids that have never been used, so
remove them.

MFC after: 3 days

22 months agoAdjust function definition in tcp_hpts.c to avoid clang 15 warning
Dimitry Andric [Mon, 15 Aug 2022 18:05:34 +0000 (20:05 +0200)]
Adjust function definition in tcp_hpts.c to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/netinet/tcp_hpts.c:1594:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    tcp_choose_hpts_to_run()
                          ^
                           void

This is because tcp_choose_hpts_to_run() is declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after: 3 days