[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/20] linux-user: remove #define smp_{cores, threads
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 07/20] linux-user: remove #define smp_{cores, threads} |
Date: |
Tue, 27 Sep 2016 17:12:17 -0300 |
From: Marc-André Lureau <address@hidden>
Those are unneeded now that CPUState nr_{cores,threads} is always
initialized.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Acked-by: David Gibson <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
include/sysemu/cpus.h | 5 +----
target-i386/cpu.c | 8 ++++----
target-ppc/translate_init.c | 3 ++-
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
index fe992a8..3728a1e 100644
--- a/include/sysemu/cpus.h
+++ b/include/sysemu/cpus.h
@@ -29,12 +29,9 @@ void qtest_clock_warp(int64_t dest);
#ifndef CONFIG_USER_ONLY
/* vl.c */
+/* *-user doesn't have configurable SMP topology */
extern int smp_cores;
extern int smp_threads;
-#else
-/* *-user doesn't have configurable SMP topology */
-#define smp_cores 1
-#define smp_threads 1
#endif
void list_cpus(FILE *f, fprintf_function cpu_fprintf, const char *optarg);
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 7a5da99..a5d3b1a 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2498,13 +2498,13 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t count,
switch (count) {
case 0:
- *eax = apicid_core_offset(smp_cores, smp_threads);
- *ebx = smp_threads;
+ *eax = apicid_core_offset(cs->nr_cores, cs->nr_threads);
+ *ebx = cs->nr_threads;
*ecx |= CPUID_TOPOLOGY_LEVEL_SMT;
break;
case 1:
- *eax = apicid_pkg_offset(smp_cores, smp_threads);
- *ebx = smp_cores * smp_threads;
+ *eax = apicid_pkg_offset(cs->nr_cores, cs->nr_threads);
+ *ebx = cs->nr_cores * cs->nr_threads;
*ecx |= CPUID_TOPOLOGY_LEVEL_CORE;
break;
default:
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 407ccb9..b66b40b 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9943,7 +9943,8 @@ static void ppc_cpu_unrealizefn(DeviceState *dev, Error
**errp)
int ppc_get_compat_smt_threads(PowerPCCPU *cpu)
{
- int ret = MIN(smp_threads, kvmppc_smt_threads());
+ CPUState *cs = CPU(cpu);
+ int ret = MIN(cs->nr_threads, kvmppc_smt_threads());
switch (cpu->cpu_version) {
case CPU_POWERPC_LOGICAL_2_05:
--
2.7.4
- [Qemu-devel] [PULL 00/20] x86 and machine queue, 2016-09-27, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 02/20] target-i386: Add a marker to end of the region zeroed on reset, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 01/20] target-i386: Remove unused X86CPUDefinition::xlevel2 field, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 05/20] target-i386: Automatically set level/xlevel/xlevel2 when needed, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 03/20] tests: Add test code for CPUID level/xlevel handling, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 04/20] tests: Test CPUID level handling for old machines, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 06/20] target-i386: Enable CPUID[0x8000000A] if SVM is enabled, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 07/20] linux-user: remove #define smp_{cores, threads},
Eduardo Habkost <=
- [Qemu-devel] [PULL 11/20] target-i386: xsave: Simplify CPUID[0xD, 0].{EAX, EDX} calculation, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 08/20] target-i386: Move feature name arrays inside FeatureWordInfo, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 10/20] target-i386: xsave: Calculate enabled components only once, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 09/20] target-i386: Don't try to enable PT State xsave component, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 13/20] target-i386: xsave: Calculate set of xsave components on realize, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 14/20] target-i386: Move xsave component mask to features array, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 12/20] target-i386: xsave: Helper function to calculate xsave area size, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 16/20] target-i386: Remove has_msr_hv_apic global variable, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 17/20] target-i386: Remove has_msr_hv_tsc global variable, Eduardo Habkost, 2016/09/27
- [Qemu-devel] [PULL 18/20] target-i386: Clear KVM CPUID features if KVM is disabled, Eduardo Habkost, 2016/09/27