Skip to content

Commit 4b7a350

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm/hash: Update SDR1 size encoding as documented in ISA 3.0
ISA 3.0 document hash table size in bytes = 2^(HTABSIZE + 18) No functionality change by this patch. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 5654741 commit 4b7a350

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

arch/powerpc/mm/hash_utils_64.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -714,18 +714,17 @@ int remove_section_mapping(unsigned long start, unsigned long end)
714714
#endif /* CONFIG_MEMORY_HOTPLUG */
715715

716716
static void __init hash_init_partition_table(phys_addr_t hash_table,
717-
unsigned long pteg_count)
717+
unsigned long htab_size)
718718
{
719719
unsigned long ps_field;
720-
unsigned long htab_size;
721720
unsigned long patb_size = 1UL << PATB_SIZE_SHIFT;
722721

723722
/*
724723
* slb llp encoding for the page size used in VPM real mode.
725724
* We can ignore that for lpid 0
726725
*/
727726
ps_field = 0;
728-
htab_size = __ilog2(pteg_count) - 11;
727+
htab_size = __ilog2(htab_size) - 18;
729728

730729
BUILD_BUG_ON_MSG((PATB_SIZE_SHIFT > 24), "Partition table size too large.");
731730
partition_tb = __va(memblock_alloc_base(patb_size, patb_size,
@@ -811,7 +810,7 @@ static void __init htab_initialize(void)
811810
htab_address = __va(table);
812811

813812
/* htab absolute addr + encoded htabsize */
814-
_SDR1 = table + __ilog2(pteg_count) - 11;
813+
_SDR1 = table + __ilog2(htab_size_bytes) - 18;
815814

816815
/* Initialize the HPT with no entries */
817816
memset((void *)table, 0, htab_size_bytes);
@@ -820,7 +819,7 @@ static void __init htab_initialize(void)
820819
/* Set SDR1 */
821820
mtspr(SPRN_SDR1, _SDR1);
822821
else
823-
hash_init_partition_table(table, pteg_count);
822+
hash_init_partition_table(table, htab_size_bytes);
824823
}
825824

826825
prot = pgprot_val(PAGE_KERNEL);

0 commit comments

Comments
 (0)