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 A872EC433FE for ; Wed, 23 Nov 2022 03:24:30 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4NH61S64jZz3dv7 for ; Wed, 23 Nov 2022 14:24:28 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=KJu8A1hM; 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=ajd@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=KJu8A1hM; 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 4NH60Q4k08z2xl5 for ; Wed, 23 Nov 2022 14:23:34 +1100 (AEDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AN2W8A3014565 for ; Wed, 23 Nov 2022 03:23:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=pp1; bh=pKDgCaCa12BSvb1KN0ZRI4Sbi0NI/UxtB8LwAKpBlGY=; b=KJu8A1hMcapoeG0OI+xWXRcynibfPezccwSyHZJJPwozFFg6PzwLIigklTr8nK9Jgk3H 1PWaznUMegwLJdLN/Fo9j4COdZbCp8R7HRmcX4UBansqdNn279NX3rI1TeP4x/dbO2eY 6uZL3F7KnxvqnHqdEvdpY3btwAcbP6F9iaOcOT02wcz2/gdbQJgTLWQBx99zFnKAd1Ge ZzRWjWyOsrBAen+qiGDmHkmfFZXUf6fHyimjIyag6klUFbi9I3Vw779iZmu2pep+f6NE 3x59Ws/dYwofHl3jLWe3IKcF1iGMguHikhJEDmSg8FUOGFOHUyA/V5WLsTrH6sban5BU sQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m10pfqxn1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Nov 2022 03:23:30 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2AN3GfEX015415 for ; Wed, 23 Nov 2022 03:23:30 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m10pfqxmq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Nov 2022 03:23:30 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2AN3Mt8r004809; Wed, 23 Nov 2022 03:23:28 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04fra.de.ibm.com with ESMTP id 3kxps8upy0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Nov 2022 03:23:27 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2AN3HBrv49938802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Nov 2022 03:17:12 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C3BC852051; Wed, 23 Nov 2022 03:23:25 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 2559E5204E; Wed, 23 Nov 2022 03:23:25 +0000 (GMT) Received: from [10.61.2.128] (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 0FF316005B; Wed, 23 Nov 2022 14:23:24 +1100 (AEDT) Message-ID: Subject: Re: [PATCH 11/13] powerpc/rtas: strengthen do_enter_rtas() type safety, drop inline From: Andrew Donnellan To: Nathan Lynch , linuxppc-dev@lists.ozlabs.org Date: Wed, 23 Nov 2022 14:23:23 +1100 In-Reply-To: <20221118150751.469393-12-nathanl@linux.ibm.com> References: <20221118150751.469393-1-nathanl@linux.ibm.com> <20221118150751.469393-12-nathanl@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.1 (3.46.1-1.fc37) MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 9AgfQGza-tqvf5CE7eMOXeJ3f5fjMxHd X-Proofpoint-GUID: 23eLiheFdic1F7EVmsMDKKrCmuzIAmuu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_13,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 adultscore=0 spamscore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 clxscore=1015 impostorscore=0 mlxlogscore=935 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211230021 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: tyreld@linux.ibm.com, nnac123@linux.ibm.com, ldufour@linux.ibm.com, npiggin@gmail.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, 2022-11-18 at 09:07 -0600, Nathan Lynch wrote: > Make do_enter_rtas() take a pointer to struct rtas_args and do the > __pa() conversion in one place instead of leaving it to callers. This > also makes it possible to introduce enter/exit tracepoints that > access > the rtas_args struct fields. >=20 > There's no apparent reason to force inlining of do_enter_rtas() > either, and it seems to bloat the code a bit. Let the compiler > decide. >=20 > Signed-off-by: Nathan Lynch Makes sense! Reviewed-by: Andrew Donnellan > --- > =C2=A0arch/powerpc/kernel/rtas.c | 10 +++++----- > =C2=A01 file changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c > index a88db3b3486f..198366d641d0 100644 > --- a/arch/powerpc/kernel/rtas.c > +++ b/arch/powerpc/kernel/rtas.c > @@ -522,7 +522,7 @@ static const struct rtas_function > *rtas_token_to_function(s32 token) > =C2=A0/* This is here deliberately so it's only used in this file */ > =C2=A0void enter_rtas(unsigned long); > =C2=A0 > -static inline void do_enter_rtas(unsigned long args) > +static void do_enter_rtas(struct rtas_args *args) > =C2=A0{ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0unsigned long msr; > =C2=A0 > @@ -537,7 +537,7 @@ static inline void do_enter_rtas(unsigned long > args) > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0hard_irq_disable(); /* En= sure MSR[EE] is disabled on PPC64 */ > =C2=A0 > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0enter_rtas(args); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0enter_rtas(__pa(args)); > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0srr_regs_clobbered(); /* = rtas uses SRRs, invalidate */ > =C2=A0} > @@ -908,7 +908,7 @@ static char *__fetch_rtas_last_error(char > *altbuf) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0save_args =3D rtas.args; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rtas.args =3D err_args; > =C2=A0 > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_enter_rtas(__pa(&rtas.args)= ); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_enter_rtas(&rtas.args); > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0err_args =3D rtas.args; > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rtas.args =3D save_args; > @@ -955,7 +955,7 @@ va_rtas_call_unlocked(struct rtas_args *args, int > token, int nargs, int nret, > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0for (i =3D 0; i < nret; += +i) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0args->rets[i] =3D 0; > =C2=A0 > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_enter_rtas(__pa(args)); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_enter_rtas(args); > =C2=A0} > =C2=A0 > =C2=A0void rtas_call_unlocked(struct rtas_args *args, int token, int > nargs, int nret, ...) > @@ -1731,7 +1731,7 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user > *, uargs) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0flags =3D lock_rtas(); > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rtas.args =3D args; > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_enter_rtas(__pa(&rtas.args)= ); > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do_enter_rtas(&rtas.args); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0args =3D rtas.args; > =C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* A -1 return code indic= ates that the last command couldn't --=20 Andrew Donnellan OzLabs, ADL Canberra ajd@linux.ibm.com IBM Australia Limited