1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 07:27:59 -08:00
OpenBSD
Go to file
sf 77d0f8231d virtio: Refactor attach logic
virtio 1.x requires that all queue setup, including the queue interrupt
vector, is done before setting the queue_enable register to 1. This
conflicts with how we do things right now:

* We implicitly make queue setup in virtio_alloc_vq(), which is called
  from the child driver attach functions. This also sets queue_enable=1.

* Later, we allocate the interrupts and set the queue interrupt vectors
  in the second half of the virtio transport attach functions.

This is a violation of a MUST from the standard and causes problems with
some hypervisors, in particular those that have no virtio 0.9 support,
which has no such ordering requirements.

To fix this:

* Move the interrupt allocation to a new virtio_attach_finish() function.
  This does all queue setup, including the interrupt vectors.

* Don't call virtio_setup_queue() in virtio_alloc_vq() anymore.

* We can also move the setting of the DRIVER_OK flag into this function.
  virtio_attach_finish() must be called before using any virtqueue or
  writing any virtio config register.

While there,

* also streamline the attach error handling in all drivers.

* skip initially setting sc_config_change to NULL, the softc is
  initialized to 0.

ok jan@
tested by bluhm@
2024-12-20 22:18:27 +00:00
bin use a more readable explanation of directory creation; 2024-11-30 06:59:12 +00:00
distrib sync 2024-12-19 23:57:27 +00:00
etc Make the example bgpd.conf work with 4byte ASN out of the box. 2024-12-18 16:00:26 +00:00
games Emit a warning if all fortunes in the file are too short or too long 2024-10-21 06:39:03 +00:00
gnu Install riscv_vector.h 2024-12-17 13:22:38 +00:00
include a.out is no longer the commonly encountered binary file format, the world has 2024-10-16 18:47:47 +00:00
lib If EVP_CIPHER_CTX_ctrl(3) is called on EVP_chacha20_poly1305(3) 2024-12-20 20:05:29 +00:00
libexec gettytab's dx flag is supposed to set decctlq, which is the opposite of 2024-11-09 11:22:18 +00:00
regress mlkem regress: garbage collect two global variables 2024-12-20 15:47:26 +00:00
sbin use opendev() for fsck_ext2fs, based on code adding this to fsck_ffs 2024-12-18 10:36:05 +00:00
share rewrite a sentence, add a width specifier to a list, and some "a" -> "an"; 2024-12-16 21:39:29 +00:00
sys virtio: Refactor attach logic 2024-12-20 22:18:27 +00:00
usr.bin sndiod: Switch to printf(3)-style logging 2024-12-20 07:35:56 +00:00
usr.sbin Improve cleanup process 2024-12-19 13:23:38 +00:00
.gitignore Ignore CVS directories for easier git + CVS coexistence. 2023-07-07 15:44:54 +00:00
Makefile minor cranking of libraries exposes a problem, details too long to explain. 2020-04-05 20:14:14 +00:00
Makefile.cross riscv64 is a LP64_ARCH, list it as such. 2021-05-03 00:04:31 +00:00