-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
> @@ -369,6 +372,10 @@ static void *ap_main_loop(void *_env)
> sigfillset(&signals);
> sigprocmask(SIG_BLOCK, &signals, NULL);
> kvm_create_vcpu(kvm_context, env->cpu_index);
> +pthread_mutex_lock(&vcpu_mutex);
> +vcpu->created =
Ryan Harper wrote:
> * Avi Kivity <[EMAIL PROTECTED]> [2008-04-26 02:23]:
>
>> Please reuse qemu_mutex for this, no need for a new one.
>>
>
> I'm having a little trouble wrapping my head around all of the locking
> here. If I avoid qemu_mutex and use a new one, I've got everything
> worki
* Avi Kivity <[EMAIL PROTECTED]> [2008-04-26 02:23]:
>
> Please reuse qemu_mutex for this, no need for a new one.
I'm having a little trouble wrapping my head around all of the locking
here. If I avoid qemu_mutex and use a new one, I've got everything
working. However, attemping to use qemu_mut
Ulrich Drepper wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Ryan Harper wrote:
>
>> @@ -388,9 +395,10 @@ static void kvm_add_signal(struct qemu_kvm_signal_table
>> *sigtab, int signum)
>>
>> void kvm_init_new_ap(int cpu, CPUState *env)
>> {
>> +pthread_mutex_lock(&vcpu_m
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ryan Harper wrote:
> @@ -388,9 +395,10 @@ static void kvm_add_signal(struct qemu_kvm_signal_table
> *sigtab, int signum)
>
> void kvm_init_new_ap(int cpu, CPUState *env)
> {
> +pthread_mutex_lock(&vcpu_mutex);
> pthread_create(&vcpu_info[
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ryan Harper wrote:
> +/* block until cond_wait occurs */
> +pthread_mutex_lock(&vcpu_mutex);
> +/* now we can signal */
> +pthread_cond_signal(&qemu_vcpuup_cond);
> +pthread_mutex_unlock(&vcpu_mutex);
It is not necessary to take th
Ryan Harper wrote:
> There is a race between when the vcpu thread issues a create ioctl and when
> apic_reset() gets called resulting in getting a badfd error.
>
>
The problem is indeed there, but the fix is wrong:
> main threadvcpu thread
> diff --git a/qemu/qemu-kvm.c b/qemu/
* Ryan Harper <[EMAIL PROTECTED]> [2008-04-26 00:27]:
> There is a race between when the vcpu thread issues a create ioctl and when
> apic_reset() gets called resulting in getting a badfd error.
>
> main threadvcpu thread
guilt refresh clipped my text short.
main thread
There is a race between when the vcpu thread issues a create ioctl and when
apic_reset() gets called resulting in getting a badfd error.
main threadvcpu thread
diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
index 78127de..3513e8c 100644
--- a/qemu/qemu-kvm.c
+++ b/qemu/qemu-kvm.c
@