Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp549575ybb; Wed, 8 Apr 2020 05:20:48 -0700 (PDT) X-Google-Smtp-Source: APiQypLN0/3pDYHIrOHgagsV1eUfpd8rshjnfyoOFU0a8FVRFZ77kT/rMfnmkJ4dqx3RPJEuUcpz X-Received: by 2002:a05:6830:1046:: with SMTP id b6mr5663499otp.229.1586348448490; Wed, 08 Apr 2020 05:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586348448; cv=none; d=google.com; s=arc-20160816; b=kIdodg3d4tQrbW349f7VaFPAV6VDAQ2i9GwHINL+NRcBdZtyunA9JN/yjYG6X4fqnv TfLCXgkE+Qeqvwb81qlDHffWL+ds5s1hoCgp6xM+ZGaGjPFLCHBeCPV0S7hzGCRhdtFl fYenjzHFMMDldqZUe30NDXtvjX4dp1qNlnjZVuMS7ZaDeCPCphLJ3o8BFhsM9156QyoV Cxkp+gy9NqgtAJMZnJEEqNfJy2Je+RIeHSWMsMlnArOjuk7oSoupYu2pleuessFPlt4w ccUM/2NbLodxACONtNzDCmTuapiW+we96Dwds/NoX0KQ0zERpaRT0LtWSoecdVjkksz1 EXQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=oN/QIuqw5iEqFhGrOd3vlSDJRreHJY27KLybpSbPAMo=; b=Cz5VSnYtz0d5lssrpyuVCzQVhH1UK9rA0P2WuoAbTF6eJd9ih7e7H7b83ZSVoutIMi RjHNZOmBUnOscPwFHKJUaG6OE1DLNxEskBuOgBIoegRxRrrH0yWt2A7RF8m0ZfwGL3D9 SxG/TR4hrUWepYtZn/PSuxukIbbKUOYAjZZwH05kSE8HtucK5sUJB5+VEaiHHMGSYBxQ dtdNyk+jOp4ZNiirolPvfhwAym06wgAZOQkMI9f7vrODNMm3F8RhhqY/28e99szw28la bbo1xumRbBsG3FnSo2eROqSyl21z+h7+6a8wHCQCQuxRJ2FqoL8pRovy/YKtk/oq0aom tFOA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l63si1886847oif.161.2020.04.08.05.20.33; Wed, 08 Apr 2020 05:20:48 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728002AbgDHJuu (ORCPT + 99 others); Wed, 8 Apr 2020 05:50:50 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:24792 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbgDHJuu (ORCPT ); Wed, 8 Apr 2020 05:50:50 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0389X3Eo015625; Wed, 8 Apr 2020 05:50:42 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 30920aeuv2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Apr 2020 05:50:41 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0389XNqJ016615; Wed, 8 Apr 2020 05:50:41 -0400 Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 30920aeuuq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Apr 2020 05:50:41 -0400 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 0389njPk006743; Wed, 8 Apr 2020 09:50:40 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma01wdc.us.ibm.com with ESMTP id 3091mdm01g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Apr 2020 09:50:40 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0389odc535717612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Apr 2020 09:50:39 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1EF966E04C; Wed, 8 Apr 2020 09:50:39 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B71AB6E052; Wed, 8 Apr 2020 09:50:38 +0000 (GMT) Received: from sofia.ibm.com (unknown [9.85.92.41]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 8 Apr 2020 09:50:38 +0000 (GMT) Received: by sofia.ibm.com (Postfix, from userid 1000) id 23B962E3023; Wed, 8 Apr 2020 15:20:33 +0530 (IST) Date: Wed, 8 Apr 2020 15:20:33 +0530 From: Gautham R Shenoy To: Pratik Rajesh Sampat Cc: skiboot@lists.ozlabs.org, oohall@gmail.com, mikey@neuling.org, npiggin@gmail.com, vaidy@linux.ibm.com, ego@linux.vnet.ibm.com, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au, pratik.r.sampat@gmail.com Subject: Re: [RFC] Support stop state version quirk and firmware enabled stop Message-ID: <20200408095033.GC950@in.ibm.com> Reply-To: ego@linux.vnet.ibm.com References: <20200304155648.11501-1-psampat@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200304155648.11501-1-psampat@linux.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-07_10:2020-04-07,2020-04-07 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 clxscore=1011 malwarescore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004080079 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pratik, On Wed, Mar 04, 2020 at 09:26:48PM +0530, Pratik Rajesh Sampat wrote: > A concept patch in Skiboot to illustrate the case wherein handling of > stop states for different DD versions of a CPU can be achieved by a > simple modification in the list of cpu_features. > As an example idle-stop1 is defined which uses P9_CPU_DD1 to define the > cpu feature. > > Along with that, an implementation is being worked upon the LE OPAL > series which helps OPAL handle the stop state entry and exit. > > This patch advertises this capability of the firmware which can be > availed if the quirk-version-setting is not cognizable. > > The firmware-enabled stop is being worked by Abhishek Goel > building upon the LE OPAL series. > > Signed-off-by: Pratik Rajesh Sampat > --- > core/cpufeatures.c | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/core/cpufeatures.c b/core/cpufeatures.c > index ec30c975..b9875e7b 100644 > --- a/core/cpufeatures.c > +++ b/core/cpufeatures.c > @@ -510,6 +510,25 @@ static const struct cpu_feature cpu_features_table[] = { > -1, -1, -1, > NULL, }, > > + /* > + * QUIRK for ISAv3.0B stop idle instructions and registers > + * Helps us determine if there are any quirks > + * XXX: Same of idle-stop > + */ > + { "idle-stop-v1", > + CPU_P9_DD1, > + ISA_V3_0B, USABLE_HV|USABLE_OS, > + HV_CUSTOM, OS_CUSTOM, > + -1, -1, -1, > + NULL, }, So, at this point, we don't need any such quirk for any of the DD version right ? This is to demonstrate that if say P9_DD1 had a quirk w.r.t stop-state handling, then this is how we would advertise it to the kernel. > + > + { "firmware-stop-supported", > + CPU_P9, > + ISA_V3_0B, USABLE_HV|USABLE_OS, > + HV_CUSTOM, OS_CUSTOM, > + -1, -1, -1, > + NULL, }, > + I suppose this is for the opal-cpuidle driver support posted here: https://lists.ozlabs.org/pipermail/skiboot/2020-April/016726.html > /* > * ISAv3.0B Hypervisor Virtualization Interrupt > * Also associated system registers, LPCR EE, HEIC, HVICE, > @@ -883,6 +902,9 @@ static void add_cpufeatures(struct dt_node *cpus, > const struct cpu_feature *f = &cpu_features_table[i]; > > if (f->cpus_supported & cpu_feature_cpu) { > + if (!strcmp(f->name, "firmware-stop-supported") && > + HAVE_BIG_ENDIAN) > + continue; In OPAL do we have an macro defining BIG_ENDIAN ? If yes, you could wrap the "firmware-stop-supported" in cpu_features_table[] within #ifndef BIG_ENDIAN. That way you won't need a special case here. > DBG(" '%s'\n", f->name); > add_cpu_feature_nodeps(features, f); > } > -- > 2.24.1 > -- Thanks and Regards gautham.