Skip to content

Commit 0c18970

Browse files
committed
Merge tag 'kvm-s390-master-6.5-1' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
Two fixes for asynchronous destroy
2 parents 675a15f + c2fceb5 commit 0c18970

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

arch/s390/kvm/pv.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,12 @@ int kvm_s390_pv_deinit_cleanup_all(struct kvm *kvm, u16 *rc, u16 *rrc)
411411
u16 _rc, _rrc;
412412
int cc = 0;
413413

414-
/* Make sure the counter does not reach 0 before calling s390_uv_destroy_range */
415-
atomic_inc(&kvm->mm->context.protected_count);
414+
/*
415+
* Nothing to do if the counter was already 0. Otherwise make sure
416+
* the counter does not reach 0 before calling s390_uv_destroy_range.
417+
*/
418+
if (!atomic_inc_not_zero(&kvm->mm->context.protected_count))
419+
return 0;
416420

417421
*rc = 1;
418422
/* If the current VM is protected, destroy it */

arch/s390/mm/gmap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2853,6 +2853,7 @@ int s390_replace_asce(struct gmap *gmap)
28532853
page = alloc_pages(GFP_KERNEL_ACCOUNT, CRST_ALLOC_ORDER);
28542854
if (!page)
28552855
return -ENOMEM;
2856+
page->index = 0;
28562857
table = page_to_virt(page);
28572858
memcpy(table, gmap->table, 1UL << (CRST_ALLOC_ORDER + PAGE_SHIFT));
28582859

0 commit comments

Comments
 (0)