From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751349AbdE3KXf (ORCPT ); Tue, 30 May 2017 06:23:35 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49784 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751033AbdE3KXc (ORCPT ); Tue, 30 May 2017 06:23:32 -0400 Date: Tue, 30 May 2017 15:53:24 +0530 From: Gautham R Shenoy To: Nicholas Piggin Cc: "Gautham R. Shenoy" , Michael Ellerman , Michael Neuling , Vaidyanathan Srinivasan , Shilpasri G Bhat , Akshay Adiga , Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] powernv:idle: Correctly initialize core_idle_state_ptr Reply-To: ego@linux.vnet.ibm.com References: <20170530155612.701ca6fc@roar.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170530155612.701ca6fc@roar.ozlabs.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-GCONF: 00 x-cbid: 17053010-0044-0000-0000-0000033D35E2 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007143; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00867668; UDB=6.00431120; IPR=6.00647547; BA=6.00005384; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015642; XFM=3.00000015; UTC=2017-05-30 10:23:29 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17053010-0045-0000-0000-0000076B4470 Message-Id: <20170530102324.GA8563@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-05-30_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705300196 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nicholas, On Tue, May 30, 2017 at 03:56:12PM +1000, Nicholas Piggin wrote: > On Tue, 16 May 2017 14:19:43 +0530 > "Gautham R. Shenoy" wrote: > > > From: "Gautham R. Shenoy" > > > > The lower 8 bits of core_idle_state_ptr tracks the number of non-idle > > threads in the core. This is supposed to be initialized to bit-map > > corresponding to the threads_per_core. However, currently it is > > initialized to PNV_CORE_IDLE_THREAD_BITS (0xFF). This is correct for > > POWER8 which has 8 threads per core, but not for POWER9 which has 4 > > threads per core. > > > > As a result, on POWER9, core_idle_state_ptr gets initialized to > > 0xFF. In case when all the threads of the core are idle, the bits > > corresponding tracking the idle-threads are non-zero. As a result, the > > idle entry/exit code fails to save/restore per-core hypervisor state > > since it assumes that there are threads in the cores which are still > > active. > > > > Fix this by correctly initializing the lower bits of the > > core_idle_state_ptr on the basis of threads_per_core. > > > > Signed-off-by: Gautham R. Shenoy > > This looks good to me. > > Until this patch series, we can't enable HV state loss idle modes > on POWER9, is that correct? And after your series does it work? Yes, that is correct. > > Reviewed-by: Nicholas Piggin > Thanks for reviewing the patch! -- Thanks and Regards gautham.