diff options
-rw-r--r-- | arch/x86/kvm/emulate.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index d4cc8af67d95..191bc9be4946 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -672,11 +672,11 @@ static int do_insn_fetch_byte(struct x86_emulate_ctxt *ctxt, u8 *dest) | |||
672 | size = min(15UL - cur_size, | 672 | size = min(15UL - cur_size, |
673 | PAGE_SIZE - offset_in_page(ctxt->_eip)); | 673 | PAGE_SIZE - offset_in_page(ctxt->_eip)); |
674 | rc = __linearize(ctxt, addr, size, false, true, &linear); | 674 | rc = __linearize(ctxt, addr, size, false, true, &linear); |
675 | if (rc != X86EMUL_CONTINUE) | 675 | if (unlikely(rc != X86EMUL_CONTINUE)) |
676 | return rc; | 676 | return rc; |
677 | rc = ctxt->ops->fetch(ctxt, linear, fc->data + cur_size, | 677 | rc = ctxt->ops->fetch(ctxt, linear, fc->data + cur_size, |
678 | size, &ctxt->exception); | 678 | size, &ctxt->exception); |
679 | if (rc != X86EMUL_CONTINUE) | 679 | if (unlikely(rc != X86EMUL_CONTINUE)) |
680 | return rc; | 680 | return rc; |
681 | fc->end += size; | 681 | fc->end += size; |
682 | } | 682 | } |
@@ -691,7 +691,7 @@ static int do_insn_fetch(struct x86_emulate_ctxt *ctxt, | |||
691 | int rc; | 691 | int rc; |
692 | 692 | ||
693 | /* x86 instructions are limited to 15 bytes. */ | 693 | /* x86 instructions are limited to 15 bytes. */ |
694 | if (ctxt->_eip + size - ctxt->eip > 15) | 694 | if (unlikely(ctxt->_eip + size - ctxt->eip > 15)) |
695 | return X86EMUL_UNHANDLEABLE; | 695 | return X86EMUL_UNHANDLEABLE; |
696 | while (size--) { | 696 | while (size--) { |
697 | rc = do_insn_fetch_byte(ctxt, dest++); | 697 | rc = do_insn_fetch_byte(ctxt, dest++); |