don't call reset functions on cpu initialization
PATCH 1/1 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.
--- hw/apic.c | 1 - hw/e1000.c | 1 - hw/hpet.c | 1 - hw/i8254.c | 2 -- hw/ide/piix.c | 1 - hw/piix4.c | 1 - hw/piix_pci.c | 1 - hw/rtl8139.c | 2 +- hw/serial.c | 1 - hw/usb-ohci.c | 1 - hw/usb-uhci.c | 1 - hw/vga.c | 1 - target-i386/helper.c | 1 - vl.c | 15 +-------------- 14 files changed, 2 insertions(+), 28 deletions(-)
hw/apic.c +0 -1
@@ -981,7 +981,6 @@ int apic_init(CPUState *env) s->id = env->cpuid_apic_id; s->cpu_env = env; -apic_reset (s); msix_supported =1 ;/* XXX: mapping more APICs at the same memory location */
hw/e1000.c +0 -1
@@ -1113,7 +1113,6 @@ static int pci_e1000_init(PCIDevice *pci_dev)qemu_format_nic_info_str (d->vc, macaddr);vmstate_register (-1 , &vmstate_e1000, d); -e1000_reset (d);if (!pci_dev->qdev.hotplugged) {static int loaded =0 ;
hw/hpet.c +0 -1
@@ -577,7 +577,6 @@ void hpet_init(qemu_irq *irq) {HPETTimer *timer = &s->timer[i]; timer->qemu_timer =qemu_new_timer (vm_clock, hpet_timer, timer); } -hpet_reset (s);vmstate_register (-1 , &vmstate_hpet, s);qemu_register_reset (hpet_reset, s);/* HPET Area */
hw/i8254.c +0 -2
@@ -513,7 +513,5 @@ PITState *pit_init(int base, qemu_irq irq)register_ioport_write (base,4 ,1 , pit_ioport_write, pit);register_ioport_read (base,3 ,1 , pit_ioport_read, pit); -pit_reset (pit); -return pit; }
hw/ide/piix.c +0 -1
@@ -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);
hw/piix4.c +0 -1
@@ -97,7 +97,6 @@ static int piix4_initfn(PCIDevice *d)PCI_HEADER_TYPE_NORMAL |PCI_HEADER_TYPE_MULTI_FUNCTION ;// header_type = PCI_multifunction, generic piix4_dev = d; -piix4_reset (d);qemu_register_reset (piix4_reset, d);return 0 ; }
hw/piix_pci.c +0 -1
@@ -341,7 +341,6 @@ static int piix3_initfn(PCIDevice *dev) pci_conf[PCI_HEADER_TYPE ] =PCI_HEADER_TYPE_NORMAL |PCI_HEADER_TYPE_MULTI_FUNCTION ;// header_type = PCI_multifunction, generic -piix3_reset (d);qemu_register_reset (piix3_reset, d);return 0 ; }
hw/rtl8139.c +1 -1
@@ -3331,7 +3331,7 @@ static int pci_rtl8139_init(PCIDevice *dev) PCI_ADDRESS_SPACE_MEM, rtl8139_mmio_map);qemu_macaddr_default_if_unset (&s->conf.macaddr); -rtl8139_reset (&s->dev.qdev); + s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_NIC, s->conf.vlan, s->conf.peer, dev->qdev.info->name, dev->qdev.id,
hw/serial.c +0 -1
@@ -725,7 +725,6 @@ static void serial_init_core(SerialState *s) s->transmit_timer =qemu_new_timer (vm_clock, (QEMUTimerCB *) serial_xmit, s);qemu_register_reset (serial_reset, s); -serial_reset (s);qemu_chr_add_handlers (s->chr, serial_can_receive1, serial_receive1, serial_event, s);
hw/usb-ohci.c +0 -1
@@ -1698,7 +1698,6 @@ static void usb_ohci_init(OHCIState *ohci, DeviceState *dev, ohci->async_td =0 ;qemu_register_reset (ohci_reset, ohci); -ohci_reset (ohci); } typedef struct {
hw/usb-uhci.c +0 -1
@@ -1079,7 +1079,6 @@ static int usb_uhci_common_initfn(UHCIState *s) s->num_ports_vmstate =NB_PORTS ;qemu_register_reset (uhci_reset, s); -uhci_reset (s);/* Use region 4 for consistency with real hardware. BSD guests seem to rely on this. */
hw/vga.c +0 -1
@@ -2235,7 +2235,6 @@ void vga_common_init(VGACommonState *s, int vga_ram_size) s->update_retrace_info = vga_precise_update_retrace_info;break ; } -vga_reset (s); }/* used by both ISA and PCI */
target-i386/helper.c +0 -1
@@ -1885,7 +1885,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model)return NULL ; }mce_init (env); -cpu_reset (env);qemu_init_vcpu (env);
vl.c +1 -14
@@ -3415,11 +3415,9 @@ static QemuThread io_thread;static QemuThread *tcg_cpu_thread;static QemuCond *tcg_halt_cond; -static int qemu_system_ready;/* cpu creation */ static QemuCond qemu_cpu_cond;/* system init */ -static QemuCond qemu_system_cond;static QemuCond qemu_pause_cond;static void block_io_signals (void );
@@ -3484,10 +3482,6 @@ static void *kvm_cpu_thread_fn(void *arg) env->created =1 ;qemu_cond_signal (&qemu_cpu_cond); -/* and wait for machine initialization */ -while (!qemu_system_ready) -qemu_cond_timedwait (&qemu_system_cond, &qemu_global_mutex,100 ); -while (1 ) {if (cpu_can_run (env))qemu_cpu_exec (env);
@@ -3512,10 +3506,6 @@ static void *tcg_cpu_thread_fn(void *arg) env->created =1 ;qemu_cond_signal (&qemu_cpu_cond); -/* and wait for machine initialization */ -while (!qemu_system_ready) -qemu_cond_timedwait (&qemu_system_cond, &qemu_global_mutex,100 ); -while (1 ) {tcg_cpu_exec ();qemu_wait_io_event (cur_cpu);
@@ -4030,10 +4020,7 @@ static void main_loop(void) {int r; -#ifdef CONFIG_IOTHREAD - qemu_system_ready =1 ; -qemu_cond_broadcast (&qemu_system_cond); -#endif +qemu_system_reset ();for (;;) { do {
Signature · 1 line
1.6.2.5
Quoted 31 lines · Glauber Costa
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 callqemu_system_reset()only when we're already sure the system is up and runningI 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.
Signed-off-by Glauber Costa <[email protected]>---
hw/apic.c | 1 -
hw/e1000.c | 1 -
hw/hpet.c | 1 -
hw/i8254.c | 2 --
hw/ide/piix.c | 1 -
hw/piix4.c | 1 -
hw/piix_pci.c | 1 -
hw/rtl8139.c | 2 +-
hw/serial.c | 1 -
hw/usb-ohci.c | 1 -
hw/usb-uhci.c | 1 -
hw/vga.c | 1 -
target-i386/helper.c | 1 -
vl.c | 15 +--------------14 files changed, 2 insertions(+), 28 deletions(-)
[...]
target-i386/helper.c CPUX86State *cpu_x86_init(const char *cpu_model) · line 1888
Quoted 9 lines
target-i386/helper.c +0
-1@@ -1885,7 +1885,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model) return NULL; } mce_init(env); - cpu_reset(env);
Who will call cpu_reset for user mode QEMU then?
Laurent
Quoted 33 lines · Laurent Desnogues
Quoted 31 lines · Glauber Costa
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 callqemu_system_reset()only when we're already sure the system is up and runningI 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.
Signed-off-by Glauber Costa <[email protected]>---
hw/apic.c | 1 -
hw/e1000.c | 1 -
hw/hpet.c | 1 -
hw/i8254.c | 2 --
hw/ide/piix.c | 1 -
hw/piix4.c | 1 -
hw/piix_pci.c | 1 -
hw/rtl8139.c | 2 +-
hw/serial.c | 1 -
hw/usb-ohci.c | 1 -
hw/usb-uhci.c | 1 -
hw/vga.c | 1 -
target-i386/helper.c | 1 -
vl.c | 15 +--------------14 files changed, 2 insertions(+), 28 deletions(-)[...]
Quoted 11 lines
target-i386/helper.c CPUX86State *cpu_x86_init(const char *cpu_model) · line 1888
Quoted 9 lines
target-i386/helper.c +0
-1@@ -1885,7 +1885,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model) return NULL; } mce_init(env); - cpu_reset(env);Who will call
cpu_resetfor user mode QEMU then?
I believe we can then call it explicitly right after we call cpu_init for user mode, then
or can't we?
Quoted 46 lines · Glauber Costa
Quoted 33 lines · Laurent Desnogues
Quoted 31 lines · Glauber Costa
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 callqemu_system_reset()only when we're already sure the system is up and runningI 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.
Signed-off-by Glauber Costa <[email protected]>---
hw/apic.c | 1 -
hw/e1000.c | 1 -
hw/hpet.c | 1 -
hw/i8254.c | 2 --
hw/ide/piix.c | 1 -
hw/piix4.c | 1 -
hw/piix_pci.c | 1 -
hw/rtl8139.c | 2 +-
hw/serial.c | 1 -
hw/usb-ohci.c | 1 -
hw/usb-uhci.c | 1 -
hw/vga.c | 1 -
target-i386/helper.c | 1 -
vl.c | 15 +--------------14 files changed, 2 insertions(+), 28 deletions(-)[...]
Quoted 11 lines
target-i386/helper.c CPUX86State *cpu_x86_init(const char *cpu_model) · line 1888
Quoted 9 lines
target-i386/helper.c +0
-1@@ -1885,7 +1885,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model) return NULL; } mce_init(env); - cpu_reset(env);Who will call
cpu_resetfor user mode QEMU then?
Quoted 4 lines
I believe we can then call it explicitly right after we call
cpu_initfor user mode, thenor can't we?
Can't say :-)
Perhaps the safest thing to do would be to #ifdef/ifndef that call without moving it?
Laurent
Re: [Qemu-devel] [PATCH] don't call reset functions on cpu initialization\
In reply to Glauber CostaQuoted 206 lines · Glauber Costa
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 callqemu_system_reset()only when we're already sure the system is up and runningI 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.
Signed-off-by Glauber Costa <[email protected]>--- hw/apic.c | 1 - hw/e1000.c | 1 - hw/hpet.c | 1 - hw/i8254.c | 2 -- hw/ide/piix.c | 1 - hw/piix4.c | 1 - hw/piix_pci.c | 1 - hw/rtl8139.c | 2 +- hw/serial.c | 1 - hw/usb-ohci.c | 1 - hw/usb-uhci.c | 1 - hw/vga.c | 1 - target-i386/helper.c | 1 - vl.c | 15 +-------------- 14 files changed, 2 insertions(+), 28 deletions(-)hw/apic.c +0
-1@@ -981,7 +981,6 @@ int apic_init(CPUState *env) s->id = env->cpuid_apic_id; s->cpu_env = env; -apic_reset (s); msix_supported =1 ;/* XXX: mapping more APICs at the same memory location */ hw/e1000.c +0
-1@@ -1113,7 +1113,6 @@ static int pci_e1000_init(PCIDevice *pci_dev)qemu_format_nic_info_str (d->vc, macaddr);vmstate_register (-1 , &vmstate_e1000, d); -e1000_reset (d);if (!pci_dev->qdev.hotplugged) {static int loaded =0 ;hw/hpet.c +0
-1@@ -577,7 +577,6 @@ void hpet_init(qemu_irq *irq) {HPETTimer *timer = &s->timer[i]; timer->qemu_timer =qemu_new_timer (vm_clock, hpet_timer, timer); } -hpet_reset (s);vmstate_register (-1 , &vmstate_hpet, s);qemu_register_reset (hpet_reset, s);/* HPET Area */ hw/i8254.c +0
-2@@ -513,7 +513,5 @@ PITState *pit_init(int base, qemu_irq irq)register_ioport_write (base,4 ,1 , pit_ioport_write, pit);register_ioport_read (base,3 ,1 , pit_ioport_read, pit); -pit_reset (pit); -return pit; }hw/ide/piix.c +0
-1@@ -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);hw/piix4.c +0
-1@@ -97,7 +97,6 @@ static int piix4_initfn(PCIDevice *d)PCI_HEADER_TYPE_NORMAL |PCI_HEADER_TYPE_MULTI_FUNCTION ;// header_type = PCI_multifunction, generic piix4_dev = d; -piix4_reset (d);qemu_register_reset (piix4_reset, d);return 0 ; }hw/piix_pci.c +0
-1@@ -341,7 +341,6 @@ static int piix3_initfn(PCIDevice *dev) pci_conf[PCI_HEADER_TYPE ] =PCI_HEADER_TYPE_NORMAL |PCI_HEADER_TYPE_MULTI_FUNCTION ;// header_type = PCI_multifunction, generic -piix3_reset (d);qemu_register_reset (piix3_reset, d);return 0 ; }hw/rtl8139.c +1
-1@@ -3331,7 +3331,7 @@ static int pci_rtl8139_init(PCIDevice *dev) PCI_ADDRESS_SPACE_MEM, rtl8139_mmio_map);qemu_macaddr_default_if_unset (&s->conf.macaddr); -rtl8139_reset (&s->dev.qdev); + s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_NIC, s->conf.vlan, s->conf.peer, dev->qdev.info->name, dev->qdev.id,hw/serial.c +0
-1@@ -725,7 +725,6 @@ static void serial_init_core(SerialState *s) s->transmit_timer =qemu_new_timer (vm_clock, (QEMUTimerCB *) serial_xmit, s);qemu_register_reset (serial_reset, s); -serial_reset (s);qemu_chr_add_handlers (s->chr, serial_can_receive1, serial_receive1, serial_event, s);hw/usb-ohci.c +0
-1@@ -1698,7 +1698,6 @@ static void usb_ohci_init(OHCIState *ohci, DeviceState *dev, ohci->async_td =0 ;qemu_register_reset (ohci_reset, ohci); -ohci_reset (ohci); } typedef struct {hw/usb-uhci.c +0
-1@@ -1079,7 +1079,6 @@ static int usb_uhci_common_initfn(UHCIState *s) s->num_ports_vmstate =NB_PORTS ;qemu_register_reset (uhci_reset, s); -uhci_reset (s);/* Use region 4 for consistency with real hardware. BSD guests seem to rely on this. */ hw/vga.c +0
-1@@ -2235,7 +2235,6 @@ void vga_common_init(VGACommonState *s, int vga_ram_size) s->update_retrace_info = vga_precise_update_retrace_info;break ; } -vga_reset (s); }/* used by both ISA and PCI */ target-i386/helper.c +0
-1@@ -1885,7 +1885,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model)return NULL ; }mce_init (env); -cpu_reset (env);qemu_init_vcpu (env);vl.c +0
-2@@ -3415,11 +3415,9 @@ static QemuThread io_thread;static QemuThread *tcg_cpu_thread;static QemuCond *tcg_halt_cond; -static int qemu_system_ready;/* cpu creation */ static QemuCond qemu_cpu_cond;/* system init */ -static QemuCond qemu_system_cond;static QemuCond qemu_pause_cond;static void block_io_signals (void );
vl.c static void *kvm_cpu_thread_fn(void *arg) · line 3490
Quoted 7 lines
vl.c +0
-4@@ -3484,10 +3482,6 @@ static void *kvm_cpu_thread_fn(void *arg) env->created =1 ;qemu_cond_signal (&qemu_cpu_cond); -/* and wait for machine initialization */ -while (!qemu_system_ready) -qemu_cond_timedwait (&qemu_system_cond, &qemu_global_mutex,100 ); -
I don't understand why you remove this (and what it has to do with system reset). What prevents cpus from executing their main loop between cpu creation and full machine initialization?
Re: [Qemu-devel] [PATCH] don't call reset functions on cpu initialization\
Quoted 210 lines · Marcelo Tosatti
Quoted 209 lines · Glauber Costa
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 callqemu_system_reset()only when we're already sure the system is up and runningI 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.
Signed-off-by Glauber Costa <[email protected]>--- hw/apic.c | 1 - hw/e1000.c | 1 - hw/hpet.c | 1 - hw/i8254.c | 2 -- hw/ide/piix.c | 1 - hw/piix4.c | 1 - hw/piix_pci.c | 1 - hw/rtl8139.c | 2 +- hw/serial.c | 1 - hw/usb-ohci.c | 1 - hw/usb-uhci.c | 1 - hw/vga.c | 1 - target-i386/helper.c | 1 - vl.c | 15 +-------------- 14 files changed, 2 insertions(+), 28 deletions(-)hw/apic.c +0
-1@@ -981,7 +981,6 @@ int apic_init(CPUState *env) s->id = env->cpuid_apic_id; s->cpu_env = env; -apic_reset (s); msix_supported =1 ;/* XXX: mapping more APICs at the same memory location */ hw/e1000.c +0
-1@@ -1113,7 +1113,6 @@ static int pci_e1000_init(PCIDevice *pci_dev)qemu_format_nic_info_str (d->vc, macaddr);vmstate_register (-1 , &vmstate_e1000, d); -e1000_reset (d);if (!pci_dev->qdev.hotplugged) {static int loaded =0 ;hw/hpet.c +0
-1@@ -577,7 +577,6 @@ void hpet_init(qemu_irq *irq) {HPETTimer *timer = &s->timer[i]; timer->qemu_timer =qemu_new_timer (vm_clock, hpet_timer, timer); } -hpet_reset (s);vmstate_register (-1 , &vmstate_hpet, s);qemu_register_reset (hpet_reset, s);/* HPET Area */ hw/i8254.c +0
-2@@ -513,7 +513,5 @@ PITState *pit_init(int base, qemu_irq irq)register_ioport_write (base,4 ,1 , pit_ioport_write, pit);register_ioport_read (base,3 ,1 , pit_ioport_read, pit); -pit_reset (pit); -return pit; }hw/ide/piix.c +0
-1@@ -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);hw/piix4.c +0
-1@@ -97,7 +97,6 @@ static int piix4_initfn(PCIDevice *d)PCI_HEADER_TYPE_NORMAL |PCI_HEADER_TYPE_MULTI_FUNCTION ;// header_type = PCI_multifunction, generic piix4_dev = d; -piix4_reset (d);qemu_register_reset (piix4_reset, d);return 0 ; }hw/piix_pci.c +0
-1@@ -341,7 +341,6 @@ static int piix3_initfn(PCIDevice *dev) pci_conf[PCI_HEADER_TYPE ] =PCI_HEADER_TYPE_NORMAL |PCI_HEADER_TYPE_MULTI_FUNCTION ;// header_type = PCI_multifunction, generic -piix3_reset (d);qemu_register_reset (piix3_reset, d);return 0 ; }hw/rtl8139.c +1
-1@@ -3331,7 +3331,7 @@ static int pci_rtl8139_init(PCIDevice *dev) PCI_ADDRESS_SPACE_MEM, rtl8139_mmio_map);qemu_macaddr_default_if_unset (&s->conf.macaddr); -rtl8139_reset (&s->dev.qdev); + s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_NIC, s->conf.vlan, s->conf.peer, dev->qdev.info->name, dev->qdev.id,hw/serial.c +0
-1@@ -725,7 +725,6 @@ static void serial_init_core(SerialState *s) s->transmit_timer =qemu_new_timer (vm_clock, (QEMUTimerCB *) serial_xmit, s);qemu_register_reset (serial_reset, s); -serial_reset (s);qemu_chr_add_handlers (s->chr, serial_can_receive1, serial_receive1, serial_event, s);hw/usb-ohci.c +0
-1@@ -1698,7 +1698,6 @@ static void usb_ohci_init(OHCIState *ohci, DeviceState *dev, ohci->async_td =0 ;qemu_register_reset (ohci_reset, ohci); -ohci_reset (ohci); } typedef struct {hw/usb-uhci.c +0
-1@@ -1079,7 +1079,6 @@ static int usb_uhci_common_initfn(UHCIState *s) s->num_ports_vmstate =NB_PORTS ;qemu_register_reset (uhci_reset, s); -uhci_reset (s);/* Use region 4 for consistency with real hardware. BSD guests seem to rely on this. */ hw/vga.c +0
-1@@ -2235,7 +2235,6 @@ void vga_common_init(VGACommonState *s, int vga_ram_size) s->update_retrace_info = vga_precise_update_retrace_info;break ; } -vga_reset (s); }/* used by both ISA and PCI */ target-i386/helper.c +0
-1@@ -1885,7 +1885,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model)return NULL ; }mce_init (env); -cpu_reset (env);qemu_init_vcpu (env);vl.c +0
-2@@ -3415,11 +3415,9 @@ static QemuThread io_thread;static QemuThread *tcg_cpu_thread;static QemuCond *tcg_halt_cond; -static int qemu_system_ready;/* cpu creation */ static QemuCond qemu_cpu_cond;/* system init */ -static QemuCond qemu_system_cond;static QemuCond qemu_pause_cond;static void block_io_signals (void );@@ -3484,10 +3482,6 @@ static void *kvm_cpu_thread_fn(void *arg) env->created =1 ;qemu_cond_signal (&qemu_cpu_cond);
Quoted 8 lines
vl.c static void *kvm_cpu_thread_fn(void *arg) · line 3490
Quoted 4 lines
vl.c +0
-4-/* and wait for machine initialization */ -while (!qemu_system_ready) -qemu_cond_timedwait (&qemu_system_cond, &qemu_global_mutex,100 ); -I don't understand why you remove this (and what it has to do with system reset). What prevents cpus from executing their main loop between cpu creation and full machine initialization?
the logic behind it, is that since we are not touching any cpu state up to that point, whatever we do in the cpu loop is fine, since we will not execute it, just spin.
I do however, ackowledge this is a pretty complicated issue, and quite subtle. I am not against removing it, or at least sending a separate patch for it, so we can have better bisectability.