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.
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.
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.
- 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.
- 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.
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.
- 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.)
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
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.
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.