v3: don't call reset functions on cpu initialization
commitc169998802505c244b8bcad562633f29de7d74a4
authorGlauber Costa <glommer@redhat.com>
Thu, 5 Nov 2009 18:05:15 +0000 (5 16:05 -0200)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 7 Nov 2009 08:06:58 +0000 (7 08:06 +0000)
tree70c88e1184c0b4e77b1b4997250cc418d07cde8b
parentcae334cd6b2aed62a2af82314da1b9eab06824d5
v3: don't call reset functions on cpu initialization

There is absolutely no need to call reset functions when initializing
devices. Since we are already registering them, calling qemu_system_reset()
should suffice. Actually, it is what happens when we reboot the machine,
and using the same process instead of a special case semantics will even
allow us to find bugs easier.

Furthermore, the fact that we initialize things like the cpu quite early,
leads to the need to introduce synchronization stuff like qemu_system_cond.
This patch removes it entirely. All we need to do is call qemu_system_reset()
only when we're already sure the system is up and running

I tested it with qemu (with and without io-thread) and qemu-kvm, and it
seems to be doing okay - although qemu-kvm uses a slightly different patch.

[ v2: user mode still needs cpu_reset, so put it in ifdef. ]
[ v3: leave qemu_system_cond for now. ]

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
14 files changed:
hw/apic.c
hw/e1000.c
hw/hpet.c
hw/i8254.c
hw/ide/piix.c
hw/piix4.c
hw/piix_pci.c
hw/rtl8139.c
hw/serial.c
hw/usb-ohci.c
hw/usb-uhci.c
hw/vga.c
target-i386/helper.c
vl.c