From patchwork Tue Dec 20 17:43:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9481929 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CFC8B606DB for ; Tue, 20 Dec 2016 17:44:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7469283E0 for ; Tue, 20 Dec 2016 17:44:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBE2A283E8; Tue, 20 Dec 2016 17:44:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 67473283E0 for ; Tue, 20 Dec 2016 17:44:07 +0000 (UTC) Received: from localhost ([::1]:52614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJOSM-0001PC-CH for patchwork-qemu-devel@patchwork.kernel.org; Tue, 20 Dec 2016 12:44:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJORs-0001Nl-47 for qemu-devel@nongnu.org; Tue, 20 Dec 2016 12:43:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJORr-0008SE-78 for qemu-devel@nongnu.org; Tue, 20 Dec 2016 12:43:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34956) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJORq-0008Ro-VU for qemu-devel@nongnu.org; Tue, 20 Dec 2016 12:43:35 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 190FF4E34D; Tue, 20 Dec 2016 17:43:34 +0000 (UTC) Received: from localhost (ovpn-116-19.gru2.redhat.com [10.97.116.19]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBKHhWBL006381; Tue, 20 Dec 2016 12:43:33 -0500 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Tue, 20 Dec 2016 15:43:09 -0200 Message-Id: <1482255793-19057-4-git-send-email-ehabkost@redhat.com> In-Reply-To: <1482255793-19057-1-git-send-email-ehabkost@redhat.com> References: <1482255793-19057-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 20 Dec 2016 17:43:34 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC 3/7] kvm: Move some kvm-stub.c code to stubs/kvm.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Christoffer Dall , kvm@vger.kernel.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Move the kvm-stub.c code that doesn't depend on cpu.h or CONFIG_* defines to stubs/kvm.c. Notes about copyright, licensing, and authorship: * There was no copyright not on the original stubs/kvm.c file. * As include/sysemu/kvm.h and kvm-all.c are licensed as GPLv2+, I am assuming stubs/kvm.c file is also licensed as GPLv2+. * I have copied the copyright info from kvm-stub.c and added the original author of stubs/kvm.c (Christoffer Dall) to the author list. Cc: Paolo Bonzini Cc: kvm@vger.kernel.org Cc: Christoffer Dall Signed-off-by: Eduardo Habkost Reviewed-by: David Hildenbrand --- kvm-stub.c | 51 ------------------------------------------------ stubs/kvm.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 51 deletions(-) diff --git a/kvm-stub.c b/kvm-stub.c index b1b6b96..7ba697b 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -19,61 +19,10 @@ #include "hw/pci/msi.h" #endif -KVMState *kvm_state; -bool kvm_kernel_irqchip; -bool kvm_async_interrupts_allowed; -bool kvm_eventfds_allowed; -bool kvm_irqfds_allowed; -bool kvm_resamplefds_allowed; -bool kvm_msi_via_irqfd_allowed; -bool kvm_gsi_routing_allowed; -bool kvm_gsi_direct_mapping; -bool kvm_allowed; -bool kvm_readonly_mem_allowed; -bool kvm_ioeventfd_any_length_allowed; -bool kvm_msi_use_devid; - -int kvm_destroy_vcpu(CPUState *cpu) -{ - return -ENOSYS; -} - -int kvm_init_vcpu(CPUState *cpu) -{ - return -ENOSYS; -} - void kvm_flush_coalesced_mmio_buffer(void) { } -void kvm_cpu_synchronize_state(CPUState *cpu) -{ -} - -void kvm_cpu_synchronize_post_reset(CPUState *cpu) -{ -} - -void kvm_cpu_synchronize_post_init(CPUState *cpu) -{ -} - -int kvm_cpu_exec(CPUState *cpu) -{ - abort(); -} - -int kvm_has_sync_mmu(void) -{ - return 0; -} - -int kvm_has_many_ioeventfds(void) -{ - return 0; -} - int kvm_update_guest_debug(CPUState *cpu, unsigned long reinject_trap) { return -ENOSYS; diff --git a/stubs/kvm.c b/stubs/kvm.c index ddd6204..9d491c1 100644 --- a/stubs/kvm.c +++ b/stubs/kvm.c @@ -1,7 +1,72 @@ +/* + * QEMU KVM stub + * + * Copyright Red Hat, Inc. 2010 + * + * Authors: + * Christoffer Dall + * Paolo Bonzini + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + #include "qemu/osdep.h" #include "qemu-common.h" #include "sysemu/kvm.h" +KVMState *kvm_state; +bool kvm_kernel_irqchip; +bool kvm_async_interrupts_allowed; +bool kvm_eventfds_allowed; +bool kvm_irqfds_allowed; +bool kvm_resamplefds_allowed; +bool kvm_msi_via_irqfd_allowed; +bool kvm_gsi_routing_allowed; +bool kvm_gsi_direct_mapping; +bool kvm_allowed; +bool kvm_readonly_mem_allowed; +bool kvm_ioeventfd_any_length_allowed; +bool kvm_msi_use_devid; + +int kvm_destroy_vcpu(CPUState *cpu) +{ + return -ENOSYS; +} + +int kvm_init_vcpu(CPUState *cpu) +{ + return -ENOSYS; +} + +void kvm_cpu_synchronize_state(CPUState *cpu) +{ +} + +void kvm_cpu_synchronize_post_reset(CPUState *cpu) +{ +} + +void kvm_cpu_synchronize_post_init(CPUState *cpu) +{ +} + +int kvm_cpu_exec(CPUState *cpu) +{ + abort(); +} + +int kvm_has_sync_mmu(void) +{ + return 0; +} + +int kvm_has_many_ioeventfds(void) +{ + return 0; +} + int kvm_arch_irqchip_create(MachineState *ms, KVMState *s) { return 0;