Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1340221imm; Wed, 18 Jul 2018 23:08:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpflHPrR6CzUj2t7i+0sJSIKZXRpx7qc8rS1VRID0OhkNU+TMsolmOOsfs2VJ3PmzVZN3Iaq X-Received: by 2002:a17:902:c85:: with SMTP id 5-v6mr950331plt.141.1531980508206; Wed, 18 Jul 2018 23:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531980508; cv=none; d=google.com; s=arc-20160816; b=mTegnu6r6dO6xEEWGw00zbEO5hQXxsSoVvIlIPsL/Hx5Yassb6WVEdH2pIWB+C6+pk AuV01A4gn3MZ+1sdGjw8IAsiyWUs/r7ALLwiyLpvKckDgi9QOhfITuOqeM7PFeDJ5Fod soRvvljrS4ouRLrVAgMdc039QpY+6lJwi52+JRqPQ9QEmxvqcIDiiOmC4AOT+d0ip2Tc 51USPzrGQXmyuTNndd+4aWGKDOREYItBJobe7JKPYerKHT8lXwqszlgx9FkLPa/DxYWE HfPuGrpz8yBvnA33xQtGdg3Jc1rt+tAHlE7+utsxBfKaDEiu0oGmdTxSfeGsLFYWVXqg NBzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:subject:cc:from:to :in-reply-to:arc-authentication-results; bh=lVbtsq+pnZcKgA4XFB7d9bHLazxI7csNETqmmTFcV2I=; b=Ryqba1aHZl+TBztw6oIkzeMTBi+hdEhk9gGPe8KgFxqCUdk7REojZcG8PMx5gIKAYe dpL+HJS9mbhG8r8+zs84HsmOBKLczOFf+UOiYrSwXw/VPb5PQJH7HTg+tkf/Z+YFEK/v kcCXTC0lnAmoydIYWnX5sri8yTXfVrbkOsv4q1xYbdSuVWbm9PXKRii1kdCKDQ2+eWMU NRaGqvrynOd1avpoZTLHwKDdzPvx5Nkj0fdaFHWJFg7mT8QR8ySiu9JSQYjp7aXQRZTn jWKuaLMmjlP6P7FvMde0o9bL1ANVr1ySuO4F795CwCAhiKd4/gn8UUIYNMG8WnTGSvBD ZhBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5-v6si5039027pgn.105.2018.07.18.23.08.12; Wed, 18 Jul 2018 23:08:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731236AbeGSGri (ORCPT + 99 others); Thu, 19 Jul 2018 02:47:38 -0400 Received: from ozlabs.org ([203.11.71.1]:35655 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730279AbeGSGrh (ORCPT ); Thu, 19 Jul 2018 02:47:37 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 41WNmy63X5z9s55; Thu, 19 Jul 2018 16:06:10 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: b03897cf318dfc47de33a7ecbc7655584266f034 In-Reply-To: <1531902796-32294-1-git-send-email-ego@linux.vnet.ibm.com> To: "Gautham R. Shenoy" , Benjamin Herrenschmidt , Michael Neuling , Vaidyanathan Srinivasan From: Michael Ellerman Cc: Florian Weimer , "Gautham R. Shenoy" , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Oleg Nesterov , linuxppc-dev@lists.ozlabs.org Subject: Re: [v2] powerpc/powernv : Save/Restore SPRG3 on entry/exit from stop. Message-Id: <41WNmy63X5z9s55@ozlabs.org> Date: Thu, 19 Jul 2018 16:06:10 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-07-18 at 08:33:16 UTC, "Gautham R. Shenoy" wrote: > From: "Gautham R. Shenoy" > > On 64-bit servers, SPRN_SPRG3 and its userspace read-only mirror > SPRN_USPRG3 are used as userspace VDSO write and read registers > respectively. > > SPRN_SPRG3 is lost when we enter stop4 and above, and is currently not > restored. As a result, any read from SPRN_USPRG3 returns zero on an > exit from stop4 and above. > > Thus in this situation, on POWER9, any call from sched_getcpu() always > returns zero, as on powerpc, we call __kernel_getcpu() which relies > upon SPRN_USPRG3 to report the CPU and NUMA node information. > > Fix this by restoring SPRN_SPRG3 on wake up from a deep stop state > with the sprg_vdso value that is cached in PACA. > > Fixes: e1c1cfed5432 ("powerpc/powernv: Save/Restore additional SPRs > for stop4 cpuidle") > > Reported-by: Florian Weimer > Cc: # 4.14 > Cc: Oleg Nesterov > Cc: Michael Neuling > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: Vaidyanathan Srinivasan > Signed-off-by: Gautham R. Shenoy Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/b03897cf318dfc47de33a7ecbc7655 cheers