From c169998802505c244b8bcad562633f29de7d74a4 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 5 Nov 2009 16:05:15 -0200 Subject: 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 Signed-off-by: Blue Swirl --- hw/ide/piix.c | 1 - 1 file changed, 1 deletion(-) (limited to 'hw/ide') diff --git a/hw/ide/piix.c b/hw/ide/piix.c index a17bf5951..60b37a36a 100644 --- a/hw/ide/piix.c +++ b/hw/ide/piix.c @@ -120,7 +120,6 @@ static int pci_piix_ide_initfn(PCIIDEState *d) pci_conf[PCI_HEADER_TYPE] = PCI_HEADER_TYPE_NORMAL; // header_type qemu_register_reset(piix3_reset, d); - piix3_reset(d); pci_register_bar(&d->dev, 4, 0x10, PCI_ADDRESS_SPACE_IO, bmdma_map); -- cgit v1.2.3