Skip to content

Commit 83209bc

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm/radix: Update machine call back to support new HCALL.
This update the machine dep callback such that we can use the same callback to register process table. The interface is updated such that we can easily call H_REGISTER_PROC_TBL hcall. The HCALL itself is introduced in a later patch. No functionality change introduced 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 09cf5bc commit 83209bc

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

arch/powerpc/include/asm/machdep.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ struct machdep_calls {
256256
#ifdef CONFIG_ARCH_RANDOM
257257
int (*get_random_seed)(unsigned long *v);
258258
#endif
259-
int (*update_partition_table)(u64);
259+
int (*register_process_table)(unsigned long base, unsigned long page_size,
260+
unsigned long tbl_size);
260261
};
261262

262263
extern void e500_idle(void);

arch/powerpc/mm/hash_native_64.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,14 @@ static void native_flush_hash_range(unsigned long number, int local)
725725
local_irq_restore(flags);
726726
}
727727

728-
static int native_update_partition_table(u64 patb1)
728+
static int native_register_proc_table(unsigned long base, unsigned long page_size,
729+
unsigned long table_size)
729730
{
731+
unsigned long patb1 = base << 25; /* VSID */
732+
733+
patb1 |= (page_size << 5); /* sllp */
734+
patb1 |= table_size;
735+
730736
partition_tb->patb1 = cpu_to_be64(patb1);
731737
return 0;
732738
}
@@ -743,5 +749,5 @@ void __init hpte_init_native(void)
743749
ppc_md.hugepage_invalidate = native_hugepage_invalidate;
744750

745751
if (cpu_has_feature(CPU_FTR_ARCH_300))
746-
ppc_md.update_partition_table = native_update_partition_table;
752+
ppc_md.register_process_table = native_register_proc_table;
747753
}

arch/powerpc/mm/pgtable-radix.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121

2222
#include <trace/events/thp.h>
2323

24-
static int native_update_partition_table(u64 patb1)
24+
static int native_register_process_table(unsigned long base, unsigned long pg_sz,
25+
unsigned long table_size)
2526
{
27+
unsigned long patb1 = base | table_size | PATB_GR;
28+
2629
partition_tb->patb1 = cpu_to_be64(patb1);
2730
return 0;
2831
}
@@ -168,7 +171,7 @@ static void __init radix_init_pgtable(void)
168171
* of process table here. But our linear mapping also enable us to use
169172
* physical address here.
170173
*/
171-
ppc_md.update_partition_table(__pa(process_tb) | (PRTB_SIZE_SHIFT - 12) | PATB_GR);
174+
ppc_md.register_process_table(__pa(process_tb), 0, PRTB_SIZE_SHIFT - 12);
172175
pr_info("Process table %p and radix root for kernel: %p\n", process_tb, init_mm.pgd);
173176
}
174177

@@ -195,7 +198,7 @@ static void __init radix_init_partition_table(void)
195198

196199
void __init radix_init_native(void)
197200
{
198-
ppc_md.update_partition_table = native_update_partition_table;
201+
ppc_md.register_process_table = native_register_process_table;
199202
}
200203

201204
static int __init get_idx_from_shift(unsigned int shift)

0 commit comments

Comments
 (0)