Skip to content

Commit 0063d61

Browse files
Mauricio Faria de Oliveirampe
authored andcommitted
powerpc/rfi-flush: Differentiate enabled and patched flush types
Currently the rfi-flush messages print 'Using <type> flush' for all enabled_flush_types, but that is not necessarily true -- as now the fallback flush is always enabled on pseries, but the fixup function overwrites its nop/branch slot with other flush types, if available. So, replace the 'Using <type> flush' messages with '<type> flush is available'. Also, print the patched flush types in the fixup function, so users can know what is (not) being used (e.g., the slower, fallback flush, or no flush type at all if flush is disabled via the debugfs switch). Suggested-by: Michael Ellerman <[email protected]> Signed-off-by: Mauricio Faria de Oliveira <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 84749a5 commit 0063d61

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

arch/powerpc/kernel/setup_64.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -884,15 +884,15 @@ static void init_fallback_flush(void)
884884
void setup_rfi_flush(enum l1d_flush_type types, bool enable)
885885
{
886886
if (types & L1D_FLUSH_FALLBACK) {
887-
pr_info("rfi-flush: Using fallback displacement flush\n");
887+
pr_info("rfi-flush: fallback displacement flush available\n");
888888
init_fallback_flush();
889889
}
890890

891891
if (types & L1D_FLUSH_ORI)
892-
pr_info("rfi-flush: Using ori type flush\n");
892+
pr_info("rfi-flush: ori type flush available\n");
893893

894894
if (types & L1D_FLUSH_MTTRIG)
895-
pr_info("rfi-flush: Using mttrig type flush\n");
895+
pr_info("rfi-flush: mttrig type flush available\n");
896896

897897
enabled_flush_types = types;
898898

arch/powerpc/lib/feature-fixups.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,14 @@ void do_rfi_flush_fixups(enum l1d_flush_type types)
153153
patch_instruction(dest + 2, instrs[2]);
154154
}
155155

156-
printk(KERN_DEBUG "rfi-flush: patched %d locations\n", i);
156+
printk(KERN_DEBUG "rfi-flush: patched %d locations (%s flush)\n", i,
157+
(types == L1D_FLUSH_NONE) ? "no" :
158+
(types == L1D_FLUSH_FALLBACK) ? "fallback displacement" :
159+
(types & L1D_FLUSH_ORI) ? (types & L1D_FLUSH_MTTRIG)
160+
? "ori+mttrig type"
161+
: "ori type" :
162+
(types & L1D_FLUSH_MTTRIG) ? "mttrig type"
163+
: "unknown");
157164
}
158165
#endif /* CONFIG_PPC_BOOK3S_64 */
159166

0 commit comments

Comments
 (0)