09.09.2020 22:17, Sean Christopherson пишет:
On Wed, Sep 09, 2020 at 09:37:08PM +0300, stsp wrote:
A bit of update.
09.09.2020 21:04, stsp пишет:
As for the original problem: there are at least
2 problems.
On OLD intel:
- KVM fails with invalid guest state unless
you set VMXE in guest's cr4, and do it from
the very first attempt!
This happens only on nested execution!
Under qemu/kvm.
Ah, that makes a lot more sense. So is QEMU+KVM your L0, and dosemu2 is
L1, and the DOS guest is L2? And assuming that's the case, you observe
the weird behavior in L1, i.e. when doing KVM_SET_SREGS from dosemu2?
Argh, not that simple! :)
Only one of the problems, namely,
"invalid guest state" w/o VMXE, is
specific to the nested exec. And
also to an OLD Intel CPU.
All other problems I described, are
reproducible anywhere: on any CPU
(including AMD FX CPU), and w/o any
nesting.
So there are really 2 or 3 very
different problems here, really.
The problems below are generic:
- VMXE kills VME in CR4 on any CPU
- VMXE can only be set on the very
first call to KVM_SET_SREGS on any CPU.
The problem below is nested+Intel-specific:
- invalid guest state if L2 has no VMXE.