tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

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



> Date: Wed, 05 Feb 2025 18:40:05 +1100
> From: Simon Burge <simonb%NetBSD.org@localhost>
> 
> +               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.


Home | Main Index | Thread Index | Old Index