From patchwork Tue Mar 9 00:47:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 84195 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o290o4ar020711 for ; Tue, 9 Mar 2010 00:50:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756258Ab0CIAtf (ORCPT ); Mon, 8 Mar 2010 19:49:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:64519 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756255Ab0CIAtd (ORCPT ); Mon, 8 Mar 2010 19:49:33 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o290nWCx023329 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Mar 2010 19:49:32 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o290nWuf030871; Mon, 8 Mar 2010 19:49:32 -0500 Received: from amt.cnet (vpn-9-132.rdu.redhat.com [10.11.9.132]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o290nVO1000995; Mon, 8 Mar 2010 19:49:31 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 4FF1268A7D6; Mon, 8 Mar 2010 21:48:40 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o290mdI3019705; Mon, 8 Mar 2010 21:48:39 -0300 Message-Id: <20100309004834.598287175@redhat.com> User-Agent: quilt/0.47-1 Date: Mon, 08 Mar 2010 21:47:06 -0300 From: Marcelo Tosatti To: kvm@vger.kernel.org Cc: Marcelo Tosatti Subject: [patch 2/7] kvm-tpr-opt: use device_init References: <20100309004704.049355766@redhat.com> Content-Disposition: inline; filename=kvm-tpr-device-init X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 09 Mar 2010 00:50:04 +0000 (UTC) Index: qemu-kvm-tpr/kvm-tpr-opt.c =================================================================== --- qemu-kvm-tpr.orig/kvm-tpr-opt.c +++ qemu-kvm-tpr/kvm-tpr-opt.c @@ -401,10 +401,12 @@ static void vtpr_ioport_write(void *opaq kvm_tpr_enable_vapic(env); } -void kvm_tpr_opt_setup(void) +static void kvm_tpr_opt_setup(void) { register_savevm("kvm-tpr-opt", 0, 1, tpr_save, tpr_load, NULL); register_ioport_write(0x7e, 1, 1, vtpr_ioport_write, NULL); register_ioport_write(0x7e, 2, 2, vtpr_ioport_write16, NULL); } +device_init(kvm_tpr_opt_setup); + Index: qemu-kvm-tpr/qemu-kvm-x86.c =================================================================== --- qemu-kvm-tpr.orig/qemu-kvm-x86.c +++ qemu-kvm-tpr/qemu-kvm-x86.c @@ -157,10 +157,6 @@ int kvm_arch_create(kvm_context_t kvm, u if (r < 0) return r; -#ifdef KVM_EXIT_TPR_ACCESS - kvm_tpr_opt_setup(); -#endif - return 0; } Index: qemu-kvm-tpr/qemu-kvm.h =================================================================== --- qemu-kvm-tpr.orig/qemu-kvm.h +++ qemu-kvm-tpr/qemu-kvm.h @@ -894,7 +894,6 @@ void qemu_kvm_aio_wait_end(void); void qemu_kvm_notify_work(void); -void kvm_tpr_opt_setup(void); void kvm_tpr_access_report(CPUState *env, uint64_t rip, int is_write); void kvm_tpr_vcpu_start(CPUState *env);