From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bflyv-0007Jb-0x for qemu-devel@nongnu.org; Fri, 02 Sep 2016 06:45:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bflyo-000602-Vc for qemu-devel@nongnu.org; Fri, 02 Sep 2016 06:45:55 -0400 Received: from 1.mo179.mail-out.ovh.net ([178.33.111.220]:40385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bflyo-0005zq-NH for qemu-devel@nongnu.org; Fri, 02 Sep 2016 06:45:50 -0400 Received: from player698.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo179.mail-out.ovh.net (Postfix) with ESMTP id 69A5A10047B5 for ; Fri, 2 Sep 2016 12:45:49 +0200 (CEST) Date: Fri, 2 Sep 2016 12:45:36 +0200 From: Greg Kurz Message-ID: <20160902124536.16163ac8@bahia.lan> In-Reply-To: <871t12r6fc.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me> References: <1472797976-24210-1-git-send-email-nikunj@linux.vnet.ibm.com> <1472797976-24210-3-git-send-email-nikunj@linux.vnet.ibm.com> <20160902112809.03445602@bahia.lan> <871t12r6fc.fsf@abhimanyu.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 2/4] target-ppc: with MTTCG report more threads List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania Cc: qemu-ppc@nongnu.org, alex.bennee@linaro.org, david@gibson.dropbear.id.au, rth@twiddle.net, qemu-devel@nongnu.org On Fri, 02 Sep 2016 15:04:47 +0530 Nikunj A Dadhania wrote: > Greg Kurz writes: > > > On Fri, 2 Sep 2016 12:02:54 +0530 > > Nikunj A Dadhania wrote: > > > >> Signed-off-by: Nikunj A Dadhania > >> --- > > > > Shouldn't this patch be the last one, when all other issues have been addressed ? > > > >> target-ppc/kvm.c | 2 +- > >> target-ppc/kvm_ppc.h | 2 +- > >> 2 files changed, 2 insertions(+), 2 deletions(-) > >> > >> diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c > >> index dcb68b9..20eb450 100644 > >> --- a/target-ppc/kvm.c > >> +++ b/target-ppc/kvm.c > >> @@ -2090,7 +2090,7 @@ void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy) > >> > >> int kvmppc_smt_threads(void) > >> { > >> - return cap_ppc_smt ? cap_ppc_smt : 1; > >> + return cap_ppc_smt ? cap_ppc_smt : 8; > > > > If KVM is there but does not support SMT processor modes, it looks > > wrong to return anything but 1. This check needs kvm_enabled(). > > This also gets called when emulating PPC on PPC. > Yes and the current value of 1 is the default for non HV KVM and TCG. If you want to change the default for MTTCG, then you need separate paths. > > Also, why 8 ? This depends on the CPU model. > > Not sure if I need to emulate according to the host cpu model. I had > selected 8, as that was the highest number of threads possible for POWER. > If running in full emulation and cpu type is POWER7, this shouldn't be higher than 4. In the end, something like: int kvmppc_smt_threads(void) { if (kvm_enabled()) { return cap_ppc_smt ? cap_ppc_smt : 1; } else { return 8_or_4_or_2_or_1_depending_on_the_cpu_model; } } Cheers. -- Greg > > Also, since real HW allows to choose the SMT mode, maybe this should > > be configurable from the command line as well. > > > >> } > >> > >> #ifdef TARGET_PPC64 > >> diff --git a/target-ppc/kvm_ppc.h b/target-ppc/kvm_ppc.h > >> index 5461d10..053db0a 100644 > >> --- a/target-ppc/kvm_ppc.h > >> +++ b/target-ppc/kvm_ppc.h > >> @@ -128,7 +128,7 @@ static inline void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpic_proxy) > >> > >> static inline int kvmppc_smt_threads(void) > >> { > >> - return 1; > >> + return 8; > > > > Same remark. > > > >> } > >> > >> static inline int kvmppc_or_tsr_bits(PowerPCCPU *cpu, uint32_t tsr_bits) > > Regards > Nikunj >