From patchwork Fri Jul 20 19:14:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 10157 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 6C98B2402A for ; Fri, 20 Jul 2012 19:14:20 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id 03E05A18521 for ; Fri, 20 Jul 2012 19:14:19 +0000 (UTC) Received: by ghbz12 with SMTP id z12so4666843ghb.11 for ; Fri, 20 Jul 2012 12:14:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=eOBrzf955Z6ia23ZoaLGL4QX9kXn3c52/SHJqO13A5c=; b=htL2buWpewlgF95YtuRtXB5gcjdzg+rsdjUXcdFCvMoa4UUTp15EzxjHbyIDyvxRm6 VagBBznQk6ouPKjULA3jg8UmeYyeAcjm7Kifla5m2p3iyzx6OxldCuG4hexHzLrHHGUJ ZFyX0ix+JIXxTXTdFBexVFu29SodvbpjrWHG2dintf7XUXqQP8VUsy4CIwsmxtKfJhZD 1MAv1w7amgoYSW/ZSCVwrMRWPrX+QmHeS3wC9mTT6dUBfbJriNiMwEJ/6T8QFRKjgewE 8Fh7LH0JsRp+TFSFqmHonsjEPtWHmDMfenAgxFjmNBW1mgcPuG4PIvNpVizpMmYBKKUE l9aQ== Received: by 10.43.106.1 with SMTP id ds1mr4275149icc.24.1342811658856; Fri, 20 Jul 2012 12:14:18 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.153.7 with SMTP id i7csp31997ibw; Fri, 20 Jul 2012 12:14:17 -0700 (PDT) Received: by 10.180.78.2 with SMTP id x2mr17011594wiw.10.1342811656896; Fri, 20 Jul 2012 12:14:16 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id eo7si13503621wib.11.2012.07.20.12.14.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 20 Jul 2012 12:14:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1SsIeS-0004PW-Nk; Fri, 20 Jul 2012 20:14:12 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Jan Kiszka , Avi Kivity , Marcelo Tosatti Subject: [PATCH] kvm: Move kvm_allows_irq0_override() to target-i386 Date: Fri, 20 Jul 2012 20:14:12 +0100 Message-Id: <1342811652-16931-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQmvZ4RecksnFCTdmkWCFhI/T000bYM++vZo+NDLed0doufB++JRbQwdMAmdCtv83PoUXe0K kvm_allows_irq0_override() is a totally x86 specific concept: move it to the target-specific source file where it belongs. This means we need a new header file for the prototype: kvm_i386.h, in line with the existing kvm_ppc.h. Signed-off-by: Peter Maydell --- I'm sure this isn't the only x86ism in the KVM generic source files. However the thing I'm specifically trying to do is nuke all the uses of kvm_irqchip_in_kernel() in common code, as part of trying to untangle "what irqchip model do you want" from other aspects of the interrupt handling model. Other than this one, there are uses in cpus.c and hw/virtio-pci.c, but I haven't figured out yet exactly what those bits of code are trying to do... hw/pc.c | 1 + kvm-all.c | 5 ----- kvm.h | 2 -- target-i386/kvm.c | 6 ++++++ target-i386/kvm_i386.h | 16 ++++++++++++++++ 5 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 target-i386/kvm_i386.h diff --git a/hw/pc.c b/hw/pc.c index 598267a..4953376 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -42,6 +42,7 @@ #include "sysbus.h" #include "sysemu.h" #include "kvm.h" +#include "kvm_i386.h" #include "xen.h" #include "blockdev.h" #include "hw/block-common.h" diff --git a/kvm-all.c b/kvm-all.c index 2148b20..65f1160 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1667,11 +1667,6 @@ int kvm_has_gsi_routing(void) #endif } -int kvm_allows_irq0_override(void) -{ - return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing(); -} - void *kvm_vmalloc(ram_addr_t size) { #ifdef TARGET_S390X diff --git a/kvm.h b/kvm.h index 2617dd5..c46132f 100644 --- a/kvm.h +++ b/kvm.h @@ -62,8 +62,6 @@ int kvm_has_pit_state2(void); int kvm_has_many_ioeventfds(void); int kvm_has_gsi_routing(void); -int kvm_allows_irq0_override(void); - #ifdef NEED_CPU_H int kvm_init_vcpu(CPUArchState *env); diff --git a/target-i386/kvm.c b/target-i386/kvm.c index e53c2f6..503abeb 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -23,6 +23,7 @@ #include "qemu-common.h" #include "sysemu.h" #include "kvm.h" +#include "kvm_i386.h" #include "cpu.h" #include "gdbstub.h" #include "host-utils.h" @@ -65,6 +66,11 @@ static bool has_msr_async_pf_en; static bool has_msr_misc_enable; static int lm_capable_kernel; +int kvm_allows_irq0_override(void) +{ + return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing(); +} + static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max) { struct kvm_cpuid2 *cpuid; diff --git a/target-i386/kvm_i386.h b/target-i386/kvm_i386.h new file mode 100644 index 0000000..87031c0 --- /dev/null +++ b/target-i386/kvm_i386.h @@ -0,0 +1,16 @@ +/* + * QEMU KVM support -- x86 specific functions. + * + * Copyright (c) 2012 Linaro Limited + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#ifndef QEMU_KVM_I386_H +#define QEMU_KVM_I386_H + +int kvm_allows_irq0_override(void); + +#endif