From 5cfc7e0f5e5e1adf998df94f8e36edaf5d30d38e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 6 May 2014 13:05:25 +0200 Subject: [PATCH] KVM: emulate: avoid repeated calls to do_insn_fetch_bytes do_insn_fetch_bytes will only be called once in a given insn_fetch and insn_fetch_arr, because in fact it will only be called at most twice for any instruction and the first call is explicit in x86_decode_insn. This observation lets us hoist the call out of the memory copying loop. It does not buy performance, because most fetches are one byte long anyway, but it prepares for the next patch. The overflow check is tricky, but correct. Because do_insn_fetch_bytes has already been called once, we know that fc->end is at least 15. So it is okay to subtract the number of bytes we want to read. Signed-off-by: Paolo Bonzini --- Reading git-format-patch failed