Received: from eggs.gnu.org ([2001:4830:134:3::10]:39305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z02AO-0003uM-Tj for qemu-devel@nongnu.org; Wed, 03 Jun 2015 02:28:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z02AJ-0003B8-Uk for qemu-devel@nongnu.org; Wed, 03 Jun 2015 02:28:44 -0400 Received: from [59.151.112.132] (port=56060 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z02AJ-0002tT-1h for qemu-devel@nongnu.org; Wed, 03 Jun 2015 02:28:39 -0400 Message-ID: <556E9E13.70605@cn.fujitsu.com> Date: Wed, 3 Jun 2015 14:26:27 +0800 From: Zhu Guihua MIME-Version: 1.0 References: <789d40c9c89bb3d9eba55ef96e9a95d31ad268f6.1432881408.git.zhugh.fnst@cn.fujitsu.com> <20150602155355.GC3410@thinpad.lan.raisama.net> In-Reply-To: <20150602155355.GC3410@thinpad.lan.raisama.net> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v7 1/3] sysbus: register reset handler for main_system_bus when created List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, guz.fnst@cn.fujitsu.com, pbonzini@redhat.com, izumi.taku@jp.fujitsu.com, chen.fan.fnst@cn.fujitsu.com, imammedo@redhat.com, afaerber@suse.de Hi Eduardo, On 06/02/2015 11:53 PM, Eduardo Habkost wrote: > On Tue, Jun 02, 2015 at 05:23:55PM +0800, Zhu Guihua wrote: >> Since icc bus will be droped and apic reset should be after bus >> reset in x86, this patch moves reset handler for main_system_bus >> from vl.c to sysbus.c > So, you are changing reset ordering for all machines because of a > x86-specific requirement? > > Other machines can have different ordering requirements and may break if > you unconditionally change the reset order for all machines. > > Like I said on v6: if x86 has specific CPU reset ordering requirements, > we should be able to ensure the expected ordering in x86-specific code > (in pc.c?), not hardcode reset ordering for all machines. > > Maybe we can change the qemu_register_reset() API to accept an explicit > ordering parameter, so ordering requirements are visibly encoded in the > qemu_register_reset() calls instead of depending on non-obvious > initialization code ordering. > > While we don't have a better API, we can probably ensure the x86 reset > ordering without affecting the other machines by calling > qemu_register_reset() for the CPUs in a machine_init_done notifier > registered by PC. I try to call qemu_register_reset() for the CPUs in pc_guest_info_machine_done (), the notifier is in hw/i386/pc.c. And I have tested this, it works well. Thanks, Zhu