Commit 386b9fb
vga: defer V86-mode VBE disable until a legacy mode-set is observed
When a Win9x windowed DOS VM calls INT 10h, vgabios runs in V86 mode and
its mode-set begins by writing dispi[4]=0. The Win9x VDD virtualises the
standard VGA ports (3B0-3DF) for windowed VMs but passes 1CE/1CF straight
through, so the VBE disable reaches the hardware while the rest of the
mode-set (CRTC/seq/gfx/attribute writes) is captured into the VM's
virtual register file. v86 then drops out of LFB rendering with the
legacy registers still holding the SVGA values, and the screen shows
planar garbage until the user manages to Alt+Enter back.
Defer clearing svga_enabled when dispi[4] is cleared from V86 mode
(EFLAGS.VM set); commit it only when an attribute_mode write actually
reaches us. A real passthrough mode-set (fullscreen DOS, display-driver
mode change, X.org int10) writes attribute_mode immediately afterwards,
so the disable lands one register later. The windowed-VM leak never
follows up, so the LFB stays live and the desktop keeps rendering with
the DOS box in its window.
The enable path now also reapplies set_size_graphical whenever dispi[4]
is written with bit 0 set, so a deferred-disable -> reconfigure -> enable
sequence still resizes (set_size_graphical is a no-op when nothing
changed). dispi_enable_value is updated either way, so guest read-back
is unchanged.
Ring-0 / real-mode dispi writes (Linux bochs_drm, vesafb, bare DOS) have
EFLAGS.VM clear and are unaffected.1 parent 02e4588 commit 386b9fb
1 file changed
Lines changed: 25 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1418 | 1418 | | |
1419 | 1419 | | |
1420 | 1420 | | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
1421 | 1428 | | |
1422 | 1429 | | |
1423 | 1430 | | |
| |||
2165 | 2172 | | |
2166 | 2173 | | |
2167 | 2174 | | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
2168 | 2186 | | |
2169 | 2187 | | |
2170 | 2188 | | |
| |||
2221 | 2239 | | |
2222 | 2240 | | |
2223 | 2241 | | |
2224 | | - | |
| 2242 | + | |
2225 | 2243 | | |
2226 | | - | |
2227 | | - | |
2228 | | - | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
2229 | 2250 | | |
2230 | 2251 | | |
2231 | 2252 | | |
| |||
0 commit comments