diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2016-07-13 05:35:26 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-07-17 02:42:53 -0400 |
commit | 4b7a350480506bf292193e9c1db6fc19d57321ec (patch) | |
tree | 23bb8229102f9fb93e72db399e4d838805b84913 /arch/powerpc/mm | |
parent | 56547411a07b0aabf55ce8b841dfdb7daced1250 (diff) |
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>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 4f0fd470ded4..7d0955e04f08 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -714,10 +714,9 @@ int remove_section_mapping(unsigned long start, unsigned long end) | |||
714 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 714 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
715 | 715 | ||
716 | static void __init hash_init_partition_table(phys_addr_t hash_table, | 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 | unsigned long ps_field; | 719 | unsigned long ps_field; |
720 | unsigned long htab_size; | ||
721 | unsigned long patb_size = 1UL << PATB_SIZE_SHIFT; | 720 | unsigned long patb_size = 1UL << PATB_SIZE_SHIFT; |
722 | 721 | ||
723 | /* | 722 | /* |
@@ -725,7 +724,7 @@ static void __init hash_init_partition_table(phys_addr_t hash_table, | |||
725 | * We can ignore that for lpid 0 | 724 | * We can ignore that for lpid 0 |
726 | */ | 725 | */ |
727 | ps_field = 0; | 726 | ps_field = 0; |
728 | htab_size = __ilog2(pteg_count) - 11; | 727 | htab_size = __ilog2(htab_size) - 18; |
729 | 728 | ||
730 | BUILD_BUG_ON_MSG((PATB_SIZE_SHIFT > 24), "Partition table size too large."); | 729 | BUILD_BUG_ON_MSG((PATB_SIZE_SHIFT > 24), "Partition table size too large."); |
731 | partition_tb = __va(memblock_alloc_base(patb_size, patb_size, | 730 | partition_tb = __va(memblock_alloc_base(patb_size, patb_size, |
@@ -811,7 +810,7 @@ static void __init htab_initialize(void) | |||
811 | htab_address = __va(table); | 810 | htab_address = __va(table); |
812 | 811 | ||
813 | /* htab absolute addr + encoded htabsize */ | 812 | /* htab absolute addr + encoded htabsize */ |
814 | _SDR1 = table + __ilog2(pteg_count) - 11; | 813 | _SDR1 = table + __ilog2(htab_size_bytes) - 18; |
815 | 814 | ||
816 | /* Initialize the HPT with no entries */ | 815 | /* Initialize the HPT with no entries */ |
817 | memset((void *)table, 0, htab_size_bytes); | 816 | memset((void *)table, 0, htab_size_bytes); |
@@ -820,7 +819,7 @@ static void __init htab_initialize(void) | |||
820 | /* Set SDR1 */ | 819 | /* Set SDR1 */ |
821 | mtspr(SPRN_SDR1, _SDR1); | 820 | mtspr(SPRN_SDR1, _SDR1); |
822 | else | 821 | else |
823 | hash_init_partition_table(table, pteg_count); | 822 | hash_init_partition_table(table, htab_size_bytes); |
824 | } | 823 | } |
825 | 824 | ||
826 | prot = pgprot_val(PAGE_KERNEL); | 825 | prot = pgprot_val(PAGE_KERNEL); |