]>
Commit | Line | Data |
---|---|---|
261fc112 GKH |
1 | From foo@baz Fri Mar 29 15:53:50 CET 2019 |
2 | From: Michael Ellerman <mpe@ellerman.id.au> | |
3 | Date: Fri, 29 Mar 2019 22:26:07 +1100 | |
6f859e40 | 4 | Subject: powerpc/powernv: Query firmware for count cache flush settings |
261fc112 GKH |
5 | To: stable@vger.kernel.org, gregkh@linuxfoundation.org |
6 | Cc: linuxppc-dev@ozlabs.org, diana.craciun@nxp.com, msuchanek@suse.de, christophe.leroy@c-s.fr | |
7 | Message-ID: <20190329112620.14489-20-mpe@ellerman.id.au> | |
8 | ||
9 | From: Michael Ellerman <mpe@ellerman.id.au> | |
10 | ||
11 | commit 99d54754d3d5f896a8f616b0b6520662bc99d66b upstream. | |
12 | ||
13 | Look for fw-features properties to determine the appropriate settings | |
14 | for the count cache flush, and then call the generic powerpc code to | |
15 | set it up based on the security feature flags. | |
16 | ||
17 | Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | --- | |
20 | arch/powerpc/platforms/powernv/setup.c | 7 +++++++ | |
21 | 1 file changed, 7 insertions(+) | |
22 | ||
23 | --- a/arch/powerpc/platforms/powernv/setup.c | |
24 | +++ b/arch/powerpc/platforms/powernv/setup.c | |
25 | @@ -77,6 +77,12 @@ static void init_fw_feat_flags(struct de | |
26 | if (fw_feature_is("enabled", "fw-count-cache-disabled", np)) | |
27 | security_ftr_set(SEC_FTR_COUNT_CACHE_DISABLED); | |
28 | ||
29 | + if (fw_feature_is("enabled", "fw-count-cache-flush-bcctr2,0,0", np)) | |
30 | + security_ftr_set(SEC_FTR_BCCTR_FLUSH_ASSIST); | |
31 | + | |
32 | + if (fw_feature_is("enabled", "needs-count-cache-flush-on-context-switch", np)) | |
33 | + security_ftr_set(SEC_FTR_FLUSH_COUNT_CACHE); | |
34 | + | |
35 | /* | |
36 | * The features below are enabled by default, so we instead look to see | |
37 | * if firmware has *disabled* them, and clear them if so. | |
38 | @@ -123,6 +129,7 @@ static void pnv_setup_rfi_flush(void) | |
39 | security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV)); | |
40 | ||
41 | setup_rfi_flush(type, enable); | |
42 | + setup_count_cache_flush(); | |
43 | } | |
44 | ||
45 | static void __init pnv_setup_arch(void) |