Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1568519ybk; Thu, 14 May 2020 12:10:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOuuZxY2EjyCgZ7auAGg4fP+FAEFSmwnwbSpen6QFRNXrgSzgLFPD9HcTY4Mq0F9yw0BhT X-Received: by 2002:a17:906:c7cc:: with SMTP id dc12mr5413582ejb.263.1589483418907; Thu, 14 May 2020 12:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589483418; cv=none; d=google.com; s=arc-20160816; b=Uw/UoQy5j36MqixSICrSD9KXEC7m8GEJbxeu3YzpCEcEG/myB9SDutq/mwUBB5Gv5t oxFSKWoNWVgQ+PXXfHiB+2K1dmRWnBX/kdIFzCgGU6vyImeDt3Qes0B2utjNxJ0+GOQM zp2RAhK9csFJeebyxQJ8ctQQ5qXNqKDInH9yPvDCDTS9kWW/AEekHisXQJ48mqgs82Y1 W6HI2gdaQ8Zbg930hC4vwvrizyDFjWdZCz2uwi4+ZkgaRHJDotg+nhDh7Jjp7IaU6rCq BshezzenT6gXtTLJpYONaTbyrYtqtOJFSjx73J1DT/1IxKj4GDLUM+vfEazOuwVm/Ejz SFtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=0gMdeXubuC6qK/qEsbsI6SLhxbc4Sdz3Czm9U6Nk20A=; b=RVaoCCoRoAB5fr1YevP3blwNicpvvH9XwZaABq9I1W6IRBgi2udnwnPlarRHpGPYq1 sDdxGcro0qhXwu7Fkye5XFFJWHUEuuySa9IRYO/XQ6OY6JOpY8n92Jlgf4od+IU42q27 rcbFYxasXYuEsx7BRpRYDJbUBS7u0bFqSChN8spTkjnJo43T1jn94uI/A0ExcihIadpN bVRSIYcZjYcnwgv/oa28R8LNpsTSNLtN9mki8QP9PlHOBWkwq3E/Hf9AC/+dSJo+J9B6 HR79xmazlw7ixBH0VOOJm+iVQ0mEH+rRa6i28JxrzYc5hyzAH1Klr2TkTKlzVSHJa388 FDpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id e9si2410791edl.560.2020.05.14.12.09.56; Thu, 14 May 2020 12:10:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1730148AbgENTFb (ORCPT + 99 others); Thu, 14 May 2020 15:05:31 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:20684 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729644AbgENTF1 (ORCPT ); Thu, 14 May 2020 15:05:27 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04EJ4SMe069982; Thu, 14 May 2020 15:04:59 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3111w8w6aa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 15:04:58 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 04EJ4WT0070393; Thu, 14 May 2020 15:04:58 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 3111w8w69w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 15:04:58 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 04EJ3PVR027513; Thu, 14 May 2020 19:04:57 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma04wdc.us.ibm.com with ESMTP id 3100ubrxqa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 19:04:57 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 04EJ4uQh20709730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 May 2020 19:04:56 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 31AFAC6057; Thu, 14 May 2020 19:04:56 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E4DD1C605A; Thu, 14 May 2020 19:04:55 +0000 (GMT) Received: from localhost (unknown [9.85.205.196]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Thu, 14 May 2020 19:04:55 +0000 (GMT) From: Nathan Lynch To: Leonardo Bras Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Michael Ellerman , Nicholas Piggin , Benjamin Herrenschmidt , Paul Mackerras , Greg Kroah-Hartman , Thomas Gleixner , Allison Randal , "Gautham R. Shenoy" , Nadav Amit Subject: Re: [PATCH 1/1] powerpc/rtas: Implement reentrant rtas call In-Reply-To: References: <20200408223901.760733-1-leonardo@linux.ibm.com> <87ftdb87jf.fsf@linux.ibm.com> Date: Thu, 14 May 2020 14:04:55 -0500 Message-ID: <875zcy2v8o.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.676 definitions=2020-05-14_07:2020-05-14,2020-05-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 spamscore=0 priorityscore=1501 impostorscore=0 cotscore=-2147483648 clxscore=1015 mlxscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 adultscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005140163 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Leonardo, Leonardo Bras writes: > Hello Nathan, thanks for the feedback! > > On Fri, 2020-04-10 at 14:28 -0500, Nathan Lynch wrote: >> Leonardo Bras writes: >> > Implement rtas_call_reentrant() for reentrant rtas-calls: >> > "ibm,int-on", "ibm,int-off",ibm,get-xive" and "ibm,set-xive". >> > >> > On LoPAPR Version 1.1 (March 24, 2016), from 7.3.10.1 to 7.3.10.4, >> > items 2 and 3 say: >> > >> > 2 - For the PowerPC External Interrupt option: The * call must be >> > reentrant to the number of processors on the platform. >> > 3 - For the PowerPC External Interrupt option: The * argument call >> > buffer for each simultaneous call must be physically unique. >> > >> > So, these rtas-calls can be called in a lockless way, if using >> > a different buffer for each call. >> > > >> From the language in the spec it's clear that these calls are intended >> to be reentrant with respect to themselves, but it's less clear to me >> that they are safe to call simultaneously with respect to each other or >> arbitrary other RTAS methods. > > In my viewpoint, being reentrant to themselves, without being reentrant > to others would be very difficult to do, considering the way the > rtas_call is crafted to work. > > I mean, I have no experience in rtas code, it's my viewpoint. In my > thoughts there is something like this: > > common_path -> selects function by token -> reentrant function > |-> non-reentrant function > > If there is one function that is reentrant, it means the common_path > and function selection by token would need to be reentrant too. I checked with partition firmware development and these calls can be used concurrently with arbitrary other RTAS calls, which confirms your interpretation. Thanks for bearing with me.