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 E5B8DC4332F for ; Wed, 2 Nov 2022 22:39:07 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4N2hdQ1jvPz3cLW for ; Thu, 3 Nov 2022 09:39:06 +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=nXWigNKF; 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=bgray@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=nXWigNKF; 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 4N2hcH0gqMz2xWx for ; Thu, 3 Nov 2022 09:38:06 +1100 (AEDT) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2A2MOQ38035294; Wed, 2 Nov 2022 22:37:56 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=6Lz7QcW/9ZULgOvN5QMC+ejWnugqdAf0gUVjPae2YcE=; b=nXWigNKF2tb0EI33pd3cRqQPVIHKdjq5X/jeAYGc8wqBg4CQ9u2Kdgxhpt7PK7t1ukGU 9OjShlSJJp6aywajrLaSizM4s6bw3+DK6rfmXJqTfGfFoxVIDrPXJlvLMS8oMSgtcRuV MIWBeVi5mOSPWzdKMkLSJogNPDtcLhKkSQECwq7Mhxu/Pz8DMd1PWYbhnMg9mB2TStMj yMJfBIKQXnv9Ms48rRGx9jataIiuGUa7IdQhIBJt2yWWbQAflH9DAGSJVYZYm5FQegGP hpd83PCvzwWqyflpoM/RZICpbW4a/oYuReIhKrk3bwTPTUv/N5xjl4vkY7Qp4SLbmqH6 iA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3km1ag89u5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 22:37:56 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2A2MPhJW038818; Wed, 2 Nov 2022 22:37:55 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3km1ag89td-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 22:37:55 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2A2MZkFa012712; Wed, 2 Nov 2022 22:37:53 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03ams.nl.ibm.com with ESMTP id 3kgut8ypmm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 22:37:53 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2A2MbpTa49742106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Nov 2022 22:37:51 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EC658A406D; Wed, 2 Nov 2022 22:37:50 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 96584A4069; Wed, 2 Nov 2022 22:37:50 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 2 Nov 2022 22:37:50 +0000 (GMT) Received: from li-0d7fa1cc-2c9d-11b2-a85c-aed20764436d.ibm.com (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 EDFAB6010C; Thu, 3 Nov 2022 09:37:40 +1100 (AEDT) Message-ID: <5362cac93c2de7b7635002eec8c2cea149d87a94.camel@linux.ibm.com> Subject: Re: [PATCH v9 2/7] powerpc/code-patching: Handle RWX patching initialisation error From: Benjamin Gray To: Christophe Leroy , "linuxppc-dev@lists.ozlabs.org" Date: Thu, 03 Nov 2022 09:37:40 +1100 In-Reply-To: <51d2e0fb-dc32-6ced-8657-cab2802c837b@csgroup.eu> References: <20221025044409.448755-1-bgray@linux.ibm.com> <20221025044409.448755-3-bgray@linux.ibm.com> <51d2e0fb-dc32-6ced-8657-cab2802c837b@csgroup.eu> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: HcWmnbS0JorQjihuD7qOYEK1KqnM-doK X-Proofpoint-ORIG-GUID: UJuhDKxi3gpcODXt4fwXyIeZfSqhmjUJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-02_15,2022-11-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 mlxlogscore=630 impostorscore=0 adultscore=0 spamscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211020149 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: "jniethe5@gmail.com" , "cmr@bluescreens.de" , "ajd@linux.ibm.com" , "npiggin@gmail.com" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, 2022-11-02 at 09:36 +0000, Christophe Leroy wrote: > Le 25/10/2022 =C3=A0 06:44, Benjamin Gray a =C3=A9crit=C2=A0: > > Detect and abort __do_patch_instruction() when there is no > > text_poke_area, > > which implies there is no patching address. This allows > > patch_instruction() > > to fail gracefully and let the caller decide what to do, as opposed > > to > > the current behaviour of kernel panicking when the null pointer is > > dereferenced. >=20 > Is there any reason at all to have no text_poke_area ? >=20 > If that's the boot CPU, then it means we are really early in the boot > process and will use raw_patch_instruction() directly. Or it means we > don't have enough memory for the boot CPU, in which case you are > going=20 > to have so many problems that it is not worth any effort. >=20 > If it is not the boot CPU, isn't there a way to not add a CPU for > which=20 > the allocation has failed ? If text_area_cpu_up() returns an error,=20 > isn't the CPU deactivated ? Right, I hadn't seen that the CPU isn't onlined if the startup fails. That would make the check redundant then.