From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 6699A3829988 for ; Sat, 26 Nov 2022 01:44:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6699A3829988 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-ot1-x32d.google.com with SMTP id m7-20020a9d6447000000b0066da0504b5eso3643653otl.13 for ; Fri, 25 Nov 2022 17:44:31 -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=5ebm3jGDD57AjWP8O6YJ9jNOe7kQR61F9gR5tGAOtf0=; b=XvIRwEpR16hgceWLARA5DltDcVrlvnizgO+CUowCTeDwcO3i/dnVS0lCIKbjtybafS GcSZn9NajbZ7/nyJHIORyJlRsnThFOJ+N/GnZDgcXnQtqC9lQ2isEjjRmUV3tBQW4eJb jXTjuvlS2SMIGKeZ7t7nfQ+fCcGsTZ2Q9fuJNqWzqXNIg1xxi+phb9o3fQivSwdmN7Kb yNre8FVpoKuDdwgjxf1RFzEHR5+vdGZnjr2Kdey3O5mYLaSJggNtOzVzZH9iKMdvoj77 oDkw1r8fXlLpQyiypuXz2UBENDXm+bp90+tCD9p3NYIZuW7WOLjke8Y7OP6ifytgP8OY luxg== 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=5ebm3jGDD57AjWP8O6YJ9jNOe7kQR61F9gR5tGAOtf0=; b=tEKe4/6Bi26G5SDSkhZYUZKVbv2MGtjz1YEjVfl78J1ACw8XWH+s4ax8PmNtJWzmMZ HucW082fFOvp0pSVrlK1p3/v03w/wLSutW9j3wFes58+E2KUNNiG8XOgZFEp/vquOPgx Y2xg8YcJXlXJQhS/bZnZs4JWgWZuZNvuIIJKxiytmJMHDu6XPKnpUklJUblaDNte8GnV tYdUSp35eP2O7EpRACdsM1XeD4qKL/laJqvfOIDC9Naw2rwMJbG7XaHG7x9o9PmuIR2R 7qyWlVauht16/KCG7xL1Ir+pPsXCAOzm7SB1v6rxdO9DfXoiJLNg82O0y7NHwV0XuQ++ U90g== X-Gm-Message-State: ANoB5pmIu5AGjtJMeKDFQgw6cjsp9c7u4m25IAHmy6ZOOzW85UykavUy 4kTkpQ8HL06D0wZ6ymgA7FCXMUlCi2DioQ== X-Google-Smtp-Source: AA0mqf4ldNf3yzK0nCExuHdEJA9v2J89dubpIgAh9rpglcS0Y0X/coIxEJ4d7sI7QXxJBY28vCfTEA== X-Received: by 2002:a05:6830:3693:b0:66c:a016:4ab7 with SMTP id bk19-20020a056830369300b0066ca0164ab7mr11247674otb.247.1669427070531; Fri, 25 Nov 2022 17:44:30 -0800 (PST) Received: from localhost ([2804:14d:7e39:8470:41ee:c7fc:c991:eee6]) by smtp.gmail.com with ESMTPSA id f5-20020a4ad805000000b0049fb39100a5sm2099011oov.37.2022.11.25.17.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 17:44:30 -0800 (PST) References: <20220908064151.3959930-1-thiago.bauermann@linaro.org> <20220908064151.3959930-5-thiago.bauermann@linaro.org> <7f22611a-ba26-866d-f3ec-1a1fd0b253bc@arm.com> User-agent: mu4e 1.8.11; emacs 28.2 From: Thiago Jung Bauermann To: Luis Machado Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 4/8] gdbserver/linux-aarch64: Factor out function to get aarch64_features In-reply-to: <7f22611a-ba26-866d-f3ec-1a1fd0b253bc@arm.com> Date: Sat, 26 Nov 2022 01:44:27 +0000 Message-ID: <87tu2m8p6s.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham 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 9/8/22 07:41, Thiago Jung Bauermann via Gdb-patches wrote: >> It will be used in a subsequent commit. There's no functional change. >> --- >> gdbserver/linux-aarch64-low.cc | 45 ++++++++++++++++++++++------------ >> 1 file changed, 29 insertions(+), 16 deletions(-) >> diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc >> index 576925838f49..9b57be73818e 100644 >> --- a/gdbserver/linux-aarch64-low.cc >> +++ b/gdbserver/linux-aarch64-low.cc >> @@ -652,6 +652,28 @@ aarch64_target::low_delete_process (arch_process_info *info) >> xfree (info); >> } >> +/* Matches HWCAP_PACA in kernel header arch/arm64/include/uapi/asm/hwcap.h. */ >> +#define AARCH64_HWCAP_PACA (1 << 30) >> + >> +static gdb::optional >> +aarch64_get_arch_features (const thread_info *thread) >> +{ >> + struct aarch64_features features; >> + int vq = aarch64_sve_get_vq (thread->id.lwp ()); >> + >> + if (vq < 0) >> + return {}; > > If we can't identify SVE properly, should we carry on and disable SVE > support but enable all the other features we can find? Yes, that's what happens in v2 now. aarch64_sve_get_vq isn't changed by the patch series anymore so it continues to return vq = 0 if ptrace fails. Because of that, in v2 this function now returns an aarch64_features struct directly. >> + >> + features.vq = vq; >> + /* A-profile PAC is 64-bit only. */ >> + features.pauth = linux_get_hwcap (thread, 8) & AARCH64_HWCAP_PACA; >> + /* A-profile MTE is 64-bit only. */ >> + features.mte = linux_get_hwcap2 (thread, 8) & HWCAP2_MTE; >> + features.tls = true; >> + >> + return features; >> +} -- Thiago