From patchwork Wed Oct 31 01:00:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 1675261 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D01633FD2B for ; Wed, 31 Oct 2012 01:01:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934900Ab2JaBBN (ORCPT ); Tue, 30 Oct 2012 21:01:13 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52497 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934901Ab2JaBBK (ORCPT ); Tue, 30 Oct 2012 21:01:10 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 677A1A3DDD; Wed, 31 Oct 2012 02:01:09 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= To: qemu-devel@nongnu.org Cc: anthony@codemonkey.ws, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Avi Kivity (supporter:X86), Marcelo Tosatti (supporter:X86), kvm@vger.kernel.org (open list:X86) Subject: [PATCH 35/35] target-i386: Pass X86CPU to kvm_handle_halt() Date: Wed, 31 Oct 2012 02:00:06 +0100 Message-Id: <1351645206-3041-36-git-send-email-afaerber@suse.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1351645206-3041-1-git-send-email-afaerber@suse.de> References: <1351645206-3041-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Needed for moving interrupt_request and halted fields to CPUState. Signed-off-by: Andreas Färber --- target-i386/kvm.c | 7 +++++-- 1 Datei geändert, 5 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 7da816f..9ccbcb5 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -1786,8 +1786,10 @@ int kvm_arch_process_async_events(CPUX86State *env) return env->halted; } -static int kvm_handle_halt(CPUX86State *env) +static int kvm_handle_halt(X86CPU *cpu) { + CPUX86State *env = &cpu->env; + if (!((env->interrupt_request & CPU_INTERRUPT_HARD) && (env->eflags & IF_MASK)) && !(env->interrupt_request & CPU_INTERRUPT_NMI)) { @@ -2001,13 +2003,14 @@ static bool host_supports_vmx(void) int kvm_arch_handle_exit(CPUX86State *env, struct kvm_run *run) { + X86CPU *cpu = x86_env_get_cpu(env); uint64_t code; int ret; switch (run->exit_reason) { case KVM_EXIT_HLT: DPRINTF("handle_hlt\n"); - ret = kvm_handle_halt(env); + ret = kvm_handle_halt(cpu); break; case KVM_EXIT_SET_TPR: ret = 0;