Skip to content

Commit

Permalink
powerpc/powernv: Query firmware for count cache flush settings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mpe committed Aug 7, 2018
1 parent ba72dc1 commit 99d5475
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/powerpc/platforms/powernv/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 99d5475

Please sign in to comment.