From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wcNCM0fjjzDqGr for ; Tue, 30 May 2017 15:56:31 +1000 (AEST) Received: by mail-pf0-x241.google.com with SMTP id f27so15553593pfe.0 for ; Mon, 29 May 2017 22:56:30 -0700 (PDT) Date: Tue, 30 May 2017 15:56:12 +1000 From: Nicholas Piggin To: "Gautham R. Shenoy" Cc: 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 Message-ID: <20170530155612.701ca6fc@roar.ozlabs.ibm.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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? Reviewed-by: Nicholas Piggin