powerpc/64: Enable use of radix MMU under hypervisor on POWER9
To use radix as a guest, we first need to tell the hypervisor via the ibm,client-architecture call first that we support POWER9 and architecture v3.00, and that we can do either radix or hash and that we would like to choose later using an hcall (the H_REGISTER_PROC_TBL hcall). Then we need to check whether the hypervisor agreed to us using radix. We need to do this very early on in the kernel boot process before any of the MMU initialization is done. If the hypervisor doesn't agree, we can't use radix and therefore clear the radix MMU feature bit. Later, when we have set up our process table, which points to the radix tree for each process, we need to install that using the H_REGISTER_PROC_TBL hcall. Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
3f4ab2f83b
commit
cc3d294013
@@ -609,6 +609,29 @@ static int __init disable_bulk_remove(char *str)
|
||||
|
||||
__setup("bulk_remove=", disable_bulk_remove);
|
||||
|
||||
/* Actually only used for radix, so far */
|
||||
static int pseries_lpar_register_process_table(unsigned long base,
|
||||
unsigned long page_size, unsigned long table_size)
|
||||
{
|
||||
long rc;
|
||||
unsigned long flags = PROC_TABLE_NEW;
|
||||
|
||||
if (radix_enabled())
|
||||
flags |= PROC_TABLE_RADIX | PROC_TABLE_GTSE;
|
||||
for (;;) {
|
||||
rc = plpar_hcall_norets(H_REGISTER_PROC_TBL, flags, base,
|
||||
page_size, table_size);
|
||||
if (!H_IS_LONG_BUSY(rc))
|
||||
break;
|
||||
mdelay(get_longbusy_msecs(rc));
|
||||
}
|
||||
if (rc != H_SUCCESS) {
|
||||
pr_err("Failed to register process table (rc=%ld)\n", rc);
|
||||
BUG();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
void __init hpte_init_pseries(void)
|
||||
{
|
||||
mmu_hash_ops.hpte_invalidate = pSeries_lpar_hpte_invalidate;
|
||||
@@ -622,6 +645,12 @@ void __init hpte_init_pseries(void)
|
||||
mmu_hash_ops.hugepage_invalidate = pSeries_lpar_hugepage_invalidate;
|
||||
}
|
||||
|
||||
void radix_init_pseries(void)
|
||||
{
|
||||
pr_info("Using radix MMU under hypervisor\n");
|
||||
register_process_table = pseries_lpar_register_process_table;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PPC_SMLPAR
|
||||
#define CMO_FREE_HINT_DEFAULT 1
|
||||
static int cmo_free_hint_flag = CMO_FREE_HINT_DEFAULT;
|
||||
|
Reference in New Issue
Block a user