mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 01:36:52 +09:00
Merge tag 'kvm-s390-next-5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
KVM: s390: Fix potential crash in preemptible kernels There is a potential race for preemptible kernels, where the host kernel would get a fault when it is preempted as the wrong point in time.
This commit is contained in:
@@ -4313,16 +4313,16 @@ static void store_regs_fmt2(struct kvm_vcpu *vcpu)
|
||||
kvm_run->s.regs.bpbc = (vcpu->arch.sie_block->fpf & FPF_BPBC) == FPF_BPBC;
|
||||
kvm_run->s.regs.diag318 = vcpu->arch.diag318_info.val;
|
||||
if (MACHINE_HAS_GS) {
|
||||
preempt_disable();
|
||||
__ctl_set_bit(2, 4);
|
||||
if (vcpu->arch.gs_enabled)
|
||||
save_gs_cb(current->thread.gs_cb);
|
||||
preempt_disable();
|
||||
current->thread.gs_cb = vcpu->arch.host_gscb;
|
||||
restore_gs_cb(vcpu->arch.host_gscb);
|
||||
preempt_enable();
|
||||
if (!vcpu->arch.host_gscb)
|
||||
__ctl_clear_bit(2, 4);
|
||||
vcpu->arch.host_gscb = NULL;
|
||||
preempt_enable();
|
||||
}
|
||||
/* SIE will save etoken directly into SDNX and therefore kvm_run */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user