Re: Protected mode transitions and big real mode... still an issue

Anthony Liguori
2008-04-29T16:41:43Z

Guillaume Thouvenin wrote:
> Hello,
>
> This patch should solve the problem observed during protected mode
> transitions that appears for example during the installation of
> openSuse-10.3. Unfortunately there is an issue that crashes
> kvm-userspace. I'm not sure if it's a problem introduced by the
> patch or if the patch is good and raises a new issue.
>

You still aren't emulating the instructions correctly I think. Running
your patch, I see:

[ 979.755349] Failed vm entry (exit reason 0x21) invalid guest state
[ 979.755354] emulation at (46e4b) rip 6e0b: ea 10 6e 18
[ 979.755358] successfully emulated instruction
[ 979.756105] Failed vm entry (exit reason 0x21) invalid guest state
[ 979.756109] emulation at (46e50) rip 6e10: 66 b8 20 00
[ 979.756111] successfully emulated instruction
[ 979.756749] Failed vm entry (exit reason 0x21) invalid guest state
[ 979.756752] emulation at (46e54) rip 6e14: 8e d8 8c d0
[ 979.756755] successfully emulated instruction
[ 979.757427] Failed vm entry (exit reason 0x21) invalid guest state
[ 979.757430] emulation at (46e56) rip 6e16: 8c d0 81 e4
[ 979.757433] successfully emulated instruction
[ 979.758074] Failed vm entry (exit reason 0x21) invalid guest state
[ 979.758077] emulation at (46e58) rip 6e18: 81 e4 ff ff

The corresponding gfxboot code is:

16301 00006E0B EA[106E]1800 jmp
pm_seg.prog_c32:switch_to_pm_20
16302 switch_to_pm_20:
16303
16304 bits 32
16305
16306 00006E10 66B82000 mov ax,pm_seg.prog_d16
16307 00006E14 8ED8 mov ds,ax
16308
16309 00006E16 8CD0 mov eax,ss
16310 00006E18 81E4FFFF0000 and esp,0ffffh

The VT state should be correct after executing instruction an RIP 6E16
(mov eax, ss). The next instruction should not cause a vmentry
failure. The fact that it is for you indicates that you're not updating
guest state correctly.

My guess would be that load_segment_descriptor is not updating the
values within the VMCS.

Regards,

Anthony Liguori