summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powernv
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2018-07-24 01:07:56 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2018-08-08 00:32:27 +1000
commit99d54754d3d5f896a8f616b0b6520662bc99d66b (patch)
treeea94521127a98989dcc9884e731f2f663c51eb0a /arch/powerpc/platforms/powernv
parentba72dc171954b782a79d25e0f4b3ed91090c3b1e (diff)
downloadop-kernel-dev-99d54754d3d5f896a8f616b0b6520662bc99d66b.zip
op-kernel-dev-99d54754d3d5f896a8f616b0b6520662bc99d66b.tar.gz
powerpc/powernv: Query firmware for count cache flush settings
Look for fw-features properties to determine the appropriate settings for the count cache flush, and then call the generic powerpc code to set it up based on the security feature flags. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv')
-rw-r--r--arch/powerpc/platforms/powernv/setup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 3fc2530..adddde0 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -78,6 +78,12 @@ static void init_fw_feat_flags(struct device_node *np)
if (fw_feature_is("enabled", "fw-count-cache-disabled", np))
security_ftr_set(SEC_FTR_COUNT_CACHE_DISABLED);
+ if (fw_feature_is("enabled", "fw-count-cache-flush-bcctr2,0,0", np))
+ security_ftr_set(SEC_FTR_BCCTR_FLUSH_ASSIST);
+
+ if (fw_feature_is("enabled", "needs-count-cache-flush-on-context-switch", np))
+ security_ftr_set(SEC_FTR_FLUSH_COUNT_CACHE);
+
/*
* The features below are enabled by default, so we instead look to see
* if firmware has *disabled* them, and clear them if so.
@@ -124,6 +130,7 @@ static void pnv_setup_rfi_flush(void)
security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV));
setup_rfi_flush(type, enable);
+ setup_count_cache_flush();
}
static void __init pnv_setup_arch(void)
OpenPOWER on IntegriCloud