From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLl5-0006gV-JW for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLl4-0001u2-MF for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:43 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:34421) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLl4-0001te-FB for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:42 -0400 Received: by mail-wr0-x241.google.com with SMTP id k67so46853034wrc.1 for ; Tue, 04 Jul 2017 04:12:42 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 4 Jul 2017 13:12:03 +0200 Message-Id: <1499166735-39360-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 10/22] vapic: use tcg_enabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: rth@twiddle.net, thuth@redhat.com, anthony.xu@intel.com, berrange@redhat.com, a.rigo@virtualopensystems.com, yang.zhong@intel.com Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- hw/i386/kvmvapic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 82a4955..0d9ef77 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -410,7 +410,8 @@ static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip) handlers = &s->rom_state.mp; } - if (!kvm_enabled()) { + if (tcg_enabled()) { + cpu_restore_state(cs, cs->mem_io_pc); cpu_get_tb_cpu_state(env, ¤t_pc, ¤t_cs_base, ¤t_flags); /* Account this instruction, because we will exit the tb. @@ -456,7 +457,7 @@ static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip) resume_all_vcpus(); - if (!kvm_enabled()) { + if (tcg_enabled()) { /* Both tb_lock and iothread_mutex will be reset when * longjmps back into the cpu_exec loop. */ tb_lock(); -- 1.8.3.1