|
@@ -421,6 +421,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
|
|
|
case KVM_CAP_S390_GS:
|
|
|
r = test_facility(133);
|
|
|
break;
|
|
|
+ case KVM_CAP_S390_BPB:
|
|
|
+ r = test_facility(82);
|
|
|
+ break;
|
|
|
default:
|
|
|
r = 0;
|
|
|
}
|
|
@@ -2198,6 +2201,8 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
|
|
|
kvm_s390_set_prefix(vcpu, 0);
|
|
|
if (test_kvm_facility(vcpu->kvm, 64))
|
|
|
vcpu->run->kvm_valid_regs |= KVM_SYNC_RICCB;
|
|
|
+ if (test_kvm_facility(vcpu->kvm, 82))
|
|
|
+ vcpu->run->kvm_valid_regs |= KVM_SYNC_BPBC;
|
|
|
if (test_kvm_facility(vcpu->kvm, 133))
|
|
|
vcpu->run->kvm_valid_regs |= KVM_SYNC_GSCB;
|
|
|
/* fprs can be synchronized via vrs, even if the guest has no vx. With
|
|
@@ -2339,6 +2344,7 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
|
|
|
current->thread.fpu.fpc = 0;
|
|
|
vcpu->arch.sie_block->gbea = 1;
|
|
|
vcpu->arch.sie_block->pp = 0;
|
|
|
+ vcpu->arch.sie_block->fpf &= ~FPF_BPBC;
|
|
|
vcpu->arch.pfault_token = KVM_S390_PFAULT_TOKEN_INVALID;
|
|
|
kvm_clear_async_pf_completion_queue(vcpu);
|
|
|
if (!kvm_s390_user_cpu_state_ctrl(vcpu->kvm))
|
|
@@ -3298,6 +3304,11 @@ static void sync_regs(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
|
|
vcpu->arch.sie_block->ecd |= ECD_HOSTREGMGMT;
|
|
|
vcpu->arch.gs_enabled = 1;
|
|
|
}
|
|
|
+ if ((kvm_run->kvm_dirty_regs & KVM_SYNC_BPBC) &&
|
|
|
+ test_kvm_facility(vcpu->kvm, 82)) {
|
|
|
+ vcpu->arch.sie_block->fpf &= ~FPF_BPBC;
|
|
|
+ vcpu->arch.sie_block->fpf |= kvm_run->s.regs.bpbc ? FPF_BPBC : 0;
|
|
|
+ }
|
|
|
save_access_regs(vcpu->arch.host_acrs);
|
|
|
restore_access_regs(vcpu->run->s.regs.acrs);
|
|
|
/* save host (userspace) fprs/vrs */
|
|
@@ -3344,6 +3355,7 @@ static void store_regs(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
|
|
|
kvm_run->s.regs.pft = vcpu->arch.pfault_token;
|
|
|
kvm_run->s.regs.pfs = vcpu->arch.pfault_select;
|
|
|
kvm_run->s.regs.pfc = vcpu->arch.pfault_compare;
|
|
|
+ kvm_run->s.regs.bpbc = (vcpu->arch.sie_block->fpf & FPF_BPBC) == FPF_BPBC;
|
|
|
save_access_regs(vcpu->run->s.regs.acrs);
|
|
|
restore_access_regs(vcpu->arch.host_acrs);
|
|
|
/* Save guest register state */
|