Skip to content

Commit 99d5475

Browse files
committed
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 <[email protected]>
1 parent ba72dc1 commit 99d5475

File tree

1 file changed

+7
-0
lines changed
  • arch/powerpc/platforms/powernv

1 file changed

+7
-0
lines changed

arch/powerpc/platforms/powernv/setup.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ static void init_fw_feat_flags(struct device_node *np)
7878
if (fw_feature_is("enabled", "fw-count-cache-disabled", np))
7979
security_ftr_set(SEC_FTR_COUNT_CACHE_DISABLED);
8080

81+
if (fw_feature_is("enabled", "fw-count-cache-flush-bcctr2,0,0", np))
82+
security_ftr_set(SEC_FTR_BCCTR_FLUSH_ASSIST);
83+
84+
if (fw_feature_is("enabled", "needs-count-cache-flush-on-context-switch", np))
85+
security_ftr_set(SEC_FTR_FLUSH_COUNT_CACHE);
86+
8187
/*
8288
* The features below are enabled by default, so we instead look to see
8389
* if firmware has *disabled* them, and clear them if so.
@@ -124,6 +130,7 @@ static void pnv_setup_rfi_flush(void)
124130
security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV));
125131

126132
setup_rfi_flush(type, enable);
133+
setup_count_cache_flush();
127134
}
128135

129136
static void __init pnv_setup_arch(void)

0 commit comments

Comments
 (0)