Commit Graph

302647 Commits

Author SHA1 Message Date
mrg cab2d18424 don't assign struct pointers to smaller then structure regions of memory.
in all cases here, the later parts of the structure are not actually
accessed, so there are no existing bugs here beyond general UB.  for the
ufs ones, this also removes some casts.

found by GCC 12.
2023-08-10 20:49:19 +00:00
mrg 251ecc35b2 make this build with GCC 12.
there are some odd constructs here to trigger sanitizers.
2023-08-10 20:44:37 +00:00
christos 4b00444277 add alpha 2023-08-10 20:41:49 +00:00
mrg aec4d439cd avoid various use-after-free issues.
create a ptrdiff_t offset between the start of an allocation region and
some interesting pointer, so it can be adjusted with this offset after
realloc() returns.

found by GCC 12.
2023-08-10 20:38:00 +00:00
mrg 81a719df6e avoid various use-after-free issues.
create a ptrdiff_t offset between the start of an allocation region and
some interesting pointer, so it can be adjusted with this offset after
realloc() returns.  for pdisk(), realloc() is a locally inlind malloc()
and free() pair.

for mail(1), this required a little bit more effort as the old pointer
was passed into another file for fix-ups there, and that code needed to
be adjusted for offset vs old pointer usage.

found by GCC 12.
2023-08-10 20:36:28 +00:00
andvar 23a4d41e09 fix typos in comments. 2023-08-10 20:02:55 +00:00
andvar e03f1896ab s/VAXststions/VAXstations/ in comment. 2023-08-10 19:13:52 +00:00
riastradh db465cdd96 vmxnet(4): Fix various MP bugs.
- Defer reset to workqueue.
  => vmxnet3_stop_locked is forbidden in softint.
  => XXX Problem: We still take the core lock in softint, and we
     still take the core lock around vmxnet3_stop_locked.  TBD.
- Touch if_flags only under IFNET_LOCK.
  => Cache ifp->if_flags & IFF_PROMISC in vmxnet3_ifflags_cb.
  => Don't call vmxnet3_set_rxfilter unless up and running; cache
     this as vmx_mcastactive.  Use ENETRESET in vmxnet3_ifflags_cb
     instead of calling vmxnet3_set_rxfilter directly.
     . (The cache is currently serialized by the core lock, but it
       might reasonably be serialized by an independent lock like in
       usbnet(9).)
- Fix vmxnet3_stop_rendezvous so it actually does something.
  => New vxtxq_stopping, vxrxq_stopping variables synchronize with
     Rx/Tx interrupt handlers.
- Sprinkle IFNET_LOCK and core lock assertions.
2023-08-10 08:24:44 +00:00
riastradh eb1aff76b3 trousers: Make this build again.
- Downgrade address-of-packed-member errors to warnings.  Not sure if
  this is safe, but there's too many to audit.

- Silence deprecation warnings for openssl3.

- Address removal of const qualifier in iconv.

- Nix unused definitions in a .h file, which cause trouble now that
  -fno-common is the default.
2023-08-10 06:56:12 +00:00
andvar f0dcd50e0e fix typos in comments s/iton/tion/ or s/ton/tion/. 2023-08-10 06:44:11 +00:00
andvar 702a39f5de s/Partititon/Partition/ 2023-08-10 06:38:15 +00:00
andvar 263445ea3d regen. 2023-08-10 06:23:27 +00:00
andvar bfd02c2cd4 rename PCI to PCIE for naming consistency. 2023-08-10 06:22:47 +00:00
pgoyette 910a1677fc at suggestion from phone@ (via irc/icb) make this file depend on
any version of gdb, not just gdb=1100

XXX I really don't know what I'm doing here, so if anyone has a
XXX better idea, go for it.
2023-08-10 04:55:13 +00:00
christos cb045e26b2 do aarch64eb 2023-08-09 22:14:23 +00:00
christos 972fdaff44 add new files for aarch64 2023-08-09 21:12:50 +00:00
christos a9f1a636ec make aarch64 compile (untested my box is dead) 2023-08-09 21:09:07 +00:00
christos c7cb6a1257 jump through hoops to make the native build find gmp for gdb. 2023-08-09 18:57:04 +00:00
christos 945f88fd2e put back the new gdb 2023-08-09 14:57:19 +00:00
christos c83e385422 gdb has 3 target.c{,c} now, we need the server version here, not the one
from gdb/target...
2023-08-09 14:56:41 +00:00
msaitoh 869ef20598 Regen. 2023-08-09 09:58:00 +00:00
msaitoh 8232f9d270 Simplify descriptions of Snow Ridge internal Ethernet devices. 2023-08-09 09:57:35 +00:00
andvar 2c4d487849 viadrmums(4): build legacy VIA DRM UMS driver module for amd64.
This driver is not built-in by default, thus loadable module can help (un)lucky
owners of 64-bit capable VIA (Nano/Eden) systems or early AMD/Intel systems
with some VIA chipsets, which include VIA integrated graphics.
I also boldly added product IDs for few later models from VX8xx/VX9xx chipsets
without 3D support (DX9_0) to "expand" the driver support to more systems.
Tested successfully basic functionality on VX800, and partially successfully
on VX900 (on VX900 Xorg failed to initialize due to openchrome related issues,
viadrmums attaches and it is by used the driver).
Didn't test on VX855, I don't have one.

Pull up to netbsd-10 is needed.
2023-08-09 09:36:26 +00:00
riastradh 4a1dffe289 xvif(4): Omit needless membars in xennetback_connect.
xneti is a private data structure to which we have exclusive access
here; ordering the stores doesn't make sense.
2023-08-09 08:38:57 +00:00
riastradh 42592ab857 xvif(4): Omit needless membars in xennetback_rx_copy_process.
- No need for barrier around touching req_cons and rsp_prod_pvt,
  which are private.

- RING_PUSH_RESPONSES_AND_CHECK_NOTIFY updates the shared req_prod and
  then issues xen_mb, which is all that we need between the update of
  shared req_prod and hypervisor_notify_via_evtchn.

  (Between updating the shared req_prod and issuing
  hypervisor_notify_via_evtchn, only xen_wmb is needed.  But after
  writing to the shared req_prod, RING_PUSH_REQUESTS_AND_CHECK_NOTIFY
  must also read from the shared rsp_event, which requires the
  store-before-load ordering that only xen_mb provides.)
2023-08-09 08:38:47 +00:00
riastradh bf2b9dac71 xvif(4): Simplify while loop in xennetback_evthandler.
No functional change intended.
2023-08-09 08:38:37 +00:00
riastradh 79ccf23713 xvif(4): Omit needless membars in xennetback_evthandler.
This should improve throughput without any impact on correctness.
2023-08-09 08:38:27 +00:00
riastradh a361944abb xvif(4): Move expensive xen_mb out of xennetback_evthandler loop.
Use the cheaper RING_HAS_UNCONFIRMED_REQUESTS for most of the loop.

This should improve throughput without any impact on correctness.
2023-08-09 08:38:16 +00:00
riastradh 6b262286ea xvif(4): Omit local variable aliasing xneti->xni_txring.req_cons.
No functional change intended.
2023-08-09 08:38:05 +00:00
riastradh 76b21ca69b xvif(4): Add missing xen_rmb in xennetback_evthandler. 2023-08-09 08:37:55 +00:00
riastradh 7376a1bee9 xvif(4): Comment on memory barriers in xennetback_evthandler.
Note which ones appear unnecessary and which ones appear too strong,
but don't change them.

No functional change intended.
2023-08-09 08:37:44 +00:00
riastradh e5b4f1636b workqueue(9): Factor out wq->wq_flags & WQ_FPU in workqueue_worker.
No functional change intended.  Makes it clearer that s is
initialized when used.
2023-08-09 08:24:18 +00:00
riastradh 9b18147164 workqueue(9): Sort includes.
No functional change intended.
2023-08-09 08:24:08 +00:00
riastradh 0d01e7b05c workqueue(9): Avoid unnecessary mutex_exit/enter cycle each loop. 2023-08-09 08:23:45 +00:00
riastradh 6ce73099f6 workqueue(9): Stop violating queue(3) internals. 2023-08-09 08:23:35 +00:00
riastradh 23d0d09807 workqueue(9): Sprinkle dtrace probes for workqueue_wait edge cases.
Let's make it easy to find out whether these are hit.
2023-08-09 08:23:25 +00:00
riastradh 53a88a4133 workqueue(9): Avoid touching running work items in workqueue_wait.
As soon as the workqueue function has called, it is forbidden to
touch the struct work passed to it -- the function might free or
reuse the data structure it is embedded in.

So workqueue_wait is forbidden to search the queue for the batch of
running work items.  Instead, use a generation number which is odd
while the thread is processing a batch of work and even when not.

There's still a small optimization available with the struct work
pointer to wait for: if we find the work item in one of the per-CPU
_pending_ queues, then after we wait for a batch of work to complete
on that CPU, we don't need to wait for work on any other CPUs.

PR kern/57574

XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-09 08:23:13 +00:00
riastradh f8e8b7bf19 workqueue(9) tests: Add test for PR kern/57574.
XXX pullup-10
XXX pullup-9
XXX pullup-8
2023-08-09 08:23:02 +00:00
riastradh aab7c67520 workqueue(9) tests: Destroy struct work immediately on entry. 2023-08-09 08:22:53 +00:00
riastradh a8809f1847 workqueue(9) tests: Nix trailing whitespace. 2023-08-09 08:22:43 +00:00
riastradh c6ab813da9 tests/rump/rumpkern: Use PROGDPLIBS, not explicit -L/-l.
This way we relink the t_* test programs whenever changes under
tests/rump/kernspace change libkernspace.a.
2023-08-09 08:22:33 +00:00
riastradh b9fb9ab6db sqlite3/lib/Makefile: -Wno-error=restrict is a gccism.
Let's try to get at least one working clang autobuild this summer,
shall we?
2023-08-09 07:37:23 +00:00
riastradh 33ce193df2 libc/resolv/res_debug.c: Minor whitespace fixes. 2023-08-09 07:01:09 +00:00
msaitoh be6eb55b0e Regen. 2023-08-09 03:15:47 +00:00
msaitoh 23cf67dc7a Add some Intel Xeon D-2100 devices. Fix description of Intel 0x37d0. 2023-08-09 03:14:53 +00:00
rillig 7e8e260d9f lint: in -a mode, do not warn about integer conversions from 'int'
Since tree.c 1.552 from 2023-07-08, lint warned about integer
conversions from 'int' or 'unsigned int' to smaller integer types.  This
only affected 32-bit platforms where size_t is 'unsigned int' rather
than 'unsigned long', as on these platforms, the integer ranks of 'int'
and 'long' are the same, see INT_RANK in inittyp.c.

Discovered by lib/libkvm, which fails on i386 when lint generates any
warnings.
2023-08-08 20:15:10 +00:00
rillig 53d7accc5b tests/lint: test integer conversions on ilp32 int platforms 2023-08-08 19:57:23 +00:00
nat 5bacd30de6 Avoid adding another member to the softc and use sc_flags instead.
NFCI.
2023-08-08 17:31:13 +00:00
nat 815776a21a Add a flag for output only devices and attachments.
It is necessary to skip the test for the device as output only attached
devices lack the ability for the device to be probed - such as the 1602 lcd
module.
2023-08-08 16:32:39 +00:00
nat 6ce62856d0 Add a detach function. 2023-08-08 16:29:00 +00:00