diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2019-12-16 16:48:11 +0100 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2020-02-27 19:47:11 +0100 |
commit | 1274800792dced8e5b6d54c71ec049c4d1e34189 (patch) | |
tree | 7d969ddc78286f9cc4e7e623f3115b25967766ce /arch/s390/kvm/pv.c | |
parent | KVM: s390: protvirt: Secure memory is not mergeable (diff) | |
download | linux-1274800792dced8e5b6d54c71ec049c4d1e34189.tar.xz linux-1274800792dced8e5b6d54c71ec049c4d1e34189.zip |
KVM: s390/mm: Make pages accessible before destroying the guest
Before we destroy the secure configuration, we better make all
pages accessible again. This also happens during reboot, where we reboot
into a non-secure guest that then can go again into secure mode. As
this "new" secure guest will have a new ID we cannot reuse the old page
state.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'arch/s390/kvm/pv.c')
-rw-r--r-- | arch/s390/kvm/pv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c index e9e020475f4a..9840ee49e572 100644 --- a/arch/s390/kvm/pv.c +++ b/arch/s390/kvm/pv.c @@ -140,6 +140,9 @@ int kvm_s390_pv_deinit_vm(struct kvm *kvm, u16 *rc, u16 *rrc) { int cc; + /* make all pages accessible before destroying the guest */ + s390_reset_acc(kvm->mm); + cc = uv_cmd_nodata(kvm_s390_pv_get_handle(kvm), UVC_CMD_DESTROY_SEC_CONF, rc, rrc); WRITE_ONCE(kvm->arch.gmap->guest_handle, 0); |