On 03/09/2010 04:33 PM, Gleb Natapov wrote:
On Tue, Mar 09, 2010 at 04:27:39PM +0200, Avi Kivity wrote:
On 03/09/2010 04:09 PM, Gleb Natapov wrote:
It is undefined and should generate #UD.
Signed-off-by: Gleb Natapov<gleb@xxxxxxxxxx>
---
arch/x86/kvm/emulate.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 2df510b..1a32b78 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2486,6 +2486,9 @@ twobyte_insn:
(c->src.val& 0x0f), ctxt->vcpu);
c->dst.type = OP_NONE;
break;
+ case 5: /* not defined */
+ kvm_queue_exception(ctxt->vcpu, UD_VECTOR);
+ goto done;
case 7: /* invlpg*/
emulate_invlpg(ctxt->vcpu, memop);
/* Disable writeback. */
Why is this needed? We can only get here if the guest tricks us
(otherwise the #UD would go back to the guest, or rather, we'd trap
it to see if it's a hypercall instruction, but not pass it on to the
emulator).
For completes. A lot of code we added recently is there only because guest
can trick us to enter emulator. Unfortunately we have to take suck tricks
into account. Without this patch if emulator gets here it will report failed
emulation.
Okay.
--
error compiling committee.c: too many arguments to function
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html