Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Aneesh Kumar K.V and committed by
Michael Ellerman
4b7a3504 56547411

+4 -5
+4 -5
arch/powerpc/mm/hash_utils_64.c
··· 714 714 #endif /* CONFIG_MEMORY_HOTPLUG */ 715 715 716 716 static void __init hash_init_partition_table(phys_addr_t hash_table, 717 - unsigned long pteg_count) 717 + unsigned long htab_size) 718 718 { 719 719 unsigned long ps_field; 720 - unsigned long htab_size; 721 720 unsigned long patb_size = 1UL << PATB_SIZE_SHIFT; 722 721 723 722 /* ··· 724 725 * We can ignore that for lpid 0 725 726 */ 726 727 ps_field = 0; 727 - htab_size = __ilog2(pteg_count) - 11; 728 + htab_size = __ilog2(htab_size) - 18; 728 729 729 730 BUILD_BUG_ON_MSG((PATB_SIZE_SHIFT > 24), "Partition table size too large."); 730 731 partition_tb = __va(memblock_alloc_base(patb_size, patb_size, ··· 810 811 htab_address = __va(table); 811 812 812 813 /* htab absolute addr + encoded htabsize */ 813 - _SDR1 = table + __ilog2(pteg_count) - 11; 814 + _SDR1 = table + __ilog2(htab_size_bytes) - 18; 814 815 815 816 /* Initialize the HPT with no entries */ 816 817 memset((void *)table, 0, htab_size_bytes); ··· 819 820 /* Set SDR1 */ 820 821 mtspr(SPRN_SDR1, _SDR1); 821 822 else 822 - hash_init_partition_table(table, pteg_count); 823 + hash_init_partition_table(table, htab_size_bytes); 823 824 } 824 825 825 826 prot = pgprot_val(PAGE_KERNEL);