amd64, i386: use delay_init() instead of writing delay_func by hand
authorcheloha <cheloha@openbsd.org>
Thu, 25 Aug 2022 17:38:16 +0000 (17:38 +0000)
committercheloha <cheloha@openbsd.org>
Thu, 25 Aug 2022 17:38:16 +0000 (17:38 +0000)
commitda893f172441e856e26b2082d78d08217a8ba3e5
treedc8dcb99e6ccde0890a9cb6e712f9a278e5a6ca4
parentd61b9ff10a459d5f50454a30c8359ecb3519ad5b
amd64, i386: use delay_init() instead of writing delay_func by hand

Now that we have delay_init(), use it in all the places where we
currently set delay_func by hand.

lapic_delay() is great: 3000.  hv_delay() is needed before we set up
lapic_delay() on Hyper-V guests: 4000.  tsc_delay() is better than
lapic_delay() and (probably?) hv_delay(): 5000.

We may bump hv_delay's quality value up over that of tsc_delay() in a
future patch.  It's a little ambiguous whether hv_delay() causes a VM
exit.

Idea and patch from jsg@.  With tons of input, research and advice
from jsg@.

Link: https://marc.info/?l=openbsd-tech&m=166053729104923&w=2
ok mlarkin@ jsg@
sys/arch/amd64/amd64/lapic.c
sys/arch/amd64/amd64/tsc.c
sys/arch/i386/i386/lapic.c
sys/dev/pv/pvbus.c