From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E21AC433E0 for ; Thu, 14 May 2020 19:05:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34D9E2065F for ; Thu, 14 May 2020 19:05:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728304AbgENTFc (ORCPT ); Thu, 14 May 2020 15:05:32 -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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC7BAC433E0 for ; Thu, 14 May 2020 19:33:52 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9408520643 for ; Thu, 14 May 2020 19:33:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9408520643 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49NMCw4pCZzDr09 for ; Fri, 15 May 2020 05:33:48 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=nathanl@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49NLZt6ZnFzDqx2 for ; Fri, 15 May 2020 05:05:10 +1000 (AEST) 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 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 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Gautham R. Shenoy" , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Nicholas Piggin , Paul Mackerras , Nadav Amit , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, Allison Randal Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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.