Re: [visorchipset] invalid opcode: 0000 [#1] PREEMPT SMP

From: Paolo Bonzini
Date: Wed Apr 30 2014 - 06:03:03 EST


Il 11/04/2014 19:40, H. Peter Anvin ha scritto:
On 04/11/2014 10:35 AM, Jet Chen wrote:

As Peter said, QEMU probably should *not* set the hypervisor bit. But based on my testing, I think KVM works properly in this case.


Either way, unless there is a CPUID interface exposed in CPUID levels
0x40000000+, then relying on the hypervisor bit to do VMCALL is wrong in
the extreme.

Sorry for the delay guys, I was on vacation.

Lack of a CPUID interface at 0x40000000 is indeed *the* good reason why QEMU should not set the hypervisor bit. Of course that there is no guarantee that QEMU will never expose a 0x40000000 interface, and at that point the hypervisor bit may reappear in QEMU's JIT mode.

As to sending #UD to the guest at CPL>0, that is a choice of the hypervisor. Hyper-V (and KVM in Hyper-V emulation mode) does that, and does the same in real mode too. KVM instead sets EAX to -KVM_EPERM, and accepts hypercalls in real mode (where CPL=0). Terminating the guest is surely the wrong thing to do at CPL>0.

Thanks,

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/