[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] return default values for apic probe functions.

From: Avi Kivity
Subject: [Qemu-devel] Re: [PATCH] return default values for apic probe functions.
Date: Sun, 19 Apr 2009 11:45:13 +0300
User-agent: Thunderbird (X11/20090320)

Glauber Costa wrote:
As KVM cpus runs on threads, it is possible that
we call kvm_load_registers() from a cpu thread, while the
apic has not yet fully initialized. kvm_load_registers() is called
from ap_main_loop.

This is not a problem when we're starting the whole machine together,
but is a problem for hotplug, since we don't have the protection
of the locks that protect machine initialization. Currently, some executions
of cpu hotplug on rainy sundays fail with a segfault.

Moving apic initialization to before kvm_init_vpcu proved fruitful,
as there are some dependencies involved. (kvm irqchip would fail to

I presume you mean unfruitful (or perhaps a nasty kind of fruit).

This patch provides default values to be used for tpr and apic_base,
that will be returned when the apic is not yet properly initialized.
It is aimed at kvm, where the problem exists, but it could equally be
used for qemu too, if there is agreement.

Seems like a hack... can you try not to make the vcpu visible until it is completely initialized?

(and what is the problem exactly - someone accessing the registers from a different thread? that shouldn't happen)

Do not meddle in the internals of kernels, for they are subtle and quick to 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]