Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2155447imm; Thu, 2 Aug 2018 07:07:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdPX2XfIxYz560QHV+6QCGm3yFeEbKS3PSm70bg9KwjQZAx7sJuIxrZ7VAEmO2bRn+Upqu9 X-Received: by 2002:a62:3241:: with SMTP id y62-v6mr3245652pfy.4.1533218854567; Thu, 02 Aug 2018 07:07:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533218854; cv=none; d=google.com; s=arc-20160816; b=mioAeyg8h2567CthTw0DQuCMhz4n+HNvAm8lmlX6xWAahnwpwwDuFkUn1Txa7Asjb4 gTlM/JCtZmZhhjZOHQeOYSzxf+/uyRdNNzq94zY0420sXnSqt6PV0mfwuECEAZRm/VMU K5vi83lr4GcUc8zvAwfMDCl1An/prz0iEqaMpzUYoZC/I8pRm0VFVbN6kClAcXG0Blcr G1v2z7qFsYsrrx92wQ5RcgsrFwtFtHHBZiBNniCTCZuP2OPthrW9JIWD9eNJCTkSW9pv lRXVGU50yQL5vObMyUsze0HJ53Oo+hThLt4bAEedUDp3nSdjGIuZ6sWmam0eUta10q+6 CPeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=gBRCGiBOBUU5hLfpePyfcLx7elxeb+CyoztPkEngAwU=; b=eH4/4Kwq6eXaj1S4T6DnKlPn+JEnJtbS9P6Nf4ENrUanXntckxK0mEANrjIN3nQuUm 4iffAmL2U7DFxU7lbm0SME4Hng5C2KAyk7am927Sm1fjMSj1LmHoxVPWKTEc/RU7BWgH UU4RNOji6y0hRjjIYEsKN4Z994Cka5EhyjDlLnNwtUYfZmQXwrXkd7vkDKwOExuYJLwN iCVD85VWz2J0EkQTjd+QNgJkP/evA3KCyfUYB/RTXrwxGh7g4Vzqb0RfTT+nWJDtPMeV vo5owGRxeMnq97fbZo1a37WIuXWAGu0cT0XySBxJv8HFjOUu0w/IJKlmLqPWttqQEqrz zrEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HTOlH4HH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12-v6si1726588pgr.267.2018.08.02.07.07.19; Thu, 02 Aug 2018 07:07:34 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HTOlH4HH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732493AbeHBP5W (ORCPT + 99 others); Thu, 2 Aug 2018 11:57:22 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44690 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732141AbeHBP5V (ORCPT ); Thu, 2 Aug 2018 11:57:21 -0400 Received: by mail-pf1-f196.google.com with SMTP id k21-v6so1373424pff.11 for ; Thu, 02 Aug 2018 07:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gBRCGiBOBUU5hLfpePyfcLx7elxeb+CyoztPkEngAwU=; b=HTOlH4HHt7iVHxT6sv8hFqcwbQ0gRNzMk/xHdfrg/PdWwxsEZRRH65phTVusAAXK3n 8RQYUwTrJgz+9673EUSsE9hORHG6rczRTC+ZmwqtKZ8SbPMdFEFqrUTCHIkob0MLvEG3 HJacLOUSEqfwTiMDoxL81a+Bk05Tns+fNdJuwtLZWsfl9mpV1Nfm4lW0HFTDmJJZvcO/ OB6FXO5Z4jIVxQVZFzzLqNtQ9RT1ZC8TgodRzhPcbyUbHRjQKSVKdQ4EE6aLRxgsRlkW SZ54H6duEZD6ZFs6H/Q2vx1sO4XMBQMU4u0t8KD/N/iKVtYdZHfbh/XpsRHto0okYB3M XCZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gBRCGiBOBUU5hLfpePyfcLx7elxeb+CyoztPkEngAwU=; b=Npg+V9OYkYfd7z8mauYkEKfGI68keH1VLDbXtea6aihAEtToLhiOjk7W9EGWZt5Lnm MFFrY9yIaiWwzgyhmJ1MfGQhDc0fvTymPsUHaSf0v9mmv3uE5Ue6Px53M03yQmOWN0GB L189BiU30tbI/4qQtmmFbNzdTB2MrT8sQeob2miOqKhQaOvGniOEUJR19440d+R/qvSb uj3ku7fpaJ5rU3HX4qqoV5CJUJfabeJdB78tQnyHcwHQz4RJ7VDjMvfXTrbpXDYAA4HZ spmgupH2IKKIHPVHhdRgpuxLuozKdHkGRmZq87FBNee6+hdSkIHXMEnP+6lmvh61x6gq +Msg== X-Gm-Message-State: AOUpUlFf5DeXQSDp/NwlWcEN/jsV6kvZAwqqL2s0yltn4MdujnwALcX3 97b9P9fNbKXz23CakuuUlL/jg94P X-Received: by 2002:a62:ad1:: with SMTP id 78-v6mr3151978pfk.57.1533218759752; Thu, 02 Aug 2018 07:05:59 -0700 (PDT) Received: from roar.ozlabs.ibm.com ([61.69.188.107]) by smtp.gmail.com with ESMTPSA id u69-v6sm2910410pgd.43.2018.08.02.07.05.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Aug 2018 07:05:58 -0700 (PDT) Date: Fri, 3 Aug 2018 00:05:47 +1000 From: Nicholas Piggin To: Akshay Adiga Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, benh@kernel.crashing.org, ego@linux.vnet.ibm.com, huntbag@linux.vnet.ibm.com Subject: Re: [RFC PATCH 3/3] cpuidle/powernv: Conditionally save-restore sprs using opal Message-ID: <20180803000547.08a37175@roar.ozlabs.ibm.com> In-Reply-To: <20180802045132.12432-4-akshay.adiga@linux.vnet.ibm.com> References: <20180802045132.12432-1-akshay.adiga@linux.vnet.ibm.com> <20180802045132.12432-4-akshay.adiga@linux.vnet.ibm.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2 Aug 2018 10:21:32 +0530 Akshay Adiga wrote: > From: Abhishek Goel > > If a state has "opal-supported" compat flag in device-tree, an opal call > needs to be made during the entry and exit of the stop state. This patch > passes a hint to the power9_idle_stop and power9_offline_stop. > > This patch moves the saving and restoring of sprs for P9 cpuidle > from kernel to opal. This patch still uses existing code to detect > first thread in core. > In an attempt to make the powernv idle code backward compatible, > and to some extent forward compatible, add support for pre-stop entry > and post-stop exit actions in OPAL. If a kernel knows about this > opal call, then just a firmware supporting newer hardware is required, > instead of waiting for kernel updates. Still think we should make these do-everything calls. Including executing nap/stop instructions, restoring timebase, possibly even saving and restoring SLB (although a return code could be used to tell the kernel to do that maybe if performance advantage is enough). I haven't had a lot of time to go through it, I'm working on moving ~all of idle_book3s.S to C code, I'd like to do that before this OPAL idle driver if possible. A minor thing I just noticed, you don't have to allocate the opal spr save space in Linux, just do it all in OPAL. Thanks, Nick