Received: from eggs.gnu.org ([140.186.70.92]:60226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9SN5-0003PP-Sc for qemu-devel@nongnu.org; Thu, 29 Sep 2011 21:58:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9SN4-0006iH-LW for qemu-devel@nongnu.org; Thu, 29 Sep 2011 21:58:39 -0400 Received: from ozlabs.org ([203.10.76.45]:40964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9SN4-0006eF-8T for qemu-devel@nongnu.org; Thu, 29 Sep 2011 21:58:38 -0400 Date: Fri, 30 Sep 2011 11:02:24 +1000 From: David Gibson Message-ID: <20110930010224.GA4704@yookeroo.fritz.box> References: <1317278706-16105-1-git-send-email-david@gibson.dropbear.id.au> <1317278706-16105-2-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 1/3] pseries: Support SMT systems for KVM Book3S-HV List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: qemu-devel@nongnu.org On Thu, Sep 29, 2011 at 03:17:11PM +0200, Alexander Graf wrote: > On 29.09.2011, at 08:45, David Gibson wrote: [snip] > > diff --git a/hw/spapr.c b/hw/spapr.c > > index b118975..ba9ae1c 100644 > > --- a/hw/spapr.c > > +++ b/hw/spapr.c > > @@ -29,6 +29,9 @@ > > #include "elf.h" > > #include "net.h" > > #include "blockdev.h" > > +#include "cpus.h" > > +#include "kvm.h" > > +#include "kvm_ppc.h" > > > > #include "hw/boards.h" > > #include "hw/ppc.h" > > @@ -103,6 +106,7 @@ static void *spapr_create_fdt_skel(const char *cpu_model, > > uint32_t interrupt_server_ranges_prop[] = {0, cpu_to_be32(smp_cpus)}; > > int i; > > char *modelname; > > + int smt = kvmppc_smt_threads(); > > > > #define _FDT(exp) \ > > do { \ > > @@ -162,13 +166,17 @@ static void *spapr_create_fdt_skel(const char *cpu_model, > > > > for (env = first_cpu; env != NULL; env = env->next_cpu) { > > int index = env->cpu_index; > > - uint32_t gserver_prop[] = {cpu_to_be32(index), 0}; /* HACK! */ > > + uint32_t servers_prop[smp_threads]; > > + uint32_t gservers_prop[smp_threads * 2]; > > char *nodename; > > uint32_t segs[] = {cpu_to_be32(28), cpu_to_be32(40), > > 0xffffffff, 0xffffffff}; > > uint32_t tbfreq = kvm_enabled() ? kvmppc_get_tbfreq() : TIMEBASE_FREQ; > > uint32_t cpufreq = kvm_enabled() ? kvmppc_get_clockfreq() : 1000000000; > > > > + if ((index % smt) != 0) > > + continue; > > Please run through checkpatch.pl Actually, checkpatch.pl didn't spot that one, for zome bizarre reason. Fixed, nonetheless. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson