Skip to content

Commit d4d3c84

Browse files
committed
Merge tag 'kvm-s390-master-5.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-master
KVM: s390: Fixes for 5.10 - do not reset the global diag318 data for per-cpu reset - do not mark memory as protected too early
2 parents c887c9b + 6cbf1e9 commit d4d3c84

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

arch/s390/kvm/kvm-s390.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,7 +2312,7 @@ static int kvm_s390_handle_pv(struct kvm *kvm, struct kvm_pv_cmd *cmd)
23122312
struct kvm_s390_pv_unp unp = {};
23132313

23142314
r = -EINVAL;
2315-
if (!kvm_s390_pv_is_protected(kvm))
2315+
if (!kvm_s390_pv_is_protected(kvm) || !mm_is_protected(kvm->mm))
23162316
break;
23172317

23182318
r = -EFAULT;
@@ -3564,7 +3564,6 @@ static void kvm_arch_vcpu_ioctl_initial_reset(struct kvm_vcpu *vcpu)
35643564
vcpu->arch.sie_block->pp = 0;
35653565
vcpu->arch.sie_block->fpf &= ~FPF_BPBC;
35663566
vcpu->arch.sie_block->todpr = 0;
3567-
vcpu->arch.sie_block->cpnc = 0;
35683567
}
35693568
}
35703569

@@ -3582,7 +3581,6 @@ static void kvm_arch_vcpu_ioctl_clear_reset(struct kvm_vcpu *vcpu)
35823581

35833582
regs->etoken = 0;
35843583
regs->etoken_extension = 0;
3585-
regs->diag318 = 0;
35863584
}
35873585

35883586
int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)

arch/s390/kvm/pv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ int kvm_s390_pv_init_vm(struct kvm *kvm, u16 *rc, u16 *rrc)
208208
return -EIO;
209209
}
210210
kvm->arch.gmap->guest_handle = uvcb.guest_handle;
211-
atomic_set(&kvm->mm->context.is_protected, 1);
212211
return 0;
213212
}
214213

@@ -228,6 +227,8 @@ int kvm_s390_pv_set_sec_parms(struct kvm *kvm, void *hdr, u64 length, u16 *rc,
228227
*rrc = uvcb.header.rrc;
229228
KVM_UV_EVENT(kvm, 3, "PROTVIRT VM SET PARMS: rc %x rrc %x",
230229
*rc, *rrc);
230+
if (!cc)
231+
atomic_set(&kvm->mm->context.is_protected, 1);
231232
return cc ? -EINVAL : 0;
232233
}
233234

arch/s390/mm/gmap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,6 +2690,8 @@ static const struct mm_walk_ops reset_acc_walk_ops = {
26902690
#include <linux/sched/mm.h>
26912691
void s390_reset_acc(struct mm_struct *mm)
26922692
{
2693+
if (!mm_is_protected(mm))
2694+
return;
26932695
/*
26942696
* we might be called during
26952697
* reset: we walk the pages and clear

0 commit comments

Comments
 (0)