From: Avi Kivity <[email protected]>

If an instruction is present in the decode tables but not in the execution
switch, it will be emulated as a NOP.  An example is IRET (0xcf).

Fix by adding default: labels to the execution switches.

Signed-off-by: Avi Kivity <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>

diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index b38bd8b..a12512d 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -3029,6 +3029,8 @@ special_insn:
                if (c->modrm_reg == 5)
                        goto jump_far;
                goto grp45;
+       default:
+               goto cannot_emulate;
        }
 
 writeback:
@@ -3354,6 +3356,8 @@ twobyte_insn:
                if (rc != X86EMUL_CONTINUE)
                        goto done;
                break;
+       default:
+               goto cannot_emulate;
        }
        goto writeback;
 
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to