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

From: H. Peter Anvin
Date: Thu Apr 10 2014 - 22:29:20 EST


On 04/10/2014 06:19 AM, Romer, Benjamin M wrote:
>
> I'm confused by the intended behavior of KVM.. Is the intention of the
> -cpu switch to fully emulate a particular CPU? If that's the case, the
> Intel documentation says bit 31 should always be 0, so the value
> returned by the cpuid instruction isn't correct. If the intention is to
> present a VM with a specific CPU architecture, the CPU ought to behave
> as described in Intel's virtualization documentation and just vmexit
> instead of faulting with invalid op, IMHO.
>
> I've already said the check in the code was insufficient, and I'm trying
> to fix that part now. :)
>

I'm still confused where KVM comes into the picture. Are you actually
using KVM (and thus talking about nested virtualization) or are you
using Qemu in JIT mode and running another hypervisor underneath?

The hypervisor bit is a complete red herring. If the guest CPU is
running in VT-x mode, then VMCALL should VMEXIT inside the guest
(invoking the guest root VT-x), but the fact still remains that you
should never, ever, invoke VMCALL unless you know what hypervisor you
have underneath.

-hpa

--
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/