Re: [PATCH] KVM: Let KVM_SET_SIGNAL_MASK work as advertised

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

 



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, &current->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, &current->real_blocked, NULL);
> 
> ... they will be reinjected here when __set_task_blocked calls
> recalc_sigpending?
> 
>> +	sigemptyset(&current->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





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux