Re: patch review: avoid com delay() in VMs

Taylor R Campbell <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
> Date: Wed, 05 Feb 2025 18:40:05 +1100
> From: Simon Burge <[email protected]>
> 
> +               if (!inside_vm_guest()) {
> +                       /*
> +                        * Wait for output to finish.  No need for
> +                        * a delay on virtual machines.
> +                        */
> +                       delay(10000);
> +               }
> +
>                 /* Make sure the console is always "hardwired". */
> -               delay(10000);                   /* wait for output to finish */

There is a low-probability potential issue with this approach to the
conditional: you could use, say, PCI passthrough to expose a physical
puc(4) device which might require the delay, even though it is running
inside a VM guest.

That case might not matter now, but the thought of it suggests that
perhaps, rather than a systemwide inside_vm_guest() function, this
could be passed through a com_softc parameter by whoever calls
com_attach_subr.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.