Re: KVM crash on unusual PM->RM transition

Avi Kivity
2009-04-14T08:13:36Z

> H. Peter Anvin wrote:
>
>> The current test branch of Syslinux does PM->RM transition via a stub
>> which can be located in high memory. This is correct and valid (x86
>> CPUs rely on this to boot): after clearing CR0.PE, CS.base retains its
>> previous value until CS is reloaded by a far JMP (which in this case is
>> the very next instruction).
>>
>
> Some trivial research later...
>
> It looks like KVM will simply crash when it runs into a real-mode state
> it can't approximate with V86 mode. I guess I had the failed notion
> that it would kick back such "impossible" states to Qemu.
>

Exactly. There's the emulate_invalid_guest_state module parameter which
tells kvm to emulate during such state instead. But this will often
break as programs leave fs and gs in non-v86-mode compliant, requiring
more of the emulator than it currently provides.

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.