@@ -1382,6 +1382,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
13821382 unsigned long * pgt , int * dat_protection ,
13831383 int * fake )
13841384{
1385+ struct kvm * kvm ;
13851386 struct gmap * parent ;
13861387 union asce asce ;
13871388 union vaddress vaddr ;
@@ -1390,6 +1391,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
13901391
13911392 * fake = 0 ;
13921393 * dat_protection = 0 ;
1394+ kvm = sg -> private ;
13931395 parent = sg -> parent ;
13941396 vaddr .addr = saddr ;
13951397 asce .val = sg -> orig_asce ;
@@ -1450,6 +1452,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
14501452 rc = gmap_shadow_r2t (sg , saddr , rfte .val , * fake );
14511453 if (rc )
14521454 return rc ;
1455+ kvm -> stat .gmap_shadow_r1_entry ++ ;
14531456 }
14541457 fallthrough ;
14551458 case ASCE_TYPE_REGION2 : {
@@ -1478,6 +1481,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
14781481 rc = gmap_shadow_r3t (sg , saddr , rste .val , * fake );
14791482 if (rc )
14801483 return rc ;
1484+ kvm -> stat .gmap_shadow_r2_entry ++ ;
14811485 }
14821486 fallthrough ;
14831487 case ASCE_TYPE_REGION3 : {
@@ -1515,6 +1519,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
15151519 rc = gmap_shadow_sgt (sg , saddr , rtte .val , * fake );
15161520 if (rc )
15171521 return rc ;
1522+ kvm -> stat .gmap_shadow_r3_entry ++ ;
15181523 }
15191524 fallthrough ;
15201525 case ASCE_TYPE_SEGMENT : {
@@ -1548,6 +1553,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
15481553 rc = gmap_shadow_pgt (sg , saddr , ste .val , * fake );
15491554 if (rc )
15501555 return rc ;
1556+ kvm -> stat .gmap_shadow_sg_entry ++ ;
15511557 }
15521558 }
15531559 /* Return the parent address of the page table */
@@ -1618,6 +1624,7 @@ int kvm_s390_shadow_fault(struct kvm_vcpu *vcpu, struct gmap *sg,
16181624 pte .p |= dat_protection ;
16191625 if (!rc )
16201626 rc = gmap_shadow_page (sg , saddr , __pte (pte .val ));
1627+ vcpu -> kvm -> stat .gmap_shadow_pg_entry ++ ;
16211628 ipte_unlock (vcpu -> kvm );
16221629 mmap_read_unlock (sg -> mm );
16231630 return rc ;
0 commit comments