@@ -209,6 +209,11 @@ long arch_do_sysctl(
ret = -EOPNOTSUPP;
break;
}
+ if ( sched_disable_smt_switching )
+ {
+ ret = -EBUSY;
+ break;
+ }
plug = op == XEN_SYSCTL_CPU_HOTPLUG_SMT_ENABLE;
fn = smt_up_down_helper;
hcpu = _p(plug);
@@ -63,6 +63,7 @@ integer_param("sched_ratelimit_us", sched_ratelimit_us);
/* Number of vcpus per struct sched_unit. */
static unsigned int __read_mostly sched_granularity = 1;
+bool __read_mostly sched_disable_smt_switching;
const cpumask_t *sched_res_mask = &cpumask_all;
/* Common lock for free cpus. */
@@ -1037,6 +1037,7 @@ static inline bool is_iommu_enabled(const struct domain *d)
}
extern bool sched_smt_power_savings;
+extern bool sched_disable_smt_switching;
extern enum cpufreq_controller {
FREQCTL_none, FREQCTL_dom0_kernel, FREQCTL_xen