From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yAj6FmTv4GPsVCsAWB0awg (envelope-from ) for ; Mon, 06 Feb 2023 07:15:32 -0500 Received: by simark.ca (Postfix, from userid 112) id 59E511E128; Mon, 6 Feb 2023 07:15:32 -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=V57zSQDZ; 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=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.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 E75371E0D3 for ; Mon, 6 Feb 2023 07:15:31 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E51003858408 for ; Mon, 6 Feb 2023 12:15:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E51003858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675685730; bh=WZwUKLYGUdL2Sd2fz962NxrQ7IBiYSZPEqYxHA8Kt9U=; h=References:To:Cc:Subject:In-reply-to:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=V57zSQDZwc+iDsOOiE6N7VgmphYmIeZb+Ag78IHJdUH1cqQN2+CXm4YLfVTaVxUNw vwQs+neuh5mFxFLkAEuuKqiA7SqO6GVgXX/OaMfo2U2Xe+5cGxoYsFEbE+q6ECAWmC KiD4RMGggVcRc9KtrM5ajRRZBw76KjQt2gjg/AGY= Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) by sourceware.org (Postfix) with ESMTPS id 303C5385840D for ; Mon, 6 Feb 2023 12:15:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 303C5385840D Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-163bd802238so14876007fac.1 for ; Mon, 06 Feb 2023 04:15:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WZwUKLYGUdL2Sd2fz962NxrQ7IBiYSZPEqYxHA8Kt9U=; b=eWJboPKP/U2JsgXgz1wl1ymXCvAAjp8w7QH1t/U7stj2v50S/SHLylKh96+AcPZwbX RCPPsXFfMWhl9MC5e5OJCW0PQzNnT8pVSIkDM5ytUdv/24DC4rdeMQmKKrq2TX8uZz7C u2D2dxj1KJ9bqN0iCqHHznF42q7JmRri7d1xZv81wY6PqMvDAYaOysMBgR/B3Gmwz3bJ WNTr/Zuy5OIei0xr2ypZ7Axd9Ql6JjKEB/fJLzTSPywH/9KHPvA+Fp4qOeWZwVWhOYAS /Evfn3mT5Pj/70h3SuZzFg6n0YMlMtWSjtMbTovu7wzJQN7wfKGGXO8Q1Tv+ntf3wbfm COSw== X-Gm-Message-State: AO0yUKWQc0kTSjAeio9zhAVtACnYEkoBfiSveoOh1HAT0EMiI3J0Bec0 HfiYX4Th2aQ+xYHUeAXVQocUuQ== X-Google-Smtp-Source: AK7set+vTsC1FaRKVNdZEM1AkSAyULagb/QrE1rtpqoR6KdIr/yJgRJAaF7TbaPK5YV1dndmSNejyQ== X-Received: by 2002:a05:6871:729:b0:15e:b02b:9da7 with SMTP id f41-20020a056871072900b0015eb02b9da7mr10155844oap.13.1675685709402; Mon, 06 Feb 2023 04:15:09 -0800 (PST) Received: from localhost ([189.100.172.221]) by smtp.gmail.com with ESMTPSA id a9-20020a056870d60900b0014435b51ef7sm3945978oaq.30.2023.02.06.04.15.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 04:15:08 -0800 (PST) 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> <394ff2b6-3b80-be04-d11f-231030045446@arm.com> User-agent: mu4e 1.8.13; emacs 28.2 To: Luis Machado Cc: Simon Marchi , Andrew Burgess , Thiago Jung Bauermann via Gdb-patches Subject: Re: [PATCH v3 4/8] gdbserver/linux-aarch64: When thread stops, update its target description In-reply-to: <394ff2b6-3b80-be04-d11f-231030045446@arm.com> Date: Mon, 06 Feb 2023 12:15:06 +0000 Message-ID: <87wn4vkn1x.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain 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: Thiago Jung Bauermann via Gdb-patches Reply-To: Thiago Jung Bauermann Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Luis Machado writes: > On 2/4/23 15:21, Thiago Jung Bauermann wrote: >> Luis Machado writes: >> >>> On 2/2/23 03:47, Simon Marchi wrote: >>>> 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. Nice! Thank you. -- Thiago