diff options
author | Kevin Hao <haokexin@gmail.com> | 2016-07-23 14:42:42 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-08-01 11:15:06 +1000 |
commit | c12e6f24d4137822d5019c1f78ac65bd27a3447d (patch) | |
tree | 7ebc50a5a62a36e89dc90e801da4f00e59633622 /arch/powerpc/kernel/cputable.c | |
parent | 4db7327194dba0cb91f274b0f606785a9ee5108d (diff) | |
download | linux-c12e6f24d4137822d5019c1f78ac65bd27a3447d.tar.bz2 |
powerpc: Add option to use jump label for mmu_has_feature()
As we just did for CPU features.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
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/kernel/cputable.c')
-rw-r--r-- | arch/powerpc/kernel/cputable.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index e3da41f8ef93..74248ab18e98 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c @@ -2243,4 +2243,21 @@ void __init cpu_feature_keys_init(void) static_branch_disable(&cpu_feature_keys[i]); } } + +struct static_key_true mmu_feature_keys[NUM_MMU_FTR_KEYS] = { + [0 ... NUM_MMU_FTR_KEYS - 1] = STATIC_KEY_TRUE_INIT +}; +EXPORT_SYMBOL_GPL(mmu_feature_keys); + +void __init mmu_feature_keys_init(void) +{ + int i; + + for (i = 0; i < NUM_MMU_FTR_KEYS; i++) { + unsigned long f = 1ul << i; + + if (!(cur_cpu_spec->mmu_features & f)) + static_branch_disable(&mmu_feature_keys[i]); + } +} #endif |