On Mon, Dec 16, 2013 at 03:54:57PM +0800, jun muzi wrote: > Type error, change smp_cores to nr_cores and change smp_threads to > nr_threads. But using smp_cores can work well. As it is not the same with > explanatory note, so change it. > > Signed-off-by: Jun Li <junm...@gmail.com> > --- > target-i386/topology.h | 20 ++++++++++++++++++++ [...] > @@ -126,6 +139,13 @@ static inline apic_id_t > x86_apicid_from_cpu_idx(unsigned nr_cores, > unsigned cpu_index) > { > unsigned pkg_id, core_id, smt_id; > + > + /* check whether nr_cores and nr_threads is a power of 2 */ > + if (!is_2_power(nr_cores) || !is_2_power(nr_threads)) { > + nr_cores = 1; > + nr_threads = 1; > + }
I don't understand what you are trying to do here. The whole point of the topology.h file is to make sure the right CPU topology is exposed to the guest when nr_cores and nr_threads are not powers of 2. -- Eduardo