Commit 99d54754 authored by Michael Ellerman's avatar Michael Ellerman

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: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent ba72dc17
...@@ -78,6 +78,12 @@ static void init_fw_feat_flags(struct device_node *np) ...@@ -78,6 +78,12 @@ static void init_fw_feat_flags(struct device_node *np)
if (fw_feature_is("enabled", "fw-count-cache-disabled", np)) if (fw_feature_is("enabled", "fw-count-cache-disabled", np))
security_ftr_set(SEC_FTR_COUNT_CACHE_DISABLED); 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 * The features below are enabled by default, so we instead look to see
* if firmware has *disabled* them, and clear them if so. * if firmware has *disabled* them, and clear them if so.
...@@ -124,6 +130,7 @@ static void pnv_setup_rfi_flush(void) ...@@ -124,6 +130,7 @@ static void pnv_setup_rfi_flush(void)
security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV)); security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV));
setup_rfi_flush(type, enable); setup_rfi_flush(type, enable);
setup_count_cache_flush();
} }
static void __init pnv_setup_arch(void) static void __init pnv_setup_arch(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment