@@ -11,6 +11,11 @@ void qemu_init_vcpu(CPUState *cpu)
{
}
+int topology_supports_topoext(int max_cores, int max_threads)
+{
+ return true;
+}
+
/* User mode emulation does not support record/replay yet. */
bool replay_exception(void)
@@ -1979,6 +1979,19 @@ static void qemu_dummy_start_vcpu(CPUState *cpu)
QEMU_THREAD_JOINABLE);
}
+/*
+ * Check if we can support topoext feature with this topology
+ * Fail if number of cores are beyond the supported cores
+ * or number of threads are more than supported threads
+ */
+int topology_supports_topoext(int max_cores, int max_threads)
+{
+ if ((smp_cores > max_cores) || (smp_threads > max_threads)) {
+ return false;
+ }
+ return true;
+}
+
void qemu_init_vcpu(CPUState *cpu)
{
cpu->nr_cores = smp_cores;
@@ -1004,6 +1004,15 @@ void end_exclusive(void);
*/
void qemu_init_vcpu(CPUState *cpu);
+/**
+ * topology_supports_topoext:
+ * @max_cores: Max cores topoext feature can support
+ * @max_threads: Max threads topoext feature can support
+ *
+ * Return true if topology can be supported else return false
+ */
+int topology_supports_topoext(int max_cores, int max_threads);
+
#define SSTEP_ENABLE 0x1 /* Enable simulated HW single stepping */
#define SSTEP_NOIRQ 0x2 /* Do not use IRQ while single stepping */
#define SSTEP_NOTIMER 0x4 /* Do not Timers while single stepping */
Add new function topology_supports_topoext to verify if we can support topoext feature. Will be used to enable/disable topoext feature. Signed-off-by: Babu Moger <babu.moger@amd.com> --- accel/tcg/user-exec-stub.c | 5 +++++ cpus.c | 13 +++++++++++++ include/qom/cpu.h | 9 +++++++++ 3 files changed, 27 insertions(+)