On 11/27/2017 11:48 AM, Paolo Bonzini wrote: > On 24/11/2017 22:39, Jan H. Schönherr wrote: >> +{ >> + if (!vcpu->sigset_active) >> + return; >> + >> + /* >> + * This does a lockless modification of ->real_blocked, which is fine >> + * because, only current can change ->real_blocked and all readers of >> + * ->real_blocked don't care as long ->real_blocked is always a subset >> + * of ->blocked. >> + */ >> + sigprocmask(SIG_SETMASK, &vcpu->sigset, ¤t->real_blocked); > > So this can block SIGKILL and SIGSTOP, but they'll never be in > real_blocked and... KILL and STOP are filtered in kvm_vcpu_ioctl_set_sigmask(). They should never be in ->sigset. >> +} >> + >> +void kvm_sigset_deactivate(struct kvm_vcpu *vcpu) >> +{ >> + if (!vcpu->sigset_active) >> + return; >> + >> + sigprocmask(SIG_SETMASK, ¤t->real_blocked, NULL); > > ... they will be reinjected here when __set_task_blocked calls > recalc_sigpending? > >> + sigemptyset(¤t->real_blocked); > > If so, this patch is certainly okay, but I suggest that you use > KVM_CAP_IMMEDIATE_EXIT instead. It's much lighter on the NUMA interconnect. Yes. But that's no reason to let this patch go to waste, is it? :) Regards Jan