@@ -1365,6 +1365,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
13651365 unsigned long * pgt , int * dat_protection ,
13661366 int * fake )
13671367{
1368+ struct kvm * kvm ;
13681369 struct gmap * parent ;
13691370 union asce asce ;
13701371 union vaddress vaddr ;
@@ -1373,6 +1374,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
13731374
13741375 * fake = 0 ;
13751376 * dat_protection = 0 ;
1377+ kvm = sg -> private ;
13761378 parent = sg -> parent ;
13771379 vaddr .addr = saddr ;
13781380 asce .val = sg -> orig_asce ;
@@ -1433,6 +1435,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
14331435 rc = gmap_shadow_r2t (sg , saddr , rfte .val , * fake );
14341436 if (rc )
14351437 return rc ;
1438+ kvm -> stat .gmap_shadow_r1_entry ++ ;
14361439 }
14371440 fallthrough ;
14381441 case ASCE_TYPE_REGION2 : {
@@ -1461,6 +1464,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
14611464 rc = gmap_shadow_r3t (sg , saddr , rste .val , * fake );
14621465 if (rc )
14631466 return rc ;
1467+ kvm -> stat .gmap_shadow_r2_entry ++ ;
14641468 }
14651469 fallthrough ;
14661470 case ASCE_TYPE_REGION3 : {
@@ -1498,6 +1502,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
14981502 rc = gmap_shadow_sgt (sg , saddr , rtte .val , * fake );
14991503 if (rc )
15001504 return rc ;
1505+ kvm -> stat .gmap_shadow_r3_entry ++ ;
15011506 }
15021507 fallthrough ;
15031508 case ASCE_TYPE_SEGMENT : {
@@ -1531,6 +1536,7 @@ static int kvm_s390_shadow_tables(struct gmap *sg, unsigned long saddr,
15311536 rc = gmap_shadow_pgt (sg , saddr , ste .val , * fake );
15321537 if (rc )
15331538 return rc ;
1539+ kvm -> stat .gmap_shadow_sg_entry ++ ;
15341540 }
15351541 }
15361542 /* Return the parent address of the page table */
@@ -1601,6 +1607,7 @@ int kvm_s390_shadow_fault(struct kvm_vcpu *vcpu, struct gmap *sg,
16011607 pte .p |= dat_protection ;
16021608 if (!rc )
16031609 rc = gmap_shadow_page (sg , saddr , __pte (pte .val ));
1610+ vcpu -> kvm -> stat .gmap_shadow_pg_entry ++ ;
16041611 ipte_unlock (vcpu -> kvm );
16051612 mmap_read_unlock (sg -> mm );
16061613 return rc ;
0 commit comments