fix swap encryption data corruption issue
when paging out, uvm_swap_io encrypts the page contents in-place
and then issues write requests to swapdev. if the write fails
for some reason, the pageout will be cancelled. but it leaves
the data in the pages encrypted. ie. data corruption. note that
this doesn't necessarily involve broken swap devices. as we are
in the pagedaemon context, some kind of transient errors are
rather normal. for example, ffs VOP_BMAP has special cases for
the pagedaemon to return ENOMEM.
this commit fixes the issue by simply reverting the encryption
on error.
PR/60082https://gnats.netbsd.org/60082
simplify swap encryption a bit
* disallow changes of vm.swap_encrypt sysctl when any swap
is configured. note: this doesn't affect the ability to
set it in /etc/sysctl.conf because /etc/rc.d/sysctl is
executed before /etc/rc.d/swap1.
* retire per-page encryption tracking. (swd_encmap)
from now on, the whole swap is encrypted or not.
PR/60084https://gnats.netbsd.org/60084
genmatch.cc: bring across several enhancements from mainline GCC.
in my testing this reduces the size of the emitted "gimple-match.cc"
by about 35%, reduces the code section sise about 15%, and reduces
the compile time about 30%. (this file is the largest single compile
for all of GCC.)
this makes it capable of compiling on vax and sparc again, it seems,
where both were already capable for GCC 14 (which in addition to this
set, splits the emitted file into 10 sub parts for compiling both
separately and in parallel.)
(this is part 1, part 2 will be about mergig the split of the output
into multiple files, but may be abandoned as this portion helps
enough.)
tested on amd64, vax, sparc as only target, powerpc, with some arm64,
arm, and m68k to come -- may be also very useful for m68k target.
[29 lines not shown]
Streamline pre-main() prologue just a bit:
- Enable the on-chip caches for 68020 and 68030 in the MMU-enablement
code fragment, as is already done for 68040 and 68060. Eliminates
a bunch of duplicated code in each locore.s.
- The ATC (and the HP MMU TLB, if applicable) has already been flushed /
invalidated as part of enabling the MMU, so there's no need to either
call _TIBA() or perform an inline pflusha again after the MMU has been
turned on.
zfs: put back deferred atime update to VOP_INACTIVE
we currently push atime updates in VOP_RECLAIM and VFS_SYNC.
VFS_SYNC iterates all cached vnodes for that:
> /*
> * On NetBSD, we need to push out atime updates. Solaris does
> * this during VOP_INACTIVE, but that does not work well with the
> * BSD VFS, so we do it in batch here.
> */
it isn't ideal for systems with large vnode cache.
i'm not sure why it "does not work well with the BSD VFS" either.
maybe historical reasons which don't hold anymore?
this commit put the atime pushing logic to VOP_INACTIVE, where
it's done in solaris and freebsd. it seems working well as far as
i tested.
[7 lines not shown]
arm: fix profile support
gcc on arm has defaulted to arm/bpabi.h over arm/netbsd-elf.h since
external/gpl3/gcc/dist/gcc/config.gcc:1.70
date: 2021-06-15 09:22:23 +0100
which has meant that profiling expects __gnu_mcount_nc
This commit provides __gnu_mcount_nc and ditches non-EABI support (and
arm26 support)
commit 27c3de6c8063a7850ef0efbea0d83f314e541ce8
Author: Ryota Ozaki <ozaki-r at iij.ad.jp>
Date: Thu Mar 12 12:42:03 2026 +0900
nd: reset ln_asked on state reset
Even if a userland program such as ping continuously sends packets
to a (temporarily) unreachable host, the ND resolver only sends
request packets up to nd_mmaxtries times. This change allows ND
request packets to continue being sent while the userland process
is still sending packets.
Additionally, introduce LLE_UNRESOLVED to fix another issue.
nd_resolve may incorrectly return an error immediately after sending
the last ND request packet. For example, if nd_mmaxtries = 1 and two
packets arrive simultaneously, nd_resolve returns an error for the
second packet. This occurs because ln_asked is used to determine
whether the ND resolution is still in progress.
[75 lines not shown]
Fix an off by one land mine in PR 60099 fix
While here, fix another, identical land mine, that
has been buried in the absolute wilderness for years.
Someone would have stepped on it one day.
Also fix a field splitting bug handling : or = in
IFS when generated from ${var-string1:string2} type
expansions. This one is even older.
Clean up some dead code that didn't get removed with
the initial 60099 fixes, but probably should have been.
DEBUG mode improvements (the last couple of days have
really needed the DEBUG code).
libXcursor: use a valid setting for XCURSORPATH
also fix the man page build to have the same list (from Petre Rodan).
should fix PR#58407, and partially fix PR#59782.
XXX: pullup-11, maybe others
swapctl(8): do not assume PGSHIFT is available
PGSHIFT might not be available in userland. eg. sparc
use sysconf(_SC_PAGESIZE) to query the kernel instead.
Re-do the way the news1700's external cache vs. 68030 cache burst mode
issue is dealt with.
Rather than completely re-defining the high-level cache operation macros
to exclude the *_BE bits (which actually penalized systems without an EC
because the *_BE bits set in the CACR initiallly would be lost on the first
cache operation), instead we provide a "platform has dynamic CACR values"
hook.
For NEWS, the values default to the with-*_BE variant, but if an external
cache is discovered, the values are patched up with the non-*_BE variants.
Only one shared assembly language routine needs to be adjusted for this,
the rest of the scenarios where these values are used are handled by the
compiler via constraints.
For all other platforms that don't define __HAVE_M68K_DYNAMIC_CACR,
the values remain compile-time constants, as before.
Group 68020/68030 CACR bits into "the actual bits that do stuff" and
"higher level operations", along with some helper macros that compute
the latter in terms of the former.
NFCI, but sets the stage for some future cleanup in this area.
Revert "config_attach_pseudo/config_attach_pseudo: assert kernel lock"
it turned out that we have too many drivers which would trigger
these assertions. although my impression is that they are actually
not mpsafe, let's revert the assertions for now.
PR/60123https://gnats.netbsd.org/60123
zfs: fix deadlock with GOP_MARKUPDATE
because genfs_putpages calls GOP_MARKUPDATE with v_interlock held,
it isn't safe to wait for txg or other i/o. this is a regression
caused by a recent change.
("zfs_netbsd_gop_markupdate: actually update file timestamp")
this commit fixes it by simply dropping GOP_MARKUPDATE for zfs.
as mentioned in the commit message of the change in question,
it's redundant for putpages as we update the timestamps in
GOP_WRITE as well.
for spec/fifo, call the timestamp update logic directly,
not via GOP_MARKUPDATE.
the problem was pointed out by J. Hannken-Illjes.
he also tested this patch.
- move logic to find a device's interrupt controller out of ki2c
- make interrupt numbers in OF, dmesg and systat/vmstat match
- include interrupt controller's name when reporting