Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: s390: vsie: Fix check for pre-existing shadow mapping

When shadowing a nested guest, a check is performed and no shadowing is
attempted if the nested guest is already shadowed.

The existing check was incomplete; fix it by also checking whether the
leaf DAT table entry in the existing shadow gmap has the same protection
as the one specified in the guest DAT entry.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

+3 -2
+3 -2
arch/s390/kvm/gaccess.c
··· 1506 1506 if (rc) 1507 1507 return rc; 1508 1508 1509 - /* A race occourred. The shadow mapping is already valid, nothing to do */ 1510 - if ((ptep && !ptep->h.i) || (!ptep && crste_leaf(*table))) 1509 + /* A race occurred. The shadow mapping is already valid, nothing to do */ 1510 + if ((ptep && !ptep->h.i && ptep->h.p == w->p) || 1511 + (!ptep && crste_leaf(*table) && !table->h.i && table->h.p == w->p)) 1511 1512 return 0; 1512 1513 1513 1514 gl = get_level(table, ptep);