[RFC PATCH 2/5] signal/kvm: Stop using sigprocmask in kvm_sigset_(activate|deactivate)

From: Eric W. Biederman
Date: Fri Jun 07 2019 - 17:46:30 EST



Instead of jumping through hoops call __set_current_blocked directly.
As well as directly manipulating real_blocked.

This is in preparation for modifying the code to always keep
real_blocked in sync with blocked except in the rare cases when the
kernel needs to override it.

Signed-off-by: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
---
virt/kvm/kvm_main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index f0d13d9d125d..8575a1010bfc 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2240,7 +2240,8 @@ void kvm_sigset_activate(struct kvm_vcpu *vcpu)
* ->real_blocked don't care as long ->real_blocked is always a subset
* of ->blocked.
*/
- sigprocmask(SIG_SETMASK, &vcpu->sigset, &current->real_blocked);
+ current->real_blocked = current->blocked;
+ __set_current_blocked(&vcpu->sigset);
}

void kvm_sigset_deactivate(struct kvm_vcpu *vcpu)
@@ -2248,7 +2249,7 @@ void kvm_sigset_deactivate(struct kvm_vcpu *vcpu)
if (!vcpu->sigset_active)
return;

- sigprocmask(SIG_SETMASK, &current->real_blocked, NULL);
+ __set_current_blocked(&current->real_blocked);
sigemptyset(&current->real_blocked);
}

--
2.21.0.dirty