From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V3P1m-0006Zn-4C for qemu-devel@nongnu.org; Sun, 28 Jul 2013 07:20:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V3P1h-0001XK-8J for qemu-devel@nongnu.org; Sun, 28 Jul 2013 07:20:41 -0400 Message-ID: <51F4FE7C.6050403@suse.de> Date: Sun, 28 Jul 2013 13:20:28 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1374890510-5479-1-git-send-email-afaerber@suse.de> <20130728081309.3f904480@thinkpad> In-Reply-To: <20130728081309.3f904480@thinkpad> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu for-1.6] cpu: Partially revert "cpu: Change qemu_init_vcpu() argument to CPUState" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Peter Maydell , Jia Liu , Anthony Green , qemu-devel@nongnu.org, Alexander Graf , Blue Swirl , Max Filippov , Michael Walle , qemu-ppc , Paul Brook , chen.fan.fnst@cn.fujitsu.com, "Edgar E. Iglesias" , Guan Xuetao , Aurelien Jarno , Richard Henderson Am 28.07.2013 08:13, schrieb Igor Mammedov: > On Sat, 27 Jul 2013 04:01:50 +0200 > Andreas F=E4rber wrote: >=20 >> Commit c643bed99 moved qemu_init_vcpu() calls to common CPUState code. >> This causes x86 cpu-add to fail with "KVM: setting VAPIC address faile= d". >> >> The reason for the failure is that CPUClass::kvm_fd is not yet >> initialized in the following call graph: >> ->x86_cpu_realizefn >> ->x86_cpu_apic_realize >> ->qdev_init >> ->device_set_realized >> ->device_reset (hotplugged =3D=3D 1) >> ->apic_reset_common >> ->vapic_base_update >> ->kvm_apic_vapic_base_update >> This causes attempted KVM vCPU ioctls to fail. >> >> By contrast, in the non-hotplug case the APIC is reset much later, whe= n >> the vCPU is already initialized. >> >> As a quick and safe solution, move the qemu_init_vcpu() call back into >> the targets' realize functions. >> >> Reported-by: Chen Fan >> Signed-off-by: Andreas F=E4rber >=20 > ACK for target-i386 Thanks, applied to qom-cpu: https://github.com/afaerber/qemu-cpu/commits/qom-cpu I used the diff of the offending commit to determine placement of qemu_init_vcpu() and only avoided duplicate CPU() casts, so other targets should be fine as well. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg