diff options
author | Gleb Natapov <gleb@redhat.com> | 2010-03-18 09:20:10 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:16:05 -0400 |
commit | 6aebfa6ea75f9a02a0339e733090dd40d6f2edfd (patch) | |
tree | f8f1fb2c520199a50f973c4ad36716ddc186f423 /arch/x86/kvm | |
parent | ab8557b2b361c8bb2e2421c791c8f6c4f6ba3d08 (diff) |
KVM: x86 emulator: inject #UD on access to non-existing CR
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/emulate.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index fa4604e03250..836e97ba45da 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2520,6 +2520,13 @@ twobyte_insn: | |||
2520 | c->dst.type = OP_NONE; | 2520 | c->dst.type = OP_NONE; |
2521 | break; | 2521 | break; |
2522 | case 0x20: /* mov cr, reg */ | 2522 | case 0x20: /* mov cr, reg */ |
2523 | switch (c->modrm_reg) { | ||
2524 | case 1: | ||
2525 | case 5 ... 7: | ||
2526 | case 9 ... 15: | ||
2527 | kvm_queue_exception(ctxt->vcpu, UD_VECTOR); | ||
2528 | goto done; | ||
2529 | } | ||
2523 | c->regs[c->modrm_rm] = ops->get_cr(c->modrm_reg, ctxt->vcpu); | 2530 | c->regs[c->modrm_rm] = ops->get_cr(c->modrm_reg, ctxt->vcpu); |
2524 | c->dst.type = OP_NONE; /* no writeback */ | 2531 | c->dst.type = OP_NONE; /* no writeback */ |
2525 | break; | 2532 | break; |