Skip to content

Commit 6f93d1e

Browse files
author
Claudio Imbrenda
committed
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: e38c884 ("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>
1 parent b827ef0 commit 6f93d1e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

arch/s390/kvm/gaccess.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,8 +1506,9 @@ static int _gaccess_do_shadow(struct kvm_s390_mmu_cache *mc, struct gmap *sg,
15061506
if (rc)
15071507
return rc;
15081508

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))
15111512
return 0;
15121513

15131514
gl = get_level(table, ptep);

0 commit comments

Comments
 (0)