From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 24XFAw0+618WZAAAWB0awg (envelope-from ) for ; Tue, 29 Dec 2020 09:32:45 -0500 Received: by simark.ca (Postfix, from userid 112) id 01CC31F0AA; Tue, 29 Dec 2020 09:32:44 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 8EF311E552 for ; Tue, 29 Dec 2020 09:32:44 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 62170386F010; Tue, 29 Dec 2020 14:32:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 62170386F010 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1609252363; bh=pdX9PWYAV7VVoWcBJfx/epGeRwle1yruXW6WZevxSFQ=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=SauubolZSOWfXVwyaSAvFjtQ+x6P3zRhxWg+M5gHNF5oc96NaIjDMBEm2hu/uNJhP 5bzLUoi0vxC6EzAfgWHxttCQdzHZff6X6cGly/vgR02zfElMN0/9tEjxbbaa82xvCc vU/GcA+BNn3dCQprsAj/b+byM/hPY6hXCX1hF9V8= Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) by sourceware.org (Postfix) with ESMTPS id 3898D384B011 for ; Tue, 29 Dec 2020 14:32:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3898D384B011 Received: by mail-qv1-xf2a.google.com with SMTP id p12so6369472qvj.13 for ; Tue, 29 Dec 2020 06:32:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pdX9PWYAV7VVoWcBJfx/epGeRwle1yruXW6WZevxSFQ=; b=Yakgw0NSlnOgkBwqLbgh6lef89IjAN5tnCDZ8l0Ihj/NvhkUBL2T5DvLP1PiBkQUPO qdglGbPgiwRg6t4t2VBwfQxbGNn/aGo3LSzFjMsSOFVBBjV7cx4hA9SJt4v1yRnKlp3e lR0sLMC9755kUvpSJzruAb5G3DGJ02toDgqe9xAlo+BS8eR4PU1WQAGvOLLBCV5vBPsw CnvIKbMZNiAjgMYRUnebKb3IsUMU3DxZUXpTLiRTuq71hCwVgZ8JLYTlKFR1nK6gekC3 8w6x1jkAzh79/lzdvP55tj+W5Z6szVKgrR/vgqhKhZrDSi5BTf47pRSNFmsejnQ20+41 Zm8A== X-Gm-Message-State: AOAM530c4S3CY+QuiTTVXx7zPzN7uNfVLe25Hj1q9VJ1MB2YJHo4G2eL pEuTvVupQTS371hOBhltryh1eyRU9smzSg== X-Google-Smtp-Source: ABdhPJyj7x+ce0uuqHXelRp1qcZ929ytc/ON5C5+cX8Lqpczz7p4UjX3p5YwCeVj3qwJZbJixkUvAA== X-Received: by 2002:a0c:ab8b:: with SMTP id j11mr52312311qvb.0.1609252360806; Tue, 29 Dec 2020 06:32:40 -0800 (PST) Received: from ?IPv6:2804:7f0:8284:370e:891:588d:2ac2:dc7e? ([2804:7f0:8284:370e:891:588d:2ac2:dc7e]) by smtp.gmail.com with ESMTPSA id z10sm26916266qtm.54.2020.12.29.06.32.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Dec 2020 06:32:40 -0800 (PST) Subject: Re: [PATCH v3 17/24] AArch64: Add gdbserver MTE support To: Simon Marchi , gdb-patches@sourceware.org References: <20201109170435.15766-1-luis.machado@linaro.org> <20201109170435.15766-18-luis.machado@linaro.org> <110e4fab-1adc-4df3-23e2-3b9822274b7e@polymtl.ca> Message-ID: <19237a1a-eaaa-333b-d61b-3d8eb8a227dc@linaro.org> Date: Tue, 29 Dec 2020 11:32:36 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <110e4fab-1adc-4df3-23e2-3b9822274b7e@polymtl.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 Cc: david.spickett@linaro.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 12/26/20 7:30 PM, Simon Marchi wrote: > > > On 2020-11-09 12:04 p.m., Luis Machado via Gdb-patches wrote: >> Updates on v2: >> >> - Updated target methods to contain a tag type parameter. >> >> -- >> >> Adds the AArch64-specific memory tagging support (MTE) by implementing the >> required hooks and checks for GDBserver. >> >> gdbserver/ChangeLog: >> >> YYYY-MM-DD Luis Machado >> >> * Makefile.in (SFILES): Add /../gdb/nat/aarch64-mte-linux-ptrace.c. >> * configure.srv (aarch64*-*-linux*): Add arch/aarch64-mte-linux.o and >> nat/aarch64-mte-linux-ptrace.o. >> * linux-aarch64-low.cc: Include nat/aarch64-mte-linux-ptrace.h. >> (class aarch64_target) >> : New method overrides. >> (aarch64_target::supports_memory_tagging) >> (aarch64_target::fetch_memtags) >> (aarch64_target::store_memtags): New methods. >> --- >> gdbserver/Makefile.in | 1 + >> gdbserver/configure.srv | 2 ++ >> gdbserver/linux-aarch64-low.cc | 61 ++++++++++++++++++++++++++++++++++ >> 3 files changed, 64 insertions(+) >> >> diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in >> index 1969ed0ec3..45b605c3b5 100644 >> --- a/gdbserver/Makefile.in >> +++ b/gdbserver/Makefile.in >> @@ -221,6 +221,7 @@ SFILES = \ >> $(srcdir)/../gdb/arch/ppc-linux-common.c \ >> $(srcdir)/../gdb/arch/riscv.c \ >> $(srcdir)/../gdb/nat/aarch64-sve-linux-ptrace.c \ >> + $(srcdir)/../gdb/nat/aarch64-mte-linux-ptrace.c \ >> $(srcdir)/../gdb/nat/linux-btrace.c \ >> $(srcdir)/../gdb/nat/linux-namespaces.c \ >> $(srcdir)/../gdb/nat/linux-osdata.c \ >> diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv >> index 833ad27c4c..0bbd990758 100644 >> --- a/gdbserver/configure.srv >> +++ b/gdbserver/configure.srv >> @@ -52,8 +52,10 @@ case "${gdbserver_host}" in >> srv_tgtobj="$srv_tgtobj nat/aarch64-linux.o" >> srv_tgtobj="$srv_tgtobj arch/aarch64-insn.o" >> srv_tgtobj="$srv_tgtobj arch/aarch64.o" >> + srv_tgtobj="$srv_tgtobj arch/aarch64-mte-linux.o" >> srv_tgtobj="$srv_tgtobj linux-aarch64-tdesc.o" >> srv_tgtobj="$srv_tgtobj nat/aarch64-sve-linux-ptrace.o" >> + srv_tgtobj="$srv_tgtobj nat/aarch64-mte-linux-ptrace.o" > > Please keep the list sorted. > Fixed. >> +int >> +aarch64_target::fetch_memtags (CORE_ADDR address, size_t len, >> + gdb::byte_vector &tags, int type) >> +{ >> + /* Allocation tags are per-process, so any tid is fine. */ >> + int tid = lwpid_of (current_thread); >> + >> + /* Allocation tag? */ >> + if (type == 1) >> + return aarch64_mte_fetch_memtags (tid, address, len, tags); > > Is there a define you could use instead of the magic "1"? Yes. I suppose I could share the definition with the GDB code. I'll fix the code. > > Simon >