From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gTsqG4ilqF+bXAAAWB0awg (envelope-from ) for ; Sun, 08 Nov 2020 21:12:24 -0500 Received: by simark.ca (Postfix, from userid 112) id 66D6C1F08B; Sun, 8 Nov 2020 21:12:24 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EEB061E58F for ; Sun, 8 Nov 2020 21:12:23 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2495B3858001; Mon, 9 Nov 2020 02:12:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2495B3858001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1604887943; bh=LoqWyKBJNBj+DFCq4eokH0xFC3NvVM+ak4ClsMz6RxE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=B11ctQASVVdovyyd5kWJ1CLdLBUyYkqq1Z74O9S+0AVvHZKBcl2fVPCBQ8ycxtvWg BxICvgi4Lng/5ypgdqhj73C12zOl8A4eE/srUZuSq8HaiCrkIAkWSNefRnba6RjeU2 CE5SOq9CE53nm4imWk9ytO/O5zpTvx8Ut0h6xDgo= Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id A2A963858001 for ; Mon, 9 Nov 2020 02:12:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A2A963858001 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A922IWF154395 for ; Sun, 8 Nov 2020 21:12:19 -0500 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com with ESMTP id 34nrhqe5b1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 08 Nov 2020 21:12:19 -0500 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0A92Be0p003627 for ; Mon, 9 Nov 2020 02:12:19 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma02dal.us.ibm.com with ESMTP id 34nk78y209-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 09 Nov 2020 02:12:18 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0A92CFMx66978178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 Nov 2020 02:12:15 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 491817805E; Mon, 9 Nov 2020 02:12:15 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A97F87805C; Mon, 9 Nov 2020 02:12:11 +0000 (GMT) Received: from sid.ltc.br.ibm.com (unknown [9.85.193.246]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 9 Nov 2020 02:12:11 +0000 (GMT) To: gdb-patches@sourceware.org Subject: [PATCH v1] [powerpc] Remove 512 bytes region limit if using 2nd DAWR. Date: Sun, 8 Nov 2020 23:12:04 -0300 Message-Id: <20201109021204.48664-1-rcardoso@linux.ibm.com> X-Mailer: git-send-email 2.17.1 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-08_12:2020-11-05, 2020-11-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=779 priorityscore=1501 bulkscore=0 clxscore=1015 adultscore=0 phishscore=0 impostorscore=0 spamscore=0 mlxscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011090007 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Rogerio Alves via Gdb-patches Reply-To: Rogerio Alves Cc: ulrich.weigand@de.ibm.com, pedromfc@linux.ibm.com Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Power 10 introduces the 2nd DAWR (second watchpoint) and also removed a restriction that limit the watch region to 512 bytes. 2020-11-08 Rogerio A. Cardoso gdb/ * ppc-linux-nat.c: (PPC_DEBUG_FEATURE_DATA_BP_ARCH_31): New define. (region_ok_for_hw_watchpoint): Check if 2nd DAWR is avaliable before set region. --- gdb/ppc-linux-nat.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 7131134c10..643400eac5 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -138,6 +138,11 @@ struct ppc_hw_breakpoint #define PPC_DEBUG_FEATURE_DATA_BP_DAWR 0x10 #endif /* PPC_DEBUG_FEATURE_DATA_BP_DAWR */ +/* Feature defined on Linux kernel v5.1: Second watchpoint support. */ +#ifndef PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 +#define PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 0x20 +#endif /* PPC_DEBUG_FEATURE_DATA_BP_ARCH_31 */ + /* The version of the PowerPC HWDEBUG kernel interface that we will use, if available. */ #define PPC_DEBUG_CURRENT_VERSION 1 @@ -2111,7 +2116,6 @@ ppc_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) int region_size; const struct ppc_debug_info &hwdebug_info = (m_dreg_interface .hwdebug_info ()); - /* Embedded DAC-based processors, like the PowerPC 440 have ranged watchpoints and can watch any access within an arbitrary memory region. This is useful to watch arrays and structs, for instance. It @@ -2121,9 +2125,11 @@ ppc_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) && linux_get_hwcap (current_top_target ()) & PPC_FEATURE_BOOKE) return 2; /* Check if the processor provides DAWR interface. */ - if (hwdebug_info.features & PPC_DEBUG_FEATURE_DATA_BP_DAWR) + if (hwdebug_info.features & PPC_DEBUG_FEATURE_DATA_BP_DAWR + && !(hwdebug_info.features & PPC_DEBUG_FEATURE_DATA_BP_ARCH_31)) /* DAWR interface allows to watch up to 512 byte wide ranges which - can't cross a 512 byte boundary. */ + can't cross a 512 byte boundary unless it uses a second DARW + ISA 3.1 (P10) which has no such restriction. */ region_size = 512; else region_size = hwdebug_info.data_bp_alignment; -- 2.17.1