ifconfig(8): avoid deprecated declaration warnings
The latest expat deprecates XML_GetCurrentLineNumber(), resulting in
fatal warnings that stop the build. Replace callouts with the recommended
XML_GetCurrentLineNumber64() function for a clean build.
drm: fix DRM master bookkeeping after a VT switch
drm_is_current_master() only checked drm_file.is_master, which is never
cleared. After a VT switch DROP_MASTER clears dev->master, but X's
following SET_MASTER hit that check and returned without restoring it.
From then on the device had no master while X still looked like one:
- DROP_MASTER failed with EINVAL, and X logged "drmDropMaster failed:
Invalid argument" on every later VT switch;
- clients that opened the node became master themselves through
drm_master_open() and registered their magic in their own master
object, so X's AUTH_MAGIC failed (DRI2 authentication errors);
- with no master, drm_fb_helper_is_bound() no longer kept the fbdev
helper off the display, so the console could take it on connector
hotplug.
Compare the file's master with dev->master, as Linux does. This also
stops a former master from dropping the mastership of a later
SET_MASTER caller.
[3 lines not shown]
Add usr.sbin/rvn
This is the Ravenports bootstrap stub program.
if /raven/sbin/rvn is already installed, it is exec'd with
original arguments. Otherwise, with the user's confirmation,
rvn is downloaded and installed in place.
Add usr.sbin/rvn
This is the Ravenports bootstrap stub program.
if /raven/sbin/rvn is already installed, it is exec'd with
original arguments. Otherwise, with the user's confirmation,
rvn is downloaded and installed in place.
syscons: hold syscons_mtx when scclose() finishes a pending VT switch
A vty in VT_PROCESS mode that has not released the screen leaves
SWITCH_WAIT_REL set on sc->old_scp. If the process controlling that vty
then dies, scclose() calls finish_vt_rel(scp, TRUE) before it takes
syscons_mtx. With SWITCH_WAIT_REL set, finish_vt_rel() goes on to
switch to the new screen, and exchange_scr() calls update_kbd_state()
(and, for a K_XLATE vty, save_kbd_state()) with unlock != 0, which drop
and re-acquire syscons_mtx around kbd_ioctl(). Unlocking a mutex that
was never taken panics in _mtx_unlock().
Take syscons_mtx before finish_vt_rel() and keep the existing locked
section. Clearing SWITCH_WAIT_ACQ and switch_in_progress is then
serialised against the other syscons_mtx holders as well.
Bug: https://bugs.dragonflybsd.org/issues/3496
Reported-by: vjkarbo
rc.subr: Update load_rc_config() to make the argument optional
Make the argument optional, so only try to load the per-service config
file (i.e., /etc/rc.conf.d/${service}) when specified.
Remove the 'XXX' dummy mark from scripts that has no service name to
call load_rc_config().
Derived-from: FreeBSD
service(8): Enable jail detection to skip "nojail"
DragonFly has implemented the "jail.jailed" sysctl in commit
4e558034a6febf3a5bba02db3c73eca402cd4d98, so use it to enable the jail
handling in service(8).
In addition, clean up the code to reduce duplicate.
<sys/cdefs.h>: Simplify __GLOBL() and move to <sys/linker_set.h>
Simplify __GLOBL() by removing __GLOBL1() (obtained-from: FreeBSD).
Move the __GLOBL() macro to its only user: <sys/liner_set.h>.
While there, also remove the obsolete and disabled __MAKE_SET() macro.
<sys/cdefs.h>: Tweak __cachealign macro
Don't check __GNUC__ and always define the __cachealign macro with
__aligned(). The __aligned__ attribute is supported by all current
compilers and it affects the ABI, so it's better to always define it.
<sys/cdefs.h>: Remove __ARRAY_ZERO compat for flexible array member
It was added in commit 18ba5b61aa74313775925e79837259d0e0ea913b to
satisfy GCC 2.x when the flexible array member was not well supported.
Now this macro is obsolete and so remove it.
<sys/cdefs.h>: Remove unused and obsolete '__usereg'
This macro was added in commit f754816e98c48671805f81055cf309543b3add1e
from 2003 and seems never used in the source tree. It might be useful
in the 32-bit era decades ago, but doesn't make sense nowadays,
specially with much more advanced compilers.
<machine/cpufunc.h>: Remove unused includes to avoid thread dependency
* Clean up cpufunc.h to remove unused includes, struct forward
declerations, and outdated comment. The main intention is to remove
the thread dependency so this header can be used in lib/libc/thread.
* Update smp.h to include <sys/cpumask.h> for cpumask_t, which was
included via <sys/thread.h>.
* Include <sys/cpumask.h> in globaldata.h to be more self-contained.
kernel: FAST uptime clocks from the kpmap in clock_gettime(2)
The system call answered CLOCK_MONOTONIC_FAST and CLOCK_UPTIME_FAST
with getnanouptime(), which counts from gd_hardclock.time, the next
tick, and so runs up to a tick ahead. After ten calls libc reads
ts_uptime from the kpmap instead, the time of the last tick, so both
clocks stepped back by up to a tick in every process. Zig's
std.time.Instant panics when that happens.
Read the kpmap in the system call as well, with the upticks protocol
from sys/upmap.h. CLOCK_REALTIME_FAST is not affected.
Reviewed-by: @dillon
Bug: https://bugs.dragonflybsd.org/issues/3493
drm: zero pages in alloc_page() and alloc_pages() for __GFP_ZERO
alloc_page() and alloc_pages() ignore __GFP_ZERO. alloc_page() calls
vm_page_alloczwq() without VM_ALLOC_ZERO, which hands out the page with
whatever it last held, and vm_page_alloc_contig() does not zero either.
TTM asks for zeroed pages for every buffer a client creates
(TTM_PAGE_FLAG_ZERO_ALLOC) and only clears the pages it reuses from its
own pools. Cached buffers get their pages from alloc_page(), and new
pages for the write-combined and uncached pools come from
alloc_pages(), so a client can map a new buffer and read what the page
held before: freed memory of other processes or the kernel. i915 asks
for zeroed scratch and status pages, and TTM for a zeroed dummy read
page, the same way.
Pass VM_ALLOC_ZERO for __GFP_ZERO in alloc_page(), and zero the pages
in alloc_pages().
Reviewed-by: @dillon
net: Announce IFAN_DEPARTURE message after route/address deletions
The if_detach() function previously announced IFAN_DEPARTURE before
deleting the routes/addresses, so a userland program could receive a
RTM_DELADDR message after the interface had gone and thus cause
confusion. For example, bringing down a wg(4) interface would cause
dhcpcd(8) to emit the following warnings:
```
dhcpcd_handlelink: No such process
dhcpcd_handlelink: No such process
```
Fix this bug by moving the IFAN_DEPARTURE annoucement after the
route/address deletions.
This is a regression introduced in commit b4051e2552 (ifnet: Make ifnet
and ifindex2ifnet MPSAFE).
etc: Switch the default dhcp_client to dhcpcd
The dhcpcd(8) has been in base for many years and it supports both IPv4
and IPv6, replacing both dhclient(8) and rtsold(8). Now switch the
default dhcp_client in defaults/rc.conf to dhcpcd.
However, the recommended way of using dhcpcd(8) is to simply run it as a
master daemon by setting "dhcpcd_enable=YES" in rc.conf, without the
need to configure individual interfaces with "ifconfig_<ifname>=DHCP".
The man pages are updated to document the new default and the
recommendation.