From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2059.outbound.protection.outlook.com [40.107.8.59]) by sourceware.org (Postfix) with ESMTPS id 31C4E3857C62 for ; Thu, 14 Mar 2024 10:19:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31C4E3857C62 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 31C4E3857C62 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.8.59 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1710411594; cv=pass; b=SWmxQOfqPyD/kMT8sePo/STSBxbE49FQtKr11zIdELZmU/njOWCYBT4g9oquVe+PMU553fXJ0Al3sFN4qLOyD+aLV8T/OVw8SFkTwm51wAxi1TFjTkiUZ9Wr4Yu7ZGqKepSwQm7JsMHi9jCwTpD2f72WQIFTTFDda15kdgm4Vkk= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1710411594; c=relaxed/simple; bh=dq0UDt8T/pIoz1aj2+a0TxX/z5Xne8fuyXsgY/gaaJQ=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=sJXRkkGlf270H8YeD+U2x6U7D5XJEZ5MqikjpjTg4DkLUxGhiV+VK6MNfj6QGznyBUf/POmOEh5Sbszx/QpcsBXMmjX2U8LwL8BYVy0iOBl2ZHlh2Q6vOc66nnhjilB+AUFmW8OKx+4PlCxN0fV24tY5JdV6Z1hQgkK2uWWNQQ8= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=MIayblWO5CxB1TdNeyRpTugOAIInfk9tp1EjjLQZCy/gUNbcqjvsCxMbTXxOU+/CtKF1510ArItu6hRzTFbvs+0zYBuxzsOiWRtmTMim46ld9MIp77kZBNnV0/U+XzbKaC0JwUXOWrAVkl7N2TZU4PD1gDarR5KuKvkXK1JJnlobsieuAINJC+PbkQnTLIZOz/HUOAyKlp4Ga/oIyVfACK5WmDMEIUcjRB4VnCx8mbtK3fuM7cgj+H05lvlZszujtnXKtT5FVV+eMkwhOXQGIPPTpcrHq6fQSp6kU5u8MkjHgsYlU6KT2aDCbmKjaBBHVzmbD1TUHVOJXVZZBTsN9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=42PFzfXiykyfIRXEcbgigfvMKKcAzRjKs7QsAu2v+Wg=; b=BNcnQEpUq+HtaQDlKsjsE0VED1mtI7MutzhHi+KfyjSM9KVgtqWaeqb64f/Pz0Bz2Amu/gTOQh8CfrHnWcNrZT97OXBzW/Od8fuJQXh3fC7oN6nNIlMOEyNwrlT6rKy/+/YX5BUDjTG87bXZFzbxShEVGhd/G8Hbosc5c+I5fBS3IjnIp6xwFs0ptkOHS1Wj0v1RQj1MCt7MECg1ksqgJiAxb6edkBR4nTanMxGOoA53f4sQwkNAwZxh1tuDg519EpgLCvKEeAYbrX2K3NA6H+JddGvXasqiv7le8jW3VvX+h9wSa7Nq40buUIHLiR3Z0YyDmoHEskVBcY8XvwgTeA== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=42PFzfXiykyfIRXEcbgigfvMKKcAzRjKs7QsAu2v+Wg=; b=7Pxd74wt3pjzKKVtUQb2IvQHzHU56ORHhRxH6BxHG/kN+8nukD4CNtmOo65L8/jBQffT9g5XQ6FdCeTuPrNKSsGUGDtzHBKMuAvnRnFnVms6k9c7/wgHBhRXE85ObeNcgMH32G/n7Ov3XO78DFmVifapnQwT3wAhNRGZOeTGJ8M= Received: from DU2PR04CA0075.eurprd04.prod.outlook.com (2603:10a6:10:232::20) by AS8PR08MB7791.eurprd08.prod.outlook.com (2603:10a6:20b:52d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.36; Thu, 14 Mar 2024 10:19:45 +0000 Received: from DB1PEPF000509EC.eurprd03.prod.outlook.com (2603:10a6:10:232:cafe::1) by DU2PR04CA0075.outlook.office365.com (2603:10a6:10:232::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.21 via Frontend Transport; Thu, 14 Mar 2024 10:19:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB1PEPF000509EC.mail.protection.outlook.com (10.167.242.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.12 via Frontend Transport; Thu, 14 Mar 2024 10:19:45 +0000 Received: ("Tessian outbound 3b68a75ac28e:v276"); Thu, 14 Mar 2024 10:19:45 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e9b73e72c61f65e4 X-CR-MTA-TID: 64aa7808 Received: from d4b9480d32ee.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F5F0AE0E-CDC7-42EA-8CFE-0BF3A0F8EB13.1; Thu, 14 Mar 2024 10:19:38 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d4b9480d32ee.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 14 Mar 2024 10:19:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QHHlxztd0/pEPOreKqMHSb3EqipLExDVTY+jLsUEgd/wRje2y4kaqswl/JVEEneBgnketT/YULXtzLsYzY1qNJSx4rfnddg3xdRxv2MUPtSnOJoTExaweU4FegMxtk+AMlBxEFN11E4MMPS9oLjimJ9wwI640pDeur8oDeTIZW0EMUrA7wrWeWno8oMISPpxN5rL1ML20KBSQy980BR/pSIXV+7INCCKfzhQmIx3YGJmtfgN3ie7OjtGO/7pKG5wFAC9xk7+RetoUz8h08SmWNRzRx3H6BKNTVcmajfeUqGtS7p93dgFDdzMdkMrktnSV9jCJRYl2uBJ7xPHd8NsbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=42PFzfXiykyfIRXEcbgigfvMKKcAzRjKs7QsAu2v+Wg=; b=gW9DdU04i/kacYIzvVUAOKWG8X5tb4PEY11Mjhr8v2osru1fFxArHDoISZfO+DD9tS1nMrjHqsYr+PyXE1hPu5P5hLJhVPalV7GXG7CDvDaLnltzTtlgNCecnyc3IROXG/+XArTUnVteHaXL5ANXqODKdLZAWl2Y0WsC1cep809Ftxp/269NNKWCwP2lw+aebWKB1I1BDhB6fl4far4WeDawddJLkRnnQkjh8m3X6MwAySJmAIkpllOGcClvej3umWl5/4jEMyhWmPGsba8R/el7FHAu6gro5T2RQkFBGscgAAVslpoBHY41Ku3rOKD+9YtjK4fLgkZO1/STGddFlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=42PFzfXiykyfIRXEcbgigfvMKKcAzRjKs7QsAu2v+Wg=; b=7Pxd74wt3pjzKKVtUQb2IvQHzHU56ORHhRxH6BxHG/kN+8nukD4CNtmOo65L8/jBQffT9g5XQ6FdCeTuPrNKSsGUGDtzHBKMuAvnRnFnVms6k9c7/wgHBhRXE85ObeNcgMH32G/n7Ov3XO78DFmVifapnQwT3wAhNRGZOeTGJ8M= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by PAXPR08MB6639.eurprd08.prod.outlook.com (2603:10a6:102:154::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.21; Thu, 14 Mar 2024 10:19:35 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::363f:3fc8:fc36:58ed]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::363f:3fc8:fc36:58ed%5]) with mapi id 15.20.7386.017; Thu, 14 Mar 2024 10:19:35 +0000 Message-ID: Date: Thu, 14 Mar 2024 10:19:32 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] [gdb/tdep] Fix gdb.base/watchpoint-unaligned.exp on aarch64 Content-Language: en-US To: Tom de Vries , gdb-patches@sourceware.org References: <20240220205425.13587-1-tdevries@suse.de> <188e8db7-c6c7-4177-aefb-fdb7a0e7edce@suse.de> From: Luis Machado In-Reply-To: <188e8db7-c6c7-4177-aefb-fdb7a0e7edce@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO6P123CA0059.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:310::17) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|PAXPR08MB6639:EE_|DB1PEPF000509EC:EE_|AS8PR08MB7791:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ee2320f-f211-46c2-ce75-08dc44104565 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: sbTzhn0TqEK9FjGvyUGcGIDpQSPVcZl5iWLOiacovQWGe17zZNvhmmJn6wWVKeTgdp81vPnvEsZHC3dUyn8Xya/bH2cgPfBe+qwuoRNoKLuMG9pENRAicnh2FKy1YUxCGT2a++9dTY6mPSYdgHtaWmQvmLjgIKYUanTSqk1mKE+WY83eI26VImp+Q0S79O9OJdMU77ZVZEXi6Ab44uuLVF7rlUEJOj/vAsulP8k/L8xeXbNb3sy8in6WW//lvMiuf6978qUHkrbqA4OehLzRir7VJ6YfFN4M2BN6f5MYYCDu/E3DQBAE271J/nkA9lBmfXxBj9NYO2oyMKT8qTpmjcMTI6Slf31pAxZgs/hhZCeJVUek2BdbHrc1cUU6XhIHD/R5HjxZPcBLy+gjPfNBZSYjxg+Feq54MSlHi0NKTUTH+lwRTEgph6XiQBdtevwCrKx/Sfo2bbLX8yZvvtm5YWJBui7IZtUFXMmncjqfc3nF7sJzbvvPMr49cYwXODgycVoYBHLn7xtTY86d6SI8fly5/bZkrIg3IRlhBBchqRp7/pdyOFVPJsA3F6avLLMHM0luqBVsodcC/HxVOQKVe8XQVHgKPKVwzwPtQnLj1Yw= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6639 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF000509EC.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d17116d4-e20e-4e8c-86f7-08dc44103f94 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3X5S+uQB+MkU5dYfQYFwXnThrYOUL2CWP1NMDQZDXwiIVKRo98l6XYr+vaub+RYapZnZQ6sXdsQ5AguPhDUme1ZAzisxb/pNkdHsbxz7LlVbNgDZP4M+Qjr6+g1bA8RHEHJhbtngYiq62t91Mzs4KNB9bo6Yh6onxBhUBbEM9AkXlZvypCA1pV+WhHlQEYBs6tTCWza6NpBOEvxyRpDTIMP2DsCSNo0ADk0WHHcxoRvsW3sQ2bJHuPAMqoMk1DiUfH/XeolQCp/FcWMlfHb3YCZ4j01/2lr1sdRFLhO2bSFImVdfNfJqtJCH9AR56SbQfBDZ0fKqIBXHCmT5Y6z4nQjGZUrngk3M3wK7283USHL42Prvx+6MqFTiFuThs0GicJDRAh9QhG2JvN5ngRLmwH01SUq3sP0WAgVQIn13Bs+om/BYsRyci+Sp5Hv8aPaxyOqvobmtd/SDJlNoRmYxs9HIsvLDQpz8A6OlfxQmqwFxf1II8JUdB14YN66kWl3IJ8gzdnmPQuAHXVUC0GNxC2/pDg+wdEeGgbrdpeF3ols3pgwATA1JMLcqjACOaJEaP6Fv2+YUJFrmHU2A4Lyi2xlzEqjJE99giRtVGLWGpbD714r6+HBbcMRa0jRP+lZwWcKtASuvuSx5pwLFv1IZw5U0QFBybd7Fqz8nFE2N3atOTXrirOgc0h9cSxcni+v2Yx82v20nIiuYJfS7Rl1eUQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230031)(36860700004)(82310400014)(376005)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2024 10:19:45.4076 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ee2320f-f211-46c2-ce75-08dc44104565 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509EC.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7791 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Tom, On 3/13/24 17:12, Tom de Vries wrote: > On 3/7/24 11:50, Luis Machado wrote: >> Hi Tom, >> >> Raising the alignment enforcement means we will cover a bigger range of addresses, potentially covering our target watchpoint/trap address, >> but I'm afraid it also means we will raise the potential for false positives, if watchpoints are placed within the alignment range. >> > > True.  I've submitted a v2 that should address that, by limiting the impact of the patch to regular hw watchpoints. > >> Furthermore, we are not limited to 16-byte accesses. For SVE and SME we may be looking at even bigger accesses. And, more generally, the memset/memcpy >> instructions (not yet widely used) can potentially access arbitrary amounts of memory. So tweaking the alignment is only a focused fix towards the most often >> used instructions and access sizes at the moment. >> > > I don't have access atm to an SVE or SME or MOPS machine. > > We can guess that those larger accesses will cause issues, but we don't know until we try.  For instance, in the case of the stp instruction, it didn't cause issues with say a RK3399 SOC, but it did with an M1 SOC, so just the existence of larger accesses doesn't mean there are issues. > >> The more general problem of not being able to tell which particular watchpoint caused the trap remains. >> > > Yes.  I think we need to file a linux kernel bug for this.  I looked for one and didn't find it.  My current idea for a concrete solution for this is that the kernel should communicate back the state of the 2 debug registers (control and value) for which it thinks the watchpoint triggered.  That should resolve any ambiguity on the user space side. I'm not sure if there is one filed upstream, but the kernel folks are aware of the situation. From what we discussed in the past, this is either clumsy to do on the kernel's side right now or is not worth it for the gains. It could also be the case the kernel itself doesn't get precise information (it escapes me now), so can't send down precise information down to userspace. I'm aware there are efforts to improve this in the future. I was thinking a bit about this the other day, and one (kinda brute force) way of not getting stuck in an endless loop is to try to remove hardware watchpoints one by one whenever we trigger one of them. Then gdb will eventually be able to step over. Determining which particular watchpoint triggered is still a bit tricky, as we may have to remove multiple hardware watchpoints. Still, the thread is stopped anyway, and the debug registers are per-thread. Removing them all at the same time may also work without disturbing all the other threads. Right now we don't explore per-thread debug registers properly in gdb. But being pre-thread, those registers give us some flexibility that we don't have with software breakpoints (we can't remove a software breakpoint without affecting all the other running threads), for example. > >> How does the above fix behave on the overall testsuite in terms of watchpoint tests? > > The v2, as the v1, fixes the test-case and doesn't cause regressions. > > Thanks, > - Tom