summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/asm-prototypes.h
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2018-07-24 01:07:54 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2018-08-08 00:32:26 +1000
commitee13cb249fabdff8b90aaff61add347749280087 (patch)
tree6b37d585ba08ac9349db5392bc2ceff65dce1c39 /arch/powerpc/include/asm/asm-prototypes.h
parentdc8c6cce9a26a51fc19961accb978217a3ba8c75 (diff)
powerpc/64s: Add support for software count cache flush
Some CPU revisions support a mode where the count cache needs to be flushed by software on context switch. Additionally some revisions may have a hardware accelerated flush, in which case the software flush sequence can be shortened. If we detect the appropriate flag from firmware we patch a branch into _switch() which takes us to a count cache flush sequence. That sequence in turn may be patched to return early if we detect that the CPU supports accelerating the flush sequence in hardware. Add debugfs support for reporting the state of the flush, as well as runtime disabling it. And modify the spectre_v2 sysfs file to report the state of the software flush. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/asm-prototypes.h')
-rw-r--r--arch/powerpc/include/asm/asm-prototypes.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h
index 769567b66c0c..70fdc5b9b9fb 100644
--- a/arch/powerpc/include/asm/asm-prototypes.h
+++ b/arch/powerpc/include/asm/asm-prototypes.h
@@ -143,4 +143,10 @@ struct kvm_vcpu;
void _kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu, u64 guest_msr);
void _kvmppc_save_tm_pr(struct kvm_vcpu *vcpu, u64 guest_msr);
+/* Patch sites */
+extern s32 patch__call_flush_count_cache;
+extern s32 patch__flush_count_cache_return;
+
+extern long flush_count_cache;
+
#endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */