From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id sOPqK5TD4GOSOisAWB0awg (envelope-from ) for ; Mon, 06 Feb 2023 04:08:36 -0500 Received: by simark.ca (Postfix, from userid 112) id B10B61E128; Mon, 6 Feb 2023 04:08:36 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=JxI05SBC; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [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 544A31E0D3 for ; Mon, 6 Feb 2023 04:08:36 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A80783858417 for ; Mon, 6 Feb 2023 09:08:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A80783858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675674515; bh=84+eZKJqWlh/DXT0ivbMZSBfM1dtzrKcILuniQoiB4c=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=JxI05SBCSHKdxY2shx+miPFf5gdmINJwuUzlhLDV82LFLrEyoXFy2pBEC7E7AWrfT x8EQCSvBwxGiKc8/4j/YS4oua+pnlTICb6zpMAkpOI0Yr7aEWQouTld5KTRTA8RcO+ rNxJGWDOEWDT39YrPKhljsQAmbKSEY5a0vkt2WUg= Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2058.outbound.protection.outlook.com [40.107.21.58]) by sourceware.org (Postfix) with ESMTPS id 770E63858D1E for ; Mon, 6 Feb 2023 09:08:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 770E63858D1E Received: from DU2PR04CA0269.eurprd04.prod.outlook.com (2603:10a6:10:28e::34) by DU0PR08MB9276.eurprd08.prod.outlook.com (2603:10a6:10:41c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Mon, 6 Feb 2023 09:08:08 +0000 Received: from DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28e:cafe::df) by DU2PR04CA0269.outlook.office365.com (2603:10a6:10:28e::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34 via Frontend Transport; Mon, 6 Feb 2023 09:08:08 +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 DBAEUR03FT043.mail.protection.outlook.com (100.127.143.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32 via Frontend Transport; Mon, 6 Feb 2023 09:08:08 +0000 Received: ("Tessian outbound b1d3ffe56e73:v132"); Mon, 06 Feb 2023 09:08:08 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8c7e62f8a0124447 X-CR-MTA-TID: 64aa7808 Received: from ddec8fa4b8f5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 24043C03-7E59-4FEC-8BE4-B441757DA352.1; Mon, 06 Feb 2023 09:08:01 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ddec8fa4b8f5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 06 Feb 2023 09:08:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BtiL46j1GkeoJo7yyVU8OqOr69SvGypL2/vs6zxiEPwuZp3TiLLZAF98X3UPPWUfD0C4GP4VTTgdBLFq90GiFMjIZ/0V3uDgNvGmfjClHfDbzeJ/QzKR6BT5k3KGK7QsXiBZXEPagWNG55qVHv3LEMzGfbMim8hQl9HJLdACmUbubEwqY7i92RB0XWr3jJsUiVDnpvTHge5Z8OT0GNVby7a3g/rPHrPd419c9IYXXzdtpSTQBRLBNtd1WpeejNZeCY7UFLlRUm7l0xlNVZdelL3iRQYaAAoJkVKFBI+nomrHK3rWsr7PnLC6EBoaI84rqVqPb63d5EyX85s7eBRiAg== 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=84+eZKJqWlh/DXT0ivbMZSBfM1dtzrKcILuniQoiB4c=; b=RZZOY69Z1JQHE0pDNlhGRQLZPuBqTa5oTMbVIyyC51/+/V+FL/oG1Ljr3fjfQltuuUPl70AOtiHF6ePsgB9qQYb2mIvE3l0Gtzpk+xhTTRCZsWjYGE0c3SztmD7YEfFgrnxp/HFSrQhup95HpuZIodnxV6pPZ0julC8LCJ48k2Vl8JCvUlJohTW7Zb0BWdDmxff11coSR2MGLckU2sl9QFXHXpx6soCFAsHkRNKUV4mOGXD1yX+TV7sxWjBLIOVpnb6GeMsBWRWg2f4iFYs2MLjjmsCEjF+BaWWmV6jaPgCf1C5Y7LuZ2NTU8bVvLpODa2U43b+QwSOYkyc4apCxgg== 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 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 DBBPR08MB6075.eurprd08.prod.outlook.com (2603:10a6:10:207::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Mon, 6 Feb 2023 09:07:59 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6%3]) with mapi id 15.20.6064.034; Mon, 6 Feb 2023 09:07:58 +0000 Message-ID: <394ff2b6-3b80-be04-d11f-231030045446@arm.com> Date: Mon, 6 Feb 2023 09:07:58 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v3 4/8] gdbserver/linux-aarch64: When thread stops, update its target description Content-Language: en-US To: Thiago Jung Bauermann Cc: Simon Marchi , Andrew Burgess , Thiago Jung Bauermann via Gdb-patches References: <20230130044518.3322695-1-thiago.bauermann@linaro.org> <20230130044518.3322695-5-thiago.bauermann@linaro.org> <87pmattzjw.fsf@redhat.com> <7970ac03-1123-d5f6-7b17-808832d43be6@simark.ca> <9a85e2fe-078a-e2ee-7e49-53fe0ceef492@arm.com> <87y1pgaib6.fsf@linaro.org> <9d30751a-589b-eb95-09b1-61d083ad9730@arm.com> <87leldmp6r.fsf@linaro.org> In-Reply-To: <87leldmp6r.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0491.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:13a::16) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DBBPR08MB6075:EE_|DBAEUR03FT043:EE_|DU0PR08MB9276:EE_ X-MS-Office365-Filtering-Correlation-Id: 983e4b86-0b91-415c-b8da-08db0821aa36 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: L6c6l7JhvFBIeDBIz3hWxJtr6RaPAWb5VI3u2qCQFIN9wWcdurC3ax6t5fhgLIQpppC59IW7rhyb4JtL8C+q3hdYOjUAULSfJ9sm07GMi8i/qp3qkyUQ+3ZnUEfKocvYrn4cazBjwlh6UyNKBqJWGle/WoxQ9zzjQ0ilRSPUoaiqzUUq5y3Mm6h8GbCn/gvR2n32qvqmZnsNDBDjzykf5W6wnncrzQxVYprQkZr2PD597EeYYmuR9Bdc4CrEJN0G1O7Hwjs7ucwKTGJW4F37ChP9X0V5YwnDQD520AMw1CxQKhzgC2yElYc5BcGHkiA6JSL+tgRalCYSVKkCPSYfL1CvzCoAbPBFkVYeV8TitGaw80/vTxWefIrHa1ROU81R2oZBwdONdLVec9tKmHDonZUXS9Bgl62sib1zt6+m2BJg6Dh4QIHj95IHg3abqT7zvLkaqECZZsFGiJv7aVVJeHZQalT7Og2QF0RltsbHl2Bk5K0eJy/AYPIbXZMRKSUjZdQVQoWYroKE51vRxSUTDpashET8fwUCMTNIcav05ivhDJiDcyKYHCZrzMTZv2Th4htN6GREeMo7LClkeAm0JAHwyXz08RrAzpsK5iHdi/D3sWl5YDPr1aesz6ds9BBz12wxqef10QbAiOXmZZHK0mG58aQd55pMfwkNZDl362gb8Y2DL0YH9r5uA/Txi2734btkJL4m3QtngNuLQmEUL3T9urDLi3FUrxor3jlqlMU= 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:(13230025)(4636009)(136003)(346002)(376002)(396003)(366004)(39860400002)(451199018)(66476007)(6486002)(53546011)(478600001)(2616005)(6506007)(6512007)(186003)(26005)(4326008)(8676002)(66946007)(6916009)(316002)(66556008)(36756003)(31696002)(86362001)(54906003)(38100700002)(5660300002)(44832011)(41300700001)(8936002)(2906002)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB6075 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: DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3a014e57-ca09-41c7-8ddd-08db0821a3e0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pzqRmjS4Fm4pcDPSQxNAnmbuzuA9PwrsBHAjHLrWK/FkCGvT+/PAWCb7AuGIFRtOGNbhN9ZtuMYfnPxaQ6NQZynDFNs+re4FKuJNtvuxoV+YEnS+Ou1KuIw890KbtTUsU2rwpcm9QyOUU38UrZsZWNIxLR+9d2O6VWlR1aq7+iYcB6NVgesdcAredUIrDH0X065sx3wT73Cgwz4QECHI9nEpEcCLl4IBd4BxE5BV8MRajSHpndZ0RHBG2qQpjTKJDvfWtTKBp0PStyilvr5fk9VGjf9C73MKMSvUuflUh2FBtCz6IOpe4iSHOvXZikYAdCi6Q3S4B/ZfkpavBYqxK4cmdQTpgnsx3N9x3lT8V9PXRqxwG/UdPFz8aW8+85rjZNhaCFZECo5b1EdqrSYfcQOJpUVCeegst0LpUikrahE3p826PnLYyGgdMUwzlHKAeM/5Ugt2OFC/PJ6mBa+81tW6CTAduj5k6Xy44Co+9VUqY1VfU3+Kt4hglUszvqejQb6gFu5YvsAWkW+mBvE9+a2TgzQT6pyViJkuRpw/ilRMH/L0mrGyWRKomdYh4Q/lpua9p2HpqBDOJItNXynsCuBsENcIsJSiLpkO94k3kw9I5Sbb/RGom2dbvx7B9kpw7l7UzJ6iwjrjg6GP0Uz8EGke072skF6q5WHS4tyBtox8qEl/1t84bNxGqiYVLr52aWZ2gtF2zEe+NtVZ6dirNwxk7CC5QacmFk7yBX1NlB8= 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:(13230025)(4636009)(136003)(396003)(39860400002)(346002)(376002)(451199018)(36840700001)(46966006)(40470700004)(31686004)(316002)(4326008)(70586007)(70206006)(8676002)(8936002)(6862004)(41300700001)(54906003)(5660300002)(81166007)(356005)(86362001)(36860700001)(82740400003)(36756003)(31696002)(186003)(53546011)(6512007)(26005)(6506007)(2906002)(47076005)(40460700003)(40480700001)(82310400005)(6486002)(2616005)(478600001)(44832011)(336012)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2023 09:08:08.5556 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 983e4b86-0b91-415c-b8da-08db0821aa36 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: DBAEUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9276 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: Luis Machado via Gdb-patches Reply-To: Luis Machado Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2/4/23 15:21, Thiago Jung Bauermann wrote: > > Luis Machado writes: > >> On 2/2/23 03:47, Simon Marchi wrote: >>> On 2/1/23 21:54, Thiago Jung Bauermann wrote: >>>> In any case, it wouldn't be possible to make get_thread_target_desc just >>>> return thread_info->tdesc because at least the way these patches are >>>> currently written, when the inferior starts or a new thread of the >>>> inferior is spawned thread_info->tdesc is nullptr. gdbserver will only >>>> call get_thread_tdesc after the first stop (in get_thread_regcache, in >>>> the process of obtaining the pc register), so we will need to cope with >>>> that situation. >>> Ok. Would it work if a new thread initially inherited the tdesc from >>> its process? >>> >> >> It should be fine because the first time we fetch a process target >> description, it is eventually obtained from the first and only thread. >> So the SVE vector length should be correct. >> >> Any subsequent attempts to use the process' target description (the >> first one we obtained), after further stops, may end up using an >> incorrect description. >> >> I think this is handled correctly by the target architecture target >> hook though. But there are other places where this is potentially >> incorrect. >> >> For example... >> >> - When using gcore to dump a core file, GDB only dumps a single target >> description. While this might be correct for a target with a fixed >> target description or a AArch64 target that doesn't support SVE, it >> likely won't be correctly for one AArch64 target supporting SVE if its >> threads changed vector length mid-execution. Either we emit target >> description notes by thread, or we don't emit a target description >> note for those cases. >> >> - When loading the above/older gcore core files back, GDB will use a >> potentially incorrect target description. If we decide to emit >> per-thread target descriptions, it should be fine. Otherwise we may >> need to have a "thread architecture" hook for core files as well. >> >> - The remote has no concept of a thread architecture (Thiago is >> addressing this with this patch series). >> >> - AArch64 frames may have slightly different vg values, which means >> their gdbarches are different as well. >> >> Given the differences between two gdbarches are small, we mostly get >> away with it. But if there are further differences (different hooks, >> for example), I fear we may run into a situation where we use an >> incorrect gdbarch to call a particular hook. > > Indeed, good points! Thank you for bringing them up. I can address core > file dumping/loading after this series. I have an upcoming patch for SME that should address this for core files, but it still needs some testing. > > Regarding frames with different vg values, it's important to be aware of > this discrepancy but IMHO it makes sense to work on it when it becomes > a problem... > Indeed. It will be a problem for SME and streaming mode, but I have another upcoming patch to hopefully address this as well.