From nobody Sun Feb 8 14:35:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=listsout.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from listsout.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1546631957318456.1698034668708; Fri, 4 Jan 2019 11:59:17 -0800 (PST) Received: from localhost ([127.0.0.1]:38537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfVcd-0002ow-9q for importer@patchew.org; Fri, 04 Jan 2019 14:59:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfVao-0000np-3V for qemu-devel@nongnu.org; Fri, 04 Jan 2019 14:57:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfVai-0000ey-Hj for qemu-devel@nongnu.org; Fri, 04 Jan 2019 14:57:17 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:51816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfVai-0000dU-8W for qemu-devel@nongnu.org; Fri, 04 Jan 2019 14:57:12 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x04Jrv6D096897 for ; Fri, 4 Jan 2019 14:57:11 -0500 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ptafua3gx-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 04 Jan 2019 14:57:11 -0500 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 4 Jan 2019 19:57:09 -0000 Received: from b01cxnp23033.gho.pok.ibm.com (9.57.198.28) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 4 Jan 2019 19:57:07 -0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x04Jv7pY24445112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 4 Jan 2019 19:57:07 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E9CE7AE06F; Fri, 4 Jan 2019 19:57:06 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E78D2AE062; Fri, 4 Jan 2019 19:57:05 +0000 (GMT) Received: from farosas.linux.ibm.com.ibmmodules.com (unknown [9.80.232.60]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 4 Jan 2019 19:57:05 +0000 (GMT) From: Fabiano Rosas To: qemu-devel@nongnu.org Date: Fri, 4 Jan 2019 17:56:54 -0200 X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104195654.19976-1-farosas@linux.ibm.com> References: <20190104195654.19976-1-farosas@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19010419-0064-0000-0000-00000390AD06 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010345; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000272; SDB=6.01141746; UDB=6.00594252; IPR=6.00921977; MB=3.00024980; MTD=3.00000008; XFM=3.00000015; UTC=2019-01-04 19:57:08 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19010419-0065-0000-0000-00003BE8573E Message-Id: <20190104195654.19976-4-farosas@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-01-04_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=944 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901040169 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH 3/3] target/ppc: Enable reporting of SPRs to GDB X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This allows reading and writing of SPRs via GDB: (gdb) p/x $srr1 $1 =3D 0x8000000002803033 (gdb) p/x $pvr $2 =3D 0x4b0201 (gdb) set $pvr=3D0x4b0000 (gdb) p/x $pvr $3 =3D 0x4b0000 They can also be shown as a group: (gdb) info reg spr Signed-off-by: Fabiano Rosas --- target/ppc/translate_init.inc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.in= c.c index f10a3637d9..5771ef5386 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -9760,7 +9760,10 @@ static void ppc_cpu_realize(DeviceState *dev, Error = **errp) gdb_register_coprocessor(cs, gdb_get_vsx_reg, gdb_set_vsx_reg, 32, "power-vsx.xml", 0); } - +#ifndef CONFIG_USER_ONLY + gdb_register_coprocessor(cs, gdb_get_spr_reg, gdb_set_spr_reg, + ppc_gdb_gen_spr_xml(cs), "power-spr.xml", 0); +#endif qemu_init_vcpu(cs); =20 pcc->parent_realize(dev, errp); @@ -10523,7 +10526,9 @@ static void ppc_cpu_class_init(ObjectClass *oc, voi= d *data) #endif =20 cc->gdb_num_core_regs =3D 71; - +#ifndef CONFIG_USER_ONLY + cc->gdb_get_dynamic_xml =3D ppc_gdb_get_dynamic_xml; +#endif #ifdef USE_APPLE_GDB cc->gdb_read_register =3D ppc_cpu_gdb_read_register_apple; cc->gdb_write_register =3D ppc_cpu_gdb_write_register_apple; --=20 2.17.1