]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agokeysock: do not use raw socket code
Gleb Smirnoff [Thu, 11 Aug 2022 16:19:36 +0000 (09:19 -0700)]
keysock: do not use raw socket code

This makes key socket implementation self contained and removes one
of the last dependencies on the raw socket code and pr_output method.

There are very subtle API visible changes:
- now key socket would return EOPNOTSUPP instead of EINVAL on
  syscalls that are not supposed to be called on a key socket.
- key socket buffer sizes are now controlled by net.key sysctls instead
  of net.raw.  The latter were not documented anywhere, and even Internet
  search doesn't find any references or discussions related to them.

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

2 years agortsock: do not use raw socket code
Gleb Smirnoff [Thu, 11 Aug 2022 16:19:36 +0000 (09:19 -0700)]
rtsock: do not use raw socket code

This makes routing socket implementation self contained and removes one
of the last dependencies on the raw socket code and pr_output method.

There are very subtle API visible changes:
- now routing socket would return EOPNOTSUPP instead of EINVAL on
  syscalls that are not supposed to be called on a routing socket.
- routing socket buffer sizes are now controlled by net.rtsock
  sysctls instead of net.raw.  The latter were not documented
  anywhere, and even Internet search doesn't find any references
  or discussions related to these sysctls.

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

2 years agortsock: do not allocate mbufs_tags(9) just to store a 8-bit value
Gleb Smirnoff [Thu, 11 Aug 2022 16:19:36 +0000 (09:19 -0700)]
rtsock: do not allocate mbufs_tags(9) just to store a 8-bit value

Use local storage of the mbuf packet header instead.

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

2 years agonetinet: get interface event notifications directly via EVENTHANDLER(9)
Gleb Smirnoff [Thu, 11 Aug 2022 16:19:36 +0000 (09:19 -0700)]
netinet: get interface event notifications directly via EVENTHANDLER(9)

The old mechanism of getting them via domains/protocols control input
is a relict from the previous century, when nothing like EVENTHANDLER(9)
existed yet.  Retire PRC_IFDOWN/PRC_IFUP as netinet was the only one
to use them.

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

2 years agomakefs: Fix a memory leak in fs_layout_one()
Mark Johnston [Thu, 11 Aug 2022 14:18:13 +0000 (10:18 -0400)]
makefs: Fix a memory leak in fs_layout_one()

Check the canmount property before building the mountpoint string.

Reported by: Coverity
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Sponsored by: The FreeBSD Foundation

2 years agomakefs: Fix memory leaks in dsl_dir_finalize_props()
Mark Johnston [Thu, 11 Aug 2022 14:18:06 +0000 (10:18 -0400)]
makefs: Fix memory leaks in dsl_dir_finalize_props()

nvstring_get() returns a copy of the string, not a pointer into the
nvlist's internal buffer.

Reported by: Coverity
Fixes: 240afd8c1fcc ("makefs: Add ZFS support")
Sponsored by: The FreeBSD Foundation

2 years agorouting: fix non-debug build
Mateusz Guzik [Thu, 11 Aug 2022 14:12:59 +0000 (14:12 +0000)]
routing: fix non-debug build

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

2 years agoAdjust function definition in subr_devmap.c to avoid clang 15 warning
Andrew Turner [Thu, 11 Aug 2022 12:04:58 +0000 (13:04 +0100)]
Adjust function definition in subr_devmap.c to avoid clang 15 warning

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

    sys/kern/subr_devmap.c:87:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    devmap_print_table()
                      ^
                       void

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

Sponsored by: The FreeBSD Foundation

2 years agoAdjust function definition in ofw to avoid clang 15 warning
Andrew Turner [Thu, 11 Aug 2022 12:02:50 +0000 (13:02 +0100)]
Adjust function definition in ofw to avoid clang 15 warning

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

    sys/dev/ofw/openfirm.c:826:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    OF_enter()
            ^
             void

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

Sponsored by: The FreeBSD Foundation

2 years agoAdjust function definition in hwpmc to avoid clang 15 warning
Andrew Turner [Thu, 11 Aug 2022 12:02:33 +0000 (13:02 +0100)]
Adjust function definition in hwpmc to avoid clang 15 warning

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

    sys/dev/hwpmc/hwpmc_arm64.c:530:21: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pmc_arm64_initialize()
                        ^
                         void

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

Sponsored by: The FreeBSD Foundation

2 years agorouting: populate fibs with interface routes after growing net.fibs.
Alexander V. Chernikov [Sun, 7 Aug 2022 20:26:19 +0000 (20:26 +0000)]
routing: populate fibs with interface routes after growing net.fibs.

Currently it is possible to extend number of fibs in runtime, but this
 functionality is of limited use when net.add_addrs_all_fibs is
 non-zero, as the routing tables are created empty.

This change automatically populate newly-created fibs with the kernel-originated
 interface routes (filtered by RTF_PINNED flag) if net.add_addrs_all_fibs
 is set.

```
-> sysctl net.add_addr_allfibs=1
net.add_addr_allfibs: 0 -> 1
-> sysctl net.fibs
net.fibs: 2
-> sysctl net.fibs=3
net.fibs: 2 -> 3

BEFORE:
-> setfib 2 netstat -rn
Routing tables (fib: 2)

AFTER:
-> setfib 2 netstat -rn
Routing tables (fib: 2)

Internet:
Destination        Gateway            Flags     Netif Expire
10.0.0.0/24        link#1             U        vtnet0
10.0.0.5           link#1             UHS         lo0
127.0.0.1          link#2             UH          lo0

Internet6:
Destination                       Gateway                       Flags     Netif Expire
::1                               link#2                        UHS         lo0
2a01:4f9:3a:fa00::/64             link#1                        U        vtnet0
2a01:4f9:3a:fa00:5054:ff:fe15:4a3b link#1                       UHS         lo0
fe80::%vtnet0/64                  link#1                        U        vtnet0
fe80::5054:ff:fe15:4a3b%vtnet0    link#1                        UHS         lo0
fe80::%lo0/64                     link#2                        U           lo0
fe80::1%lo0                       link#2                        UHS         lo0
```

Differential Revision: https://reviews.freebsd.org/D36075
MFC after: 1 month

2 years agorouting: fixup empty mask prefix handling after 2ce553854cbd.
Alexander V. Chernikov [Thu, 11 Aug 2022 11:41:42 +0000 (11:41 +0000)]
routing: fixup empty mask prefix handling after 2ce553854cbd.

MFC after: 1 month

2 years agorouting: fix build warning without ROUTE_MPATH
Alexander V. Chernikov [Thu, 11 Aug 2022 09:46:28 +0000 (09:46 +0000)]
routing: fix build warning without ROUTE_MPATH

Reported by: Gary Jennejohn <garyj@gmx.de>
MFC after: 1 month

2 years agoif_ovpn tests: Test using a TCP socket for DCO
Kristof Provost [Thu, 11 Aug 2022 08:34:01 +0000 (10:34 +0200)]
if_ovpn tests: Test using a TCP socket for DCO

This used to trigger panics, so try to reproduce it.
Create an if_ovpn interface, set a new peer on it with a TCP fd (as
opposed to the expected UDP) and ensure that this is rejected.

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

2 years agoif_ovpn: reject non-UDP sockets
Kristof Provost [Thu, 11 Aug 2022 08:30:39 +0000 (10:30 +0200)]
if_ovpn: reject non-UDP sockets

We must ensure that the fd provided by userspace is really for a UDP
socket. If it's not we'll panic in udp_set_kernel_tunneling().

Reported by: Gert Doering <gert@greenie.muc.de>
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoAdd RockChip RK356X support to existing RockChip thermal driver.
Søren Schmidt [Thu, 11 Aug 2022 08:26:39 +0000 (08:26 +0000)]
Add RockChip RK356X support to existing RockChip thermal driver.

2 years agostress2: Added a regression test
Peter Holm [Thu, 11 Aug 2022 07:42:02 +0000 (09:42 +0200)]
stress2: Added a regression test

2 years agoAdd support for RK3568 to RockChip GRF and SPI drivers.
Ganbold Tsagaankhuu [Thu, 11 Aug 2022 05:32:48 +0000 (05:32 +0000)]
Add support for RK3568 to RockChip GRF and SPI drivers.
Partially from https://reviews.freebsd.org/D36027

Submitted by: sos

2 years agostand: impose 510,000 byte limit for /boot/loader and /boot/pxeldr
Warner Losh [Thu, 11 Aug 2022 03:19:01 +0000 (21:19 -0600)]
stand: impose 510,000 byte limit for /boot/loader and /boot/pxeldr

The BIOS method of booting imposes an absolute limit of 640k for the
size of the program being run due to btx. In practice, this means that
programs larger than about 500kiB will fail in odd ways as the stack /
heap will overflow.

Pick 510,000 as the cutoff line semi-arbitrarily. loader_lua is now
almost too big and we want to break the build when it crosses this
threshold. In my experience, below 500,000 always works, above 520,000
always seems to fail with things getting bad somewhere between 512,000
to 515,000. 510,000 is as close to the line as I think we can go, though
experience may dictate we need to lower this in the future.

This is at-best a stop-breakage until we have a better way to subset the
boot loader for BIOS booting to allow better, more fined-tuned
/boot/loaders for the many different environments they have to run
in. This likely means we'll have a graphical loader than understands a
few filesystmes for installation, and a non-graphical loader that
understands the most filesystems possible for everything else in the
future. Our build infrastructure needs some work before we can do that,
however.

At this late date, it likely isn't worth the efforts to move parts of
the loader into high memory. There's a number of assumptions about where
the stack is, where buffers reside, etc that are fulfilled when it lives
in the first 640k that would need bounce buffers and/or other counter
measures if we were to split it up. All BIOS calls are done in 16-bit
mode with SEG:OFF addresses, requiring them to be in the first 640k of
RAM. And nearly all machines in the last decade can boot with UEFI
(though there's some exceptions, so it isn't worth killing outright
yet).

Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D36129

2 years agostand: i386/amd64: Always use elf format for /boot/loader and pxeldr
Warner Losh [Thu, 11 Aug 2022 03:18:32 +0000 (21:18 -0600)]
stand: i386/amd64: Always use elf format for /boot/loader and pxeldr

The first level boot blocks have understood how to load ELF code since
1999. Switch /boot/loader and /boot/pxeldr over to being ELF format so
that in-tree tools can examine them more closely. In addition, one
could, in theory, now have a 'lo-mem' and a 'hi-mem' segment (though a
lot of work would need to be done with bounce buffers, btx, code segment
marking, etc for an arrangement like that to work).

As far as I can tell, this is the last a.out binary in the tree. There
are several raw binaries left, but everything else is ELF.

Reviewed by: emaste, kevans
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D36130

2 years agocontrib/tzdata: import tzdata 2022b
Philip Paeps [Thu, 11 Aug 2022 02:48:24 +0000 (10:48 +0800)]
contrib/tzdata: import tzdata 2022b

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

MFC after: 3 days

2 years agoImport tzdata 2022b
Philip Paeps [Thu, 11 Aug 2022 02:23:48 +0000 (10:23 +0800)]
Import tzdata 2022b

2 years agoacpi: mark INVARIANTS variables as __diagused
Ed Maste [Wed, 10 Aug 2022 00:39:28 +0000 (20:39 -0400)]
acpi: mark INVARIANTS variables as __diagused

Fixes INVARIANTS build with Clang 15, which previously failed due to
set-but-not-used variable warnings.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36096

2 years agorouting: fix build without ROUTE_MPATH
Alexander V. Chernikov [Wed, 10 Aug 2022 20:44:43 +0000 (20:44 +0000)]
routing: fix build without ROUTE_MPATH

MFC after: 1 month

2 years agosdio: Add CCCR speed defines
Emmanuel Vadot [Wed, 14 Jul 2021 15:25:36 +0000 (17:25 +0200)]
sdio: Add CCCR speed defines

Those are the defines needed to change speed on a SDIO card.

2 years agosdio: Do not allow setting a block size if function doesn't support it
Emmanuel Vadot [Wed, 26 May 2021 11:15:58 +0000 (13:15 +0200)]
sdio: Do not allow setting a block size if function doesn't support it

2 years agosdio: Always use increment address for read/write_4
Emmanuel Vadot [Fri, 21 May 2021 11:33:34 +0000 (13:33 +0200)]
sdio: Always use increment address for read/write_4

SDIO CMD53 (RW Extented) can either write to the same address (useful for FIFO)
or auto increment the destination address (to write to multiple registers).
It is more logical to have read/write_4 to use incremental mode and make other
helper function for writing to a FIFO destination especially since most FIFO
write/read will be 8bits based and not 32bits based.

2 years agosdio: Change the sdio helper name and arg order
Emmanuel Vadot [Fri, 21 May 2021 09:56:39 +0000 (11:56 +0200)]
sdio: Change the sdio helper name and arg order

Do not use b/l but _1/_4 also address comes first and then data.
This makes them closer to something like bus_space_{read,write}
We have no users in the tree.

2 years agoopencrypto: mark INVARIANTS variables as __diagused
Ed Maste [Tue, 9 Aug 2022 23:23:19 +0000 (19:23 -0400)]
opencrypto: mark INVARIANTS variables as __diagused

Fixes INVARIANTS build with Clang 15, which previously failed due to
set-but-not-used variable warnings.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

2 years agodevd: move all devd notification logic to a separate file.
Alexander V. Chernikov [Tue, 9 Aug 2022 15:55:23 +0000 (15:55 +0000)]
devd: move all devd notification logic to a separate file.

Currently, subr_bus.c shares logic for (a) maintaining all HW devices
 (e.g. discovery/attach/detach logic) and (b) generic devctl notification
 layer for devices/PMU/GEOM/interfaces/etc).
These two subsystems share really tiny interaction interface, composed of 3
 notification functions. With that in mind, move devctl layer to a
 separate file, establishing a clear notification interface between the
 sub.c bus layer and the provider (devctl).

The primary driver of this change is netlink implementation (D36002).
The idea is to propagate device-level events to netlink as well, so all
 netlink customers can subscribe to these changes.
The long-term goal is to deprecate devctl and to use netlink as the
 kernel<> userland transport provided netlink gets enough traction.

Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D36091
MFC after: 1 month

2 years agorouting: move rtentry and subscription code out of route_ctl.c
Alexander V. Chernikov [Mon, 8 Aug 2022 13:54:17 +0000 (13:54 +0000)]
routing: move rtentry and subscription code out of route_ctl.c

route_ctl.c size has grown considerably since initial introduction.
Factor out non-relevant parts:
* all rtentry logic, such as creation/destruction and accessors
 goes to net/route/route_rtentry.c
* all rtable subscription logic goes to net/route/route_subscription.c

Differential Revision: https://reviews.freebsd.org/D36074
MFC after: 1 month

2 years agorouting: add rib_<add|del>_route_px() functions operating with nexthops.
Alexander V. Chernikov [Thu, 4 Aug 2022 14:55:30 +0000 (14:55 +0000)]
routing: add rib_<add|del>_route_px() functions operating with nexthops.

This change adds public KPI to work with routes using pre-created
 nexthops, instead of using data from addrinfo structures. These
 functions will be later used for adding/deleting kernel-originated
 routes and upcoming netlink protocol.

As a part of providing this KPI, low-level route addition code has been
 reworked to provide more control over route creation or change.
 Specifically, a number of operation flags
 (RTM_F_<CREATE|EXCL|REPLACE|APPEND>) have been added, defining the
 desired behaviour the the route already exists (or not exists). This
 change required some changes in the multipath addition code, resulting
 in moving this code to route_ctl.c, rendering mpath_ctl.c empty.

Differential Revision: https://reviews.freebsd.org/D36073
MFC after: 1 month

2 years agorouting: split nexthop creation and rtentry creation.
Alexander V. Chernikov [Thu, 4 Aug 2022 12:35:31 +0000 (12:35 +0000)]
routing: split nexthop creation and rtentry creation.

This change is required for the upcoming introduction of the next
 nexhop-based operations KPI, as it will create rtentry and nexthops
 at different stages of route table modification.

Differential Revision: https://reviews.freebsd.org/D36072
MFC after: 2 weeks

2 years agorouting: refactor #2
Alexander V. Chernikov [Wed, 3 Aug 2022 08:20:40 +0000 (08:20 +0000)]
routing: refactor #2

* Use same filter func (rib_filter_f_t) for nexhtop groups to
 simplify callbacks.
* simplify conditional route deletion & remove the need to pass
 rt_addrinfo to the low-level deletion functions
* speedup rib_walk_del() by removing an additional per-prefix lookup

Differential Revision: https://reviews.freebsd.org/D36071
MFC after: 1 month

2 years agorouting: refactor control cmds #1
Alexander V. Chernikov [Tue, 2 Aug 2022 12:44:20 +0000 (12:44 +0000)]
routing: refactor control cmds #1

This and the follow-up routing-related changes target to remove or
 reduce `struct rt_addrinfo` usage and use recently-landed nhop(9)
 KPI instead.
Traditionally `rt_addrinfo` structure has been used to propagate all necessary
information between the protocol/rtsock and a routing layer. Many
functions inside routing subsystem uses it internally. However, using
this structure became somewhat complicated, as there are too many ways
of specifying a single state and verifying data consistency is hard.
For example, arerouting flgs consistent with mask/gateway sockaddr pointers?
Is mask really a host mask? Are sockaddr "valid" (e.g. properly zeroed, masked,
have proper length)? Are they mutable? Is the suggested interface specified
 by the interface index embedded into the sockadd_dl gateway, or passed
 as RTAX_IFP parameter, or directly provided by rti_ifp or it needs to
 be derived from the ifa?
These (and other similar) questions have to be considered every time when
 a function has `rt_addrinfo` pointer as an argument.

The new approach is to bring more control back to the protocols and
construct the desired routing objects themselves - in the end, it's the
protocol/subsystem who knows the desired outcome.

This specific diff changes the following:
* add explicit basic low-level radix operations:
 add_route() (renamed from add_route_nhop())
 delete_route() (factored from change_route_nhop())
 change_route() (renamed from change_route_nhop)
* remove "info" parameter from change_route_conditional() as a part
 of reducing rt_addrinfo usage in the internal KPIs
* add lookup_prefix_rt() wrapper for doing re-lookups after
 RIB lock/unlock

Differential Revision: https://reviews.freebsd.org/D36070
MFC after: 2 weeks

2 years agotcp: utilize new solisten_clone() and solisten_enqueue()
Gleb Smirnoff [Wed, 10 Aug 2022 18:09:34 +0000 (11:09 -0700)]
tcp: utilize new solisten_clone() and solisten_enqueue()

This streamlines cloning of a socket from a listener.  Now we do not
drop the inpcb lock during creation of a new socket, do not do useless
state transitions, and put a fully initialized socket+inpcb+tcpcb into
the listen queue.

Before this change, first we would allocate the socket and inpcb+tcpcb via
tcp_usr_attach() as TCPS_CLOSED, link them into global list of pcbs, unlock
pcb and put this onto incomplete queue (see 6f3caa6d815).  Then, after
sonewconn() we would lock it again, transition into TCPS_SYN_RECEIVED,
insert into inpcb hash, finalize initialization of tcpcb.  And then, in
call into tcp_do_segment() and upon transition to TCPS_ESTABLISHED call
soisconnected().  This call would lock the listening socket once again
with a LOR protection sequence and then we would relocate the socket onto
the complete queue and only now it is ready for accept(2).

Reviewed by: rrs, tuexen
Differential revision: https://reviews.freebsd.org/D36064

2 years agosockets: provide solisten_clone(), solisten_enqueue()
Gleb Smirnoff [Wed, 10 Aug 2022 18:09:34 +0000 (11:09 -0700)]
sockets: provide solisten_clone(), solisten_enqueue()

as alternative KPI to sonewconn().  The latter has three stages:
- check the listening socket queue limits
- allocate a new socket
- call into protocol attach method
- link the new socket into the listen queue of the listening socket

The attach method, originally designed for a creation of socket by the
socket(2) syscall has slightly different semantics than attach of a socket
cloned by listener.  Make it possible for protocols to call into the
first stage, then perform a different attach, and then call into the
final stage.  The first stage, that checks limits and clones a socket
is called solisten_clone(), and the function that enqueues the socket
is solisten_enqueue().

Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D36063

2 years agoinpcb: gather v4/v6 handling code into in_pcballoc() from protocols
Gleb Smirnoff [Wed, 10 Aug 2022 18:09:34 +0000 (11:09 -0700)]
inpcb: gather v4/v6 handling code into in_pcballoc() from protocols

Reviewed by: rrs, tuexen
Differential revision: https://reviews.freebsd.org/D36062

2 years agomodules: if_awg: Add miibus_if.h to the source
Emmanuel Vadot [Sun, 14 Nov 2021 19:53:10 +0000 (20:53 +0100)]
modules: if_awg: Add miibus_if.h to the source

Needed by the module.

2 years agomodules: aw_mmc: Add mmc_pwrseq_if to the source
Emmanuel Vadot [Sun, 14 Nov 2021 19:52:44 +0000 (20:52 +0100)]
modules: aw_mmc: Add mmc_pwrseq_if to the source

Needed by the module.

2 years agoarm64: rockchip: rk_gpio: Improve mode switching
Emmanuel Vadot [Wed, 22 Sep 2021 14:55:54 +0000 (16:55 +0200)]
arm64: rockchip: rk_gpio: Improve mode switching

Changing mode on a pin (input/output/pullup/pulldown) is a bit slow.
Improve this by caching what we can.
We need to check if the pin is in gpio mode, do that the first time
that we have a request for this pin and cache the result. We can't do
that at attach as we are a child of rk_pinctrl and it didn't finished
its attach then.
Cache also the flags specific to the pinctrl (pullup or pulldown) if the
pin is in input mode.
Cache the registers that deals with input/output mode and output value. Also
remove some register reads when we change the direction of a pin or when we
change the output value since the bit changed in the registers only affect output
pins.

2 years agoSimplify setting a non-4k PAGE_SIZE on arm64
Andrew Turner [Tue, 9 Aug 2022 15:15:56 +0000 (16:15 +0100)]
Simplify setting a non-4k PAGE_SIZE on arm64

Define PAGE_SIZE and PAGE_MASK based on PAGE_SHIFT. With this we only
need to set one value to change one value to change the page size.

While here remove the unused PAGE_MASK_* macros.

Sponsored by: The FreeBSD Foundation

2 years agogpio: mark INVARIANTS variables as __diagused
Ed Maste [Tue, 9 Aug 2022 23:30:13 +0000 (19:30 -0400)]
gpio: mark INVARIANTS variables as __diagused

Fixes INVARIANTS build with Clang 15, which previously failed due to
set-but-not-used variable warnings.

Reviewed by: dim
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36097

2 years agotcp: address a wire level race with 2 ACKs at the end of TCP handshake
Gleb Smirnoff [Wed, 10 Aug 2022 14:32:37 +0000 (07:32 -0700)]
tcp: address a wire level race with 2 ACKs at the end of TCP handshake

Imagine we are in SYN-RCVD state and two ACKs arrive at the same time,
both valid, e.g. coming from the same host and with valid sequence.

First packet would locate the listening socket in the inpcb database,
write-lock it and start expanding the syncache entry into a socket.
Meanwhile second packet would wait on the write lock of the listening
socket.  First packet will create a new ESTABLISHED socket, free the
syncache entry and unlock the listening socket.  Second packet would
call into syncache_expand(), but this time it will fail as there
is no syncache entry.  Second packet would generate RST, effectively
resetting the remote connection.

It seems to me, that it is impossible to solve this problem with
just rearranging locks, as the race happens at a wire level.

To solve the problem, for an ACK packet arrived on a listening socket,
that failed syncache lookup, perform a second non-wildcard lookup right
away.  That lookup may find the new born socket.  Otherwise, we indeed
send RST.

Tested by: kp
Reviewed by: tuexen, rrs
PR: 265154
Differential revision: https://reviews.freebsd.org/D36066

2 years agonetinet6: allow ND entries creation for all directly-reachable
Alexander V. Chernikov [Wed, 10 Aug 2022 11:51:58 +0000 (11:51 +0000)]
netinet6: allow ND entries creation for all directly-reachable
destinations.

The current assumption is that kernel-handled rtadv prefixes along with
 the interface address prefixes are the only prefixes considered in
 the ND neighbor eligibility code.
Change this by allowing any non-gatewaye routes to be eligible. This
 will allow DHCPv6-controlled routes to be correctly handled by
 the ND code.
Refactor nd6_is_new_addr_neighbor() to enable more deterministic
 performance in "found" case and remove non-needed
 V_rt_add_addr_allfibs handling logic.

Reviewed By: kbowling
Differential Revision: https://reviews.freebsd.org/D23695
MFC after: 1 month

2 years agoarm64: rockchip: pinctrl: Do not rely on the node name
Emmanuel Vadot [Wed, 10 Aug 2022 13:47:22 +0000 (15:47 +0200)]
arm64: rockchip: pinctrl: Do not rely on the node name

Node names for gpio bank were made generic in Linux 5.16 so stop
using them to map the gpio controller to the pin controller bank unit.

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoImport device-tree files from Linux 5.18
Emmanuel Vadot [Wed, 10 Aug 2022 12:32:46 +0000 (14:32 +0200)]
Import device-tree files from Linux 5.18

Sponsored by:   Beckhoff Automation GmbH & Co. KG

2 years agoImport device-tree files from Linux 5.18
Emmanuel Vadot [Wed, 10 Aug 2022 12:31:09 +0000 (14:31 +0200)]
Import device-tree files from Linux 5.18

2 years agoImport device-tree files from Linux 5.17
Emmanuel Vadot [Wed, 10 Aug 2022 12:29:43 +0000 (14:29 +0200)]
Import device-tree files from Linux 5.17

Sponsored by:   Beckhoff Automation GmbH & Co. KG

2 years agoImport device-tree files from Linux 5.17
Emmanuel Vadot [Wed, 10 Aug 2022 12:28:38 +0000 (14:28 +0200)]
Import device-tree files from Linux 5.17

2 years agoImport device-tree files from Linux 5.16
Emmanuel Vadot [Wed, 10 Aug 2022 12:27:16 +0000 (14:27 +0200)]
Import device-tree files from Linux 5.16

Sponsored by:   Beckhoff Automation GmbH & Co. KG

2 years agoImport device-tree files from Linux 5.16
Emmanuel Vadot [Wed, 10 Aug 2022 12:25:35 +0000 (14:25 +0200)]
Import device-tree files from Linux 5.16

2 years agoImport device-tree files from Linux 5.15
Emmanuel Vadot [Wed, 10 Aug 2022 12:21:52 +0000 (14:21 +0200)]
Import device-tree files from Linux 5.15

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoImport device-tree files from Linux 5.15
Emmanuel Vadot [Wed, 10 Aug 2022 12:20:33 +0000 (14:20 +0200)]
Import device-tree files from Linux 5.15

2 years agoImport device-tree files from Linux 5.14
Emmanuel Vadot [Wed, 10 Aug 2022 12:11:47 +0000 (14:11 +0200)]
Import device-tree files from Linux 5.14

2 years agoImport device-tree files from Linux 5.14
Emmanuel Vadot [Wed, 10 Aug 2022 12:05:33 +0000 (14:05 +0200)]
Import device-tree files from Linux 5.14

2 years agotcp: improve BBLog for output events when using the FreeBSD stack
Michael Tuexen [Mon, 8 Aug 2022 11:07:10 +0000 (13:07 +0200)]
tcp: improve BBLog for output events when using the FreeBSD stack

Put the return value of ip_output()/ip6_output in the output event
instead of adding another one in case of an error. This improves
consistency with other similar places.

Reviewed by: rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D36085

2 years agosctp: improve handling of send() calls with no user data`
Michael Tuexen [Mon, 8 Aug 2022 10:53:42 +0000 (12:53 +0200)]
sctp: improve handling of send() calls with no user data`

In particular, don't report EAGAIN on send() calls with no user
data, which might trigger a KASSERT in asyc IO.

Reported by: syzbot+3b4dc5d1d63e9bd01eda@syzkaller.appspotmail.com
MFC after: 1 week

2 years agoarc4random(3): Reduce diff with OpenBSD.
Xin LI [Wed, 10 Aug 2022 00:27:54 +0000 (17:27 -0700)]
arc4random(3): Reduce diff with OpenBSD.

The main change was v1.57 by djm@:

  Randomise the rekey interval a little. Previously, the chacha20
  instance would be rekeyed every 1.6MB. This makes it happen at a
  random point somewhere in the 1-2MB range.

Reviewed by: csprng (markm, cem)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36088

2 years agotests: Add more shared shadow regression tests
Mark Johnston [Tue, 9 Aug 2022 20:17:56 +0000 (16:17 -0400)]
tests: Add more shared shadow regression tests

The new tests exercise simulated COW that occurs when the protections on
a wired, copy-on-write mapping are changed from read-only to read-write.

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

2 years agoatomic: Add plain atomic_load/store_bool()
Mark Johnston [Tue, 9 Aug 2022 20:08:29 +0000 (16:08 -0400)]
atomic: Add plain atomic_load/store_bool()

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

2 years agodtrace/amd64: Implement emulation of call instructions
Mark Johnston [Tue, 9 Aug 2022 20:08:13 +0000 (16:08 -0400)]
dtrace/amd64: Implement emulation of call instructions

Here, the provider is responsible for updating the trapframe to redirect
control flow and for computing the return address.  Once software-saved
registers are restored, the emulation shifts the remaining context down
on the stack to make space for the return address, then copies the
address provided by the invop handler.  dtrace_invop() is modified to
allocate temporary storage space on the stack for use by the provider to
return the return address.

This is to support a new provider for amd64 which can instrument
arbitrary instructions, not just function entry and exit instructions as
FBT does.

In collaboration with: christos
Sponsored by: Google, Inc. (GSoC 2022)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

2 years agofbt/x86: Extract arg1 for return probes from the trapframe
Mark Johnston [Tue, 9 Aug 2022 20:08:09 +0000 (16:08 -0400)]
fbt/x86: Extract arg1 for return probes from the trapframe

dtrace invop handlers have access to the whole trapframe, just use that
to extract %rax/%eax for return probes instead of relying on an
additional parameter to the handler.  No functional change intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

2 years agorelease: Include an etcupdate tree in -DNO_ROOT release image builds
Jessica Clarke [Tue, 9 Aug 2022 21:58:01 +0000 (22:58 +0100)]
release: Include an etcupdate tree in -DNO_ROOT release image builds

This makes use of the new -N etcupdate flag and merges the resulting
METALOG into base.meta re-rooted to /var/db/etcupdate/current.

Reviewed by: gjb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35858

2 years agoetcupdate: Add a -N flag to perform a NO_ROOT build
Jessica Clarke [Tue, 9 Aug 2022 21:57:47 +0000 (22:57 +0100)]
etcupdate: Add a -N flag to perform a NO_ROOT build

This is in preparation for including an etcupdate tree when performing a
-DNO_ROOT release image build. Although -DNO_ROOT can be passed via -M,
to be useful we need to mangle the resulting METALOG to mirror the
various cleanups to the tree that are done after the build (removing
generated files, empty files and empty directories), so etcupdate needs
its own flag.

Reviewed by: jhb, pauamma
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35857

2 years agoetcupdate: Prefer POSIX -depth to BSD -d
Jessica Clarke [Tue, 9 Aug 2022 21:57:22 +0000 (22:57 +0100)]
etcupdate: Prefer POSIX -depth to BSD -d

This is in preparation for building an etcupdate tree on non-FreeBSD
when building release images. The -d option is documented as a
BSD-specific equivalent to the POSIX -depth primary. Whilst GNU find
sort of accepts it in an attempt to be compatible, it still doesn't
permit it coming before the paths, unlike BSD find, and prints a
deprecation warning either way. Thus, use the equivalent POSIX -depth to
ensure it works correctly and without warning everywhere.

Reviewed by: jhb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35856

2 years agorelease: Forward ${MAKE} to etcupdate via the new -m flag
Jessica Clarke [Tue, 9 Aug 2022 21:57:01 +0000 (22:57 +0100)]
release: Forward ${MAKE} to etcupdate via the new -m flag

This is in preparation for non-FreeBSD builds where make is GNU make and
so etcupdate needs to know the name of or path to the bmake binary to
use for its own builds.

Reviewed by: gjb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35855

2 years agoetcupdate: Add a -m flag to change the make binary that's run
Jessica Clarke [Tue, 9 Aug 2022 21:56:19 +0000 (22:56 +0100)]
etcupdate: Add a -m flag to change the make binary that's run

This will allow release/Makefile to forward on ${MAKE} to allow building
on non-FreeBSD systems where ${MAKE} is something other than make, as
make is typically GNU make in such situations.

Reviewed by: jhb, pauamma
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35854

2 years agorelease: Use in-tree etcupdate for build
Jessica Clarke [Tue, 9 Aug 2022 21:52:47 +0000 (22:52 +0100)]
release: Use in-tree etcupdate for build

This is in preparation for non-FreeBSD and -DNO_ROOT builds. On
non-FreeBSD there is no host etcupdate to use, and -DNO_ROOT will
require additional flags that may not be supported by the host's
etcupdate when building on FreeBSD. Moreover, there's no guarantee
anyway that the host's etcupdate is quite right for the current tree;
upgrading from source only requires that the host's is good enough for
-p which just manually copies master.passwd and group, the rest of the
upgrade is done post-installworld. For example, should a new set of
autogenerated files be added that etcupdate is taught about, the host
won't know about them and so the bootstrapped current tree will
incorrectly contain them, leading to spurious diffs on the installed
system.

Reviewed by: gjb, delphij
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35853

2 years agovm_fault: Shoot down shared mappings in vm_fault_copy_entry()
Mark Johnston [Mon, 25 Jul 2022 20:53:21 +0000 (16:53 -0400)]
vm_fault: Shoot down shared mappings in vm_fault_copy_entry()

As in vm_fault_cow(), it's possible, albeit rare, for multiple vm_maps
to share a shadow object.  When copying a page from a backing object
into the shadow, all mappings of the source page must therefore be
removed.  Otherwise, future operations on the object tree may detect
that the source page is fully shadowed and thus can be freed.

Approved by: so
Security: FreeBSD-SA-22:11.vm
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35635

2 years agoelf_note_prpsinfo: handle more failures from proc_getargv()
Konstantin Belousov [Fri, 3 Jun 2022 08:21:23 +0000 (11:21 +0300)]
elf_note_prpsinfo: handle more failures from proc_getargv()

Resulting sbuf_len() from proc_getargv() might return 0 if user mangled
ps_strings enough. Also, sbuf_len() API contract is to return -1 if the
buffer overflowed. The later should not occur because get_ps_strings()
checks for catenated length, but check for this subtle detail explicitly
as well to be more resilent.

The end result is that p_comm is used in this situations.

Approved by: so
Security: FreeBSD-SA-22:09.elf
Reported by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: delphij, markj
admbugs: 988
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35391

2 years agorelease: ensure enforce_chs sysctl is 0
Ed Maste [Tue, 19 Jul 2022 20:47:49 +0000 (16:47 -0400)]
release: ensure enforce_chs sysctl is 0

We do not want CHS-based alignment for VM or SD card release images.

(Other images use makefs/mkimg, not kernel gpart and so do not depend
on this sysctl.)

Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

2 years agoAdd "heard" to the dictionary
Ed Maste [Mon, 8 Aug 2022 18:57:32 +0000 (14:57 -0400)]
Add "heard" to the dictionary

PR: 265671
Reported by: J.R. Oldroyd
MFC after: 3 days

2 years agoAdd the PHY driver for the Marvell 88E1512.
Luiz Souza [Fri, 29 Jul 2022 15:43:56 +0000 (17:43 +0200)]
Add the PHY driver for the Marvell 88E1512.

This driver supports the auto negotiation mode between the copper and fiber
ports.

This PHY has two independent PHYs (one for copper and other for fiber) but in
this case the functionality is presented as a single PHY for easy management.

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

2 years agoif_ovpn tests: remote access test case
Kristof Provost [Thu, 28 Jul 2022 09:55:53 +0000 (11:55 +0200)]
if_ovpn tests: remote access test case

Add a (multi-client) test case where we route traffic beyond the ovpn
server, onto a shared LAN.

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

2 years agonetinet tests: Add test for IPv6 mapped-v4 bind problem
Mike Karels [Tue, 9 Aug 2022 12:08:09 +0000 (07:08 -0500)]
netinet tests: Add test for IPv6 mapped-v4 bind problem

Test fix in 637f317c6d9c, verifying that when ports run out, we get
an EADDRNOTAVAIL error from bind() rather than an EADDRINUSE error
from connect().  Use small port range to exhaust ports and see which
error happens.

Reviewed by: tuexen, glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D36056
MFC after: 3 days (with 637f317c6d9c)

2 years agolibpathconv: bump man page dates
Gordon Bergling [Tue, 9 Aug 2022 08:05:31 +0000 (10:05 +0200)]
libpathconv: bump man page dates

- bump the man page dates to the date of mandoc fixes

Reported by: rpokala
X-MFC with: 094517119c62c23369d545a7475ae982d86330a3

2 years agox86: Remove redundant parentheses
Emmanuel Vadot [Tue, 9 Aug 2022 07:46:50 +0000 (09:46 +0200)]
x86: Remove redundant parentheses

Reported by: avg
Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week
MFC-With: b223c1f1a0ac ("x86: Add another cpuid for Apollo Lake errata APL30")

2 years agox86: Add another cpuid for Apollo Lake errata APL30
Corvin Köhne [Tue, 9 Aug 2022 07:07:59 +0000 (09:07 +0200)]
x86: Add another cpuid for Apollo Lake errata APL30

Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week

2 years agosyslog(3): unbreak log generation using fabricated PID
Eugene Grosbein [Mon, 8 Aug 2022 22:21:02 +0000 (05:21 +0700)]
syslog(3): unbreak log generation using fabricated PID

Recover application ability to supply fabricated PID
embedded into ident that was lost when libc switched
to generation of RFC 5424 log messages, for example:

logger -t "ident[$$]" -p user.notice "test"

It is essential for long running scripts.
Also, this change unbreaks matching resulted entries
by ident in syslog.conf:

!ident
*.* /var/log/ident.log

Without the fix, the log (and matching) was broken:

Aug  1 07:36:58 hostname ident[123][86483]: test

Now it works as expected and worked before breakage:

Aug  1 07:39:40 hostname ident[123]: test

Differential: https://reviews.freebsd.org/D36005
MFC after: 2 weeks

2 years agotests/socket: add accept_filter(9) test
Gleb Smirnoff [Mon, 8 Aug 2022 21:10:18 +0000 (14:10 -0700)]
tests/socket: add accept_filter(9) test

Test basic functionality of accf_data(9) and accf_http(9)

2 years agoapply: clean up error handling.
Dag-Erling Smørgrav [Mon, 8 Aug 2022 19:06:35 +0000 (19:06 +0000)]
apply: clean up error handling.

Sponsored by: Klara, Inc.

2 years agolinuxkpi: io.h: Only exclude armv6 and armv7 for asm/set_memory.h
Emmanuel Vadot [Mon, 8 Aug 2022 18:21:08 +0000 (20:21 +0200)]
linuxkpi: io.h: Only exclude armv6 and armv7 for asm/set_memory.h

Other arches like powerpc* needs it.

Fixes: d387a1b4b1996 ("linuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7")
Fixes: 789dbdbb48574 ("linuxkpi: Add arch_io_{reserve,free}_memtype_wc")
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoktls_test: Add a require_toe option similar to require_ifnet.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
ktls_test: Add a require_toe option similar to require_ifnet.

This skips tests that send and receive records that do not use TOE TLS.

Sponsored by: Chelsio Communications

2 years agocxgbe TOE TLS: Fix handling of unusual record types.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
cxgbe TOE TLS: Fix handling of unusual record types.

This doesn't matter for real traffic but fixes failures in the KTLS
unit tests that use unusual record types.

Sponsored by: Chelsio Communications

2 years agocxgbe TOE TLS: Simplify a few routines.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
cxgbe TOE TLS: Simplify a few routines.

Remove a few more remnants from the old pre-KTLS support and instead
assume that each work request sends a single TLS record.

Sponsored by: Chelsio Communications

2 years agocxgbe: Handle requests for TLS key allocations with no TLS key storage.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
cxgbe: Handle requests for TLS key allocations with no TLS key storage.

If an adapter advertises support for TLS keys but an empty TLS key
storage area in on-board memory, fail the request rather than invoking
vmem_alloc on an uninitialized vmem.

Sponsored by: Chelsio Communications

2 years agocxgbe: Rename t4_kern_tls.c to t6_kern_tls.c.
John Baldwin [Mon, 8 Aug 2022 18:21:53 +0000 (11:21 -0700)]
cxgbe: Rename t4_kern_tls.c to t6_kern_tls.c.

This implementation of NIC TLS is specific to T6 adapters.

Sponsored by: Chelsio Communications

2 years agozlib: Fix extra field processing bug that dereferences NULL state->head.
Mark Adler [Mon, 8 Aug 2022 17:50:09 +0000 (10:50 -0700)]
zlib: Fix extra field processing bug that dereferences NULL state->head.

The recent commit to fix a gzip header extra field processing bug
introduced the new bug fixed here.

(cherry picked from zlib commit 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d)

2 years agolinuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7
Emmanuel Vadot [Mon, 8 Aug 2022 16:54:23 +0000 (18:54 +0200)]
linuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7

They do not have the same pmap api and this cannot work for those arch.

Fixes: 789dbdbb48574 ("linuxkpi: Add arch_io_{reserve,free}_memtype_wc")
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 years agoMerge libcxxrt commit 5d8a15823a103bbc27f1bfdcf2b5aa008fab57dd
Mark Johnston [Mon, 8 Aug 2022 16:30:56 +0000 (12:30 -0400)]
Merge libcxxrt commit 5d8a15823a103bbc27f1bfdcf2b5aa008fab57dd

  Fix two bugs in __cxa_end_cleanup()

  Per the EHABI32 specification, __cxa_end_cleanup must take care to
  preserve registers before calling _Unwind_Resume().  So, libcxxrt uses
  an assembly stub which preserves caller-saved registers around the call
  to __cxa_get_cleanup().  But:
  - it failed to restore them properly,
  - it did not preserve the link register.

  Fix both of these problems.  This is needed to fix exception unwinding
  on FreeBSD with LLVM 14.  Note that r4 is callee-saved but is pushed
  onto the stack to preserve stack pointer alignment.

Sponsored-by: The FreeBSD Foundation
MFC after: 1 week

2 years agolib9p: Remove potential buffer overwrite in l9p_puqids()
Konrad Sewiłło-Jopek [Mon, 8 Aug 2022 16:25:48 +0000 (12:25 -0400)]
lib9p: Remove potential buffer overwrite in l9p_puqids()

Structure l9p_f_wralk reserves at most L9P_MAX_WELEM entries
and that number actually set the maximum we can safely use.

PR: 265385
Reviewed by: markj
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D35907

2 years agothread_create(): call cpu_copy_thread() after td_pflags is zeroed
Konstantin Belousov [Sun, 7 Aug 2022 17:00:02 +0000 (20:00 +0300)]
thread_create(): call cpu_copy_thread() after td_pflags is zeroed

By calling the function too early we might still have the td_pflags
value cached from the previous struct thread use. cpu_copy_thread()
depends on correct value for TDP_KTHREAD at least on x86.

Reported, bisected, and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36069

2 years agopf: stop resolving hosts as dns that use ":" modifier
Franco Fichtner [Mon, 8 Aug 2022 16:31:02 +0000 (18:31 +0200)]
pf: stop resolving hosts as dns that use ":" modifier

When the interface does not exist avoid passing host with special pf
modifiers to DNS resolution as they come up empty anyway.

Reviewed by: kp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35429

2 years agorelease: fix alignment for arm SoCs
Glen Barber [Mon, 8 Aug 2022 14:59:29 +0000 (10:59 -0400)]
release: fix alignment for arm SoCs

MFC after: 3 days
Submitted by: Mark Millard
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoBump __FreeBSD_version after linuxkpi changes.
Emmanuel Vadot [Mon, 8 Aug 2022 13:22:11 +0000 (15:22 +0200)]
Bump __FreeBSD_version after linuxkpi changes.

2 years agolinuxkpi: pm: Add more defines and includes
Emmanuel Vadot [Tue, 2 Aug 2022 08:49:13 +0000 (10:49 +0200)]
linuxkpi: pm: Add more defines and includes

Needed by drm-kmod.

Reviewed By: emaste, hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36024

2 years agolinuxkpi: Include highmem.h in pagemap.h
Emmanuel Vadot [Tue, 2 Aug 2022 08:42:46 +0000 (10:42 +0200)]
linuxkpi: Include highmem.h in pagemap.h

Linux does the same.

Reviewed by: bz, emaste, hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36023

2 years agolinuxkpi: Add arch_io_{reserve,free}_memtype_wc
Emmanuel Vadot [Tue, 2 Aug 2022 08:27:00 +0000 (10:27 +0200)]
linuxkpi: Add arch_io_{reserve,free}_memtype_wc

Reviewed by: hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36022

2 years agolinuxkpi: Add dev_info_once
Emmanuel Vadot [Tue, 2 Aug 2022 08:22:59 +0000 (10:22 +0200)]
linuxkpi: Add dev_info_once

Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36021