svn commit: r345696 - head/lib/libvgl

Konstantin Belousov kostikbel at gmail.com
Tue Sep 3 14:06:18 UTC 2019


On Mon, Apr 01, 2019 at 12:04:45AM +1100, Bruce Evans wrote:
> Serial consoles are not always available.
> 
> Better debuggers switch the screen mode as necessary.
> 
> I recently noticed another mode switching problem.  On i386, cycling
> through about 50 modes to test them all takes a small fraction of a
> second for each mode switch (done directly in syscons or by a vm86
> BIOS call) even when the monitor takes too long to resync (the monitor
> resyncs are coalesced, so 50 resyncs take about 5 seconds instead of
> 250).  But on amd64, mode switches to VESA mode and back take about
> 20 seconds.  They are not coalesced, and most of the system is stopped
> waiting for them (at least remote network access is stopped).  amd64
> can't use vm86, so it emulates BIOS calls.  Why does the emulation stop
> the rest of the system and take so long?

How many CPUs do you have ?

x86bios.c x86bios_call() does spinlock_enter() around emulator calls.
This disables interrupts.

If you have only one CPU, the consequences are obvious. If you have
more than one, then perhaps next IPI targeted to this CPU blocks the
originator, if IPI requires ack, which typically true for most common
TLB shutdown IPIs. Then both this CPU and originator block any other CPU
trying to send an IPI.

For this reason I have to come through several hoops to not disable
interrupts for duration of EFI runtime calls, otherwise spinlocks die
due to 'spin lock held too long' on other CPUs.




More information about the svn-src-all mailing list