Fix fallout from
https://mail-index.netbsd.org/source-changes/2025/06/20/msg157251.html
trap() may return with interrupts disabled to avoid preemption
before the iret. But on XENPV i386 it seems that iret doesn't reenable events
(or at last doesn't in some case). To fix this,
- in i386 calltrap, move a #ifdef XENPV code reenabling interrupts so that
it is always called before returning
- in cpu_kpreempt_exit(), handle calltrap() the same way copyfunc is; that
is reload the pmap if we got preempted here (only for XENPV i386)
Pull up following revision(s) (requested by ozaki-r in ticket #1137):
sys/netinet/ip_input.c: revision 1.405
in: avoid packet looping on incoming packets destining to an initializing
address
The initialization of an IPv4 address is done by adding a connected route and
a local route (if necessary), and then publishing itself by adding it to the
global list (and the global hashtable). Thus, there can exist a route with an
address that is not published. This inconsistent state allows an incoming
packet destining to one of a host address which is not published but has a
local route to be forwarded and routed to a loopback interface. This results
in forwarding the packet back to ip_input, that is, packet looping.
To avoid the situation, prohibit packets being forwarded via a local route.
This is a workaround for "IPv4 address initialization atomicity" in
doc/TODO.smpnet.
Pull up following revision(s) (requested by ozaki-r in ticket #1136):
sys/net/route.c: revision 1.238
sys/net/route.c: revision 1.239
sys/net/if.c: revision 1.535
route: do ifa_rtrequest() before rt_addaddr()
ifa_rtrequest() could change a given rtentry in the routing table.
route: lower the priority of the workqueues
PRI_SOFTNET makes the kthread of a workqueue SCHED_RR which can monopolize
a CPU if there are many rtentries to free in rt_free_work. So lower the
prirority of the workqueues to PRI_USER which is the scheduling class for
time-sharing.
Also change rt_timer_wq as well just in case.
[6 lines not shown]
vax/boot: fix detection of CMD CQD-22x MSCP controllers
Certain models of CMD MSCP controllers fail to be detected by uda(4) if
they have been booted from. This failure mode has been introduced in
revision 1.11 of uba_mainbus.c, when scanning for Qbus/Unibus memories
was added. They are deteced fine when NetBSD is booted from any other
device such as over the network.
When NetBSD is booted from a MSCP controller, the boot loader sets up
the Qbus map to provide the controller with a small command/response
ring in memory to be used for I/O. Once the kernel is loaded and uba(4)
is attaching, the Qbus map is cleared while scanning for memories. It
appears that sudden loss of access to the command/response ring causes
the firmware of these CMD controllers to drop dead.
As a result, these controllers don't react in a reasonable time (100ms
by the spec) when their IP register is written to re-initialze the
controller. Even though uda(4)'s udamatch() waits up to 10s for a sign
of life from the controller, that's usually not enough for it to wake
[10 lines not shown]
vax/uba: fix detection of CMD CQD-22x MSCP controllers
Certain models of CMD MSCP controllers fail to be detected by uda(4) if
they have been booted from. This failure mode has been introduced in
revision 1.11 of uba_mainbus.c, when scanning for Qbus/Unibus memories
was added. They are deteced fine when NetBSD is booted from any other
device such as over the network.
When NetBSD is booted from a MSCP controller, the boot loader sets up
the Qbus map to provide the controller with a small command/response
ring in memory to be used for I/O. Once the kernel is loaded and uba(4)
is attaching, the Qbus map is cleared while scanning for memories. It
appears that sudden loss of access to the command/response ring causes
the firmware of these CMD controllers to drop dead.
As a result, these controllers don't react in a reasonable time (100ms
by the spec) when their IP register is written to re-initialze the
controller. Even though uda(4)'s udamatch() waits up to 10s for a sign
of life from the controller, that's usually not enough for it to wake
[9 lines not shown]
More prep for moving openssl from crypto/bsd to crypto/apache2
Find all the remaining places that used bsd/${EXTERNAL_OPENSSL_SUBDIR}
and (except for one, which shouldn't have been using the variable)
remove the "bsd/" prefix, which is now included in EXTERNAL_OPENSSL_SUBDIR
kern/59518: edgeroute 4 asserts every few months
Don't check for differences in the TLB entry modified status for
kernal mappings as they can be modified while the kernel pmap is
being updated.
Pull up following revision(s) (requested by mlelstv in ticket #1964):
sbin/fsck_ffs/setup.c: revision 1.110 (patch)
Don't truncate bitmap size to unsigned int, avoids crashes on filesystems
with more than 2^32 blocks.
Pull up following revision(s) (requested by mlelstv in ticket #1135):
sbin/fsck_ffs/setup.c: revision 1.110
Don't truncate bitmap size to unsigned int, avoids crashes on filesystems
with more than 2^32 blocks.
Pull up following revision(s) (requested by mlelstv in ticket #1134):
sys/kern/vfs_vnops.c: revision 1.245
Access v_rdev only for a device special file.
Pull up following revision(s) (requested by bad in ticket #1133):
sys/kern/vfs_vnops.c: revision 1.246
release fp->f_lock after reading the offset in vn_read()
Fixes an obvious lock leak introduced in r1.238 and pulled up to netbsd-10.
Fixes PR kern/59519 vn_read() leaks file* lock