aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/security.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/arch/powerpc/kernel/security.c b/arch/powerpc/kernel/security.c
index 9b8631533e02..b33bafb8fcea 100644
--- a/arch/powerpc/kernel/security.c
+++ b/arch/powerpc/kernel/security.c
@@ -190,29 +190,22 @@ ssize_t cpu_show_spectre_v2(struct device *dev, struct device_attribute *attr, c
190 bcs = security_ftr_enabled(SEC_FTR_BCCTRL_SERIALISED); 190 bcs = security_ftr_enabled(SEC_FTR_BCCTRL_SERIALISED);
191 ccd = security_ftr_enabled(SEC_FTR_COUNT_CACHE_DISABLED); 191 ccd = security_ftr_enabled(SEC_FTR_COUNT_CACHE_DISABLED);
192 192
193 if (bcs || ccd || count_cache_flush_type != COUNT_CACHE_FLUSH_NONE) { 193 if (bcs || ccd) {
194 bool comma = false;
195 seq_buf_printf(&s, "Mitigation: "); 194 seq_buf_printf(&s, "Mitigation: ");
196 195
197 if (bcs) { 196 if (bcs)
198 seq_buf_printf(&s, "Indirect branch serialisation (kernel only)"); 197 seq_buf_printf(&s, "Indirect branch serialisation (kernel only)");
199 comma = true;
200 }
201 198
202 if (ccd) { 199 if (bcs && ccd)
203 if (comma)
204 seq_buf_printf(&s, ", ");
205 seq_buf_printf(&s, "Indirect branch cache disabled");
206 comma = true;
207 }
208
209 if (comma)
210 seq_buf_printf(&s, ", "); 200 seq_buf_printf(&s, ", ");
211 201
212 seq_buf_printf(&s, "Software count cache flush"); 202 if (ccd)
203 seq_buf_printf(&s, "Indirect branch cache disabled");
204 } else if (count_cache_flush_type != COUNT_CACHE_FLUSH_NONE) {
205 seq_buf_printf(&s, "Mitigation: Software count cache flush");
213 206
214 if (count_cache_flush_type == COUNT_CACHE_FLUSH_HW) 207 if (count_cache_flush_type == COUNT_CACHE_FLUSH_HW)
215 seq_buf_printf(&s, "(hardware accelerated)"); 208 seq_buf_printf(&s, " (hardware accelerated)");
216 } else if (btb_flush_enabled) { 209 } else if (btb_flush_enabled) {
217 seq_buf_printf(&s, "Mitigation: Branch predictor state flush"); 210 seq_buf_printf(&s, "Mitigation: Branch predictor state flush");
218 } else { 211 } else {