summaryrefslogtreecommitdiffstats
path: root/include/linux/cpu.h
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2019-09-16 12:22:56 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2019-09-24 07:37:28 -0400
commite1572f1d08be57a5412a464cff0712a23cd0b73e (patch)
treed1ee6d7671cd371c765778c9a73777a823dfe848 /include/linux/cpu.h
parenta073d7e3ad687a7ef32b65affe80faa7ce89bf92 (diff)
cpu/SMT: create and export cpu_smt_possible()
KVM needs to know if SMT is theoretically possible, this means it is supported and not forcefully disabled ('nosmt=force'). Create and export cpu_smt_possible() answering this question. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/linux/cpu.h')
-rw-r--r--include/linux/cpu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 88dc0c653925..d0633ebdaa9c 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -201,12 +201,14 @@ enum cpuhp_smt_control {
201extern enum cpuhp_smt_control cpu_smt_control; 201extern enum cpuhp_smt_control cpu_smt_control;
202extern void cpu_smt_disable(bool force); 202extern void cpu_smt_disable(bool force);
203extern void cpu_smt_check_topology(void); 203extern void cpu_smt_check_topology(void);
204extern bool cpu_smt_possible(void);
204extern int cpuhp_smt_enable(void); 205extern int cpuhp_smt_enable(void);
205extern int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval); 206extern int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval);
206#else 207#else
207# define cpu_smt_control (CPU_SMT_NOT_IMPLEMENTED) 208# define cpu_smt_control (CPU_SMT_NOT_IMPLEMENTED)
208static inline void cpu_smt_disable(bool force) { } 209static inline void cpu_smt_disable(bool force) { }
209static inline void cpu_smt_check_topology(void) { } 210static inline void cpu_smt_check_topology(void) { }
211static inline bool cpu_smt_possible(void) { return false; }
210static inline int cpuhp_smt_enable(void) { return 0; } 212static inline int cpuhp_smt_enable(void) { return 0; }
211static inline int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) { return 0; } 213static inline int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval) { return 0; }
212#endif 214#endif