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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7F3A8C433F5 for ; Tue, 15 Mar 2022 17:19:39 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KJ0Wt06Wgz3bTs for ; Wed, 16 Mar 2022 04:19:38 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=OR9LZE14; dkim-atps=neutral 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=ldufour@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=OR9LZE14; dkim-atps=neutral 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 4KJ0W62NzKz2xF0 for ; Wed, 16 Mar 2022 04:18:58 +1100 (AEDT) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22FGEdxm014384 for ; Tue, 15 Mar 2022 17:18:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=pGLWGnu9OCp8tBXYE3Ho5W5bBY4ZU7AOkI44nPf3s4Q=; b=OR9LZE14lN+Loy91IDIPCzB+eKlTUfukXrKD4juJmcLFk/LAb8YpnrpK6c18xrpnVJzg 6mhiXmoRgjKIG0vITx8CqJbeQh8N7LsSULNqtCibvxGBHrZ4+sGO+7uQHfOuT3Lesaoo 9ShfIo2BJtYBbl17wFVNioovWtm83GvBE1t17OS3Hhz1hP5p7/iIsuWSYtNRoczNIlgv sn86voSRnksJanqpmb6Hek48n0KUbsZVVPH6HQVLzliwxb9LyJTcLqcYlRo6+suOhsci dx0+Hh7PP9Ph47qnldvVcp/XcV7965TS/86YRYnXS7Hq5RQDr9Hbibq+kjt/r+aIwm/N /g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3etx2kstsj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 15 Mar 2022 17:18:56 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 22FGreb3012034 for ; Tue, 15 Mar 2022 17:18:55 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 3etx2kstrs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 17:18:55 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22FHD7wJ023558; Tue, 15 Mar 2022 17:18:53 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma01fra.de.ibm.com with ESMTP id 3erk58p33v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 15 Mar 2022 17:18:53 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22FHIpd750528728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Mar 2022 17:18:51 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F0FCFAE045; Tue, 15 Mar 2022 17:18:50 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CEB90AE053; Tue, 15 Mar 2022 17:18:50 +0000 (GMT) Received: from [9.101.4.33] (unknown [9.101.4.33]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 15 Mar 2022 17:18:50 +0000 (GMT) Message-ID: <012cf7e7-4f92-3ffa-3859-7e4941476e9c@linux.ibm.com> Date: Tue, 15 Mar 2022 18:18:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 13/14] powerpc/rtas: enture rtas_call is called with MMU enabled Content-Language: en-US To: Nicholas Piggin , linuxppc-dev@lists.ozlabs.org References: <20220308135047.478297-1-npiggin@gmail.com> <20220308135047.478297-14-npiggin@gmail.com> From: Laurent Dufour In-Reply-To: <20220308135047.478297-14-npiggin@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: vS5lN-Mo6hoLEK2iTxEpwXDOzv13EGQJ X-Proofpoint-GUID: h48EGHVKe7vrBjzL2HQiQii_OlWrycG_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-15_07,2022-03-15_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 adultscore=0 spamscore=0 impostorscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 phishscore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203150104 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: , Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 08/03/2022, 14:50:46, Nicholas Piggin wrote: > rtas_call must not be called with the MMU disabled because in case > of rtas error, log_error is called which requires MMU enabled. Add > a test and warning for this. > > Signed-off-by: Nicholas Piggin Reviewed-by: Laurent Dufour > --- > arch/powerpc/kernel/rtas.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c > index 1fc22138e3ab..adf4892aeecd 100644 > --- a/arch/powerpc/kernel/rtas.c > +++ b/arch/powerpc/kernel/rtas.c > @@ -479,6 +479,11 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...) > if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE) > return -1; > > + if ((mfmsr() & (MSR_IR|MSR_DR)) != (MSR_IR|MSR_DR)) { > + WARN_ON_ONCE(1); > + return -1; > + } > + > s = lock_rtas(); > > /* We use the global rtas args buffer */