From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-163bd802238so14876007fac.1 for ; Mon, 06 Feb 2023 04:15:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:message-id:date:in-reply-to:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=WZwUKLYGUdL2Sd2fz962NxrQ7IBiYSZPEqYxHA8Kt9U=; b=xlHfiB19TFchghYZU1VscxQRpnBAVaKYH9mmhoZIikmd5D7BA3kp3KWKsWDggQvONl imeyEtiEIjyvApxYNt9O7woLFdAT7hZkKIjSG//M0dudEdX3R660sqadkyGggnIZZ/lm QQ0OplT7NPWhFZGAFrh1GYP3IaNubZfniDX6nt9HGrEHNeluP51X4N7ipdEnq9EowAsU mlW5R74fpXYCL4TU2EhalxusAw0zPYVvWA4LdSAM2Y2wWVWeYA0Wv1heelvP5+lm+FeZ Xhhax5cMHYroIKSacrbKjkKzt0hQQtg710LpXXsGqqEZv7Yfj6Am5DGJKV/AFSS4w1Xe R5zg== 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 From: Thiago Jung Bauermann 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-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: 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