[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH v2 13/24] kvm: Set up signal mask also for !CONF
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] Re: [PATCH v2 13/24] kvm: Set up signal mask also for !CONFIG_IOTHREAD |
Date: |
Mon, 28 Feb 2011 17:16:42 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2011-02-28 16:55, Avi Kivity wrote:
> On 02/01/2011 11:15 PM, Jan Kiszka wrote:
>> From: Jan Kiszka<address@hidden>
>>
>> Block SIG_IPI, unblock it during KVM_RUN, just like in io-thread mode.
>> It's unused so far, but this infrastructure will be required for
>> self-IPIs and to process SIGBUS plus, in KVM mode, SIGIO and SIGALRM. As
>> Windows doesn't support signal services, we need to provide a stub for
>> the init function.
>>
>
> This patch breaks qemu-kvm after merging. The symptoms are that Windows
> XP x64 does not respond when netcat connects to some server in it, via
> -net user,hostfwd. The vcpu thread loops indefinitely on KVM_EXIT_INTR,
> which is consistent with signals being messed up.
>
> I verified that 981085dd465c1 merged with ff48eb5fe79ad works,
> while 981085dd465c1 merged with ff48eb5fe79ad^ fails.
>
>
>> diff --git a/cpus.c b/cpus.c
>> index 42717ba..a33e470 100644
>> --- a/cpus.c
>> +++ b/cpus.c
>> @@ -231,11 +231,9 @@ fail:
>> return err;
>> }
>>
>> -#ifdef CONFIG_IOTHREAD
>> static void dummy_signal(int sig)
>> {
>> }
>> -#endif
>>
>> #else /* _WIN32 */
>>
>> @@ -267,6 +265,32 @@ static void qemu_event_increment(void)
>> #endif /* _WIN32 */
>>
>> #ifndef CONFIG_IOTHREAD
>> +static void qemu_kvm_init_cpu_signals(CPUState *env)
>> +{
>> +#ifndef _WIN32
>> + int r;
>> + sigset_t set;
>> + struct sigaction sigact;
>> +
>> + memset(&sigact, 0, sizeof(sigact));
>> + sigact.sa_handler = dummy_signal;
>> + sigaction(SIG_IPI,&sigact, NULL);
>> +
>> + sigemptyset(&set);
>> + sigaddset(&set, SIG_IPI);
>> + pthread_sigmask(SIG_BLOCK,&set, NULL);
>> +
>> + pthread_sigmask(SIG_BLOCK, NULL,&set);
>> + sigdelset(&set, SIG_IPI);
>> + sigdelset(&set, SIGBUS);
>> + r = kvm_set_signal_mask(env,&set);
>> + if (r) {
>> + fprintf(stderr, "kvm_set_signal_mask: %s\n", strerror(-r));
>> + exit(1);
>> + }
>> +#endif
>> +}
>> +
>> int qemu_init_main_loop(void)
>> {
>> cpu_set_debug_excp_handler(cpu_debug_handler);
>> @@ -292,6 +316,7 @@ void qemu_init_vcpu(void *_env)
>> fprintf(stderr, "kvm_init_vcpu failed: %s\n",
>> strerror(-r));
>> exit(1);
>> }
>> + qemu_kvm_init_cpu_signals(env);
Just comment that out as long as qemu-kvm is (mis-)using !IOTHREAD mode.
I thought it would run before setup_kernel_sigmask, but it's the other
way around, and then the wrong non-iothread signal setup is applied.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
- [Qemu-devel] [PATCH v2 17/24] kvm: Fix race between timer signals and vcpu entry under !IOTHREAD, (continued)
- [Qemu-devel] [PATCH v2 17/24] kvm: Fix race between timer signals and vcpu entry under !IOTHREAD, Jan Kiszka, 2011/02/01
- [Qemu-devel] [PATCH v2 18/24] kvm: Add MCE signal support for !CONFIG_IOTHREAD, Jan Kiszka, 2011/02/01
- [Qemu-devel] [PATCH v2 01/24] kvm: x86: Fix build in absence of KVM_CAP_ASYNC_PF, Jan Kiszka, 2011/02/01
- [Qemu-devel] [PATCH v2 21/24] kvm: Remove static return code of kvm_handle_io, Jan Kiszka, 2011/02/01
- [Qemu-devel] [PATCH v2 22/24] kvm: Leave kvm_cpu_exec directly after KVM_EXIT_SHUTDOWN, Jan Kiszka, 2011/02/01
- [Qemu-devel] [PATCH v2 07/24] Flatten the main loop, Jan Kiszka, 2011/02/01
- [Qemu-devel] [PATCH v2 13/24] kvm: Set up signal mask also for !CONFIG_IOTHREAD, Jan Kiszka, 2011/02/01
- [Qemu-devel] Re: [PATCH v2 13/24] kvm: Set up signal mask also for !CONFIG_IOTHREAD, Avi Kivity, 2011/02/28
- [Qemu-devel] Re: [PATCH v2 13/24] kvm: Set up signal mask also for !CONFIG_IOTHREAD,
Jan Kiszka <=
- [Qemu-devel] Re: [PATCH v2 13/24] kvm: Set up signal mask also for !CONFIG_IOTHREAD, Avi Kivity, 2011/02/28
- [Qemu-devel] Re: [PATCH v2 13/24] kvm: Set up signal mask also for !CONFIG_IOTHREAD, Avi Kivity, 2011/02/28
- [Qemu-devel] Re: [PATCH v2 13/24] kvm: Set up signal mask also for !CONFIG_IOTHREAD, Jan Kiszka, 2011/02/28
- [Qemu-devel] Re: [PATCH v2 13/24] kvm: Set up signal mask also for !CONFIG_IOTHREAD, Avi Kivity, 2011/02/28
[Qemu-devel] [PATCH v2 14/24] kvm: Refactor qemu_kvm_eat_signals, Jan Kiszka, 2011/02/01
[Qemu-devel] [PATCH v2 16/24] Set up signalfd under !CONFIG_IOTHREAD, Jan Kiszka, 2011/02/01
[Qemu-devel] [PATCH v2 20/24] kvm: Unconditionally reenter kernel after IO exits, Jan Kiszka, 2011/02/01
[Qemu-devel] [PATCH v2 08/24] kvm: Report proper error on GET_VCPU_MMAP_SIZE failures, Jan Kiszka, 2011/02/01
[Qemu-devel] [PATCH v2 19/24] Introduce VCPU self-signaling service, Jan Kiszka, 2011/02/01
[Qemu-devel] [PATCH v2 05/24] Trigger exit from cpu_exec_all on pending IO events, Jan Kiszka, 2011/02/01