]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
powerpc/powernv: Query firmware for count cache flush settings
authorMichael Ellerman <mpe@ellerman.id.au>
Mon, 23 Jul 2018 15:07:56 +0000 (01:07 +1000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 23 Apr 2019 15:48:55 +0000 (17:48 +0200)
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.

BugLink: https://bugs.launchpad.net/bugs/1822870
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
(cherry picked from commit 99d54754d3d5f896a8f616b0b6520662bc99d66b)
Signed-off-by: Manoj Iyer <manoj.iyer@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/powerpc/platforms/powernv/setup.c

index be7eac602402102309f9103186a2a75eb8e4676f..354ca97a74b54e640d1d13eb5a26344bfa3377c3 100644 (file)
@@ -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)