@@ -546,6 +546,24 @@ static int pSeries_lpar_hpte_removebolted(unsigned long ea,
546
546
return 0 ;
547
547
}
548
548
549
+
550
+ static inline unsigned long compute_slot (real_pte_t pte ,
551
+ unsigned long vpn ,
552
+ unsigned long index ,
553
+ unsigned long shift ,
554
+ int ssize )
555
+ {
556
+ unsigned long slot , hash , hidx ;
557
+
558
+ hash = hpt_hash (vpn , shift , ssize );
559
+ hidx = __rpte_to_hidx (pte , index );
560
+ if (hidx & _PTEIDX_SECONDARY )
561
+ hash = ~hash ;
562
+ slot = (hash & htab_hash_mask ) * HPTES_PER_GROUP ;
563
+ slot += hidx & _PTEIDX_GROUP_IX ;
564
+ return slot ;
565
+ }
566
+
549
567
/*
550
568
* Take a spinlock around flushes to avoid bouncing the hypervisor tlbie
551
569
* lock.
@@ -558,7 +576,7 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
558
576
struct ppc64_tlb_batch * batch = this_cpu_ptr (& ppc64_tlb_batch );
559
577
int lock_tlbie = !mmu_has_feature (MMU_FTR_LOCKLESS_TLBIE );
560
578
unsigned long param [PLPAR_HCALL9_BUFSIZE ];
561
- unsigned long hash , index , shift , hidx , slot ;
579
+ unsigned long index , shift , slot ;
562
580
real_pte_t pte ;
563
581
int psize , ssize ;
564
582
@@ -572,12 +590,7 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
572
590
vpn = batch -> vpn [i ];
573
591
pte = batch -> pte [i ];
574
592
pte_iterate_hashed_subpages (pte , psize , vpn , index , shift ) {
575
- hash = hpt_hash (vpn , shift , ssize );
576
- hidx = __rpte_to_hidx (pte , index );
577
- if (hidx & _PTEIDX_SECONDARY )
578
- hash = ~hash ;
579
- slot = (hash & htab_hash_mask ) * HPTES_PER_GROUP ;
580
- slot += hidx & _PTEIDX_GROUP_IX ;
593
+ slot = compute_slot (pte , vpn , index , shift , ssize );
581
594
if (!firmware_has_feature (FW_FEATURE_BULK_REMOVE )) {
582
595
/*
583
596
* lpar doesn't use the passed actual page size
0 commit comments