From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eMujNT/5tGAZPAAAWB0awg (envelope-from ) for ; Mon, 31 May 2021 10:57:03 -0400 Received: by simark.ca (Postfix, from userid 112) id CDC2C1F163; Mon, 31 May 2021 10:57:03 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 236B91E940 for ; Mon, 31 May 2021 10:57:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C67AE3848035; Mon, 31 May 2021 14:57:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C67AE3848035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1622473022; bh=+NfTOejQ60t24YvX+aqgXNX1fc0mNWi8b5spzmraEv8=; 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=Q2BG4uPEr6XlI5XP2JTjfY5cP3xk6meq+h/NOJhBXSZrLk+ZCF/+nrsWeVGyqXGQ8 5T4An9HBMQXUfgRmIoYbHO4FRLkJb7VURlQU1+XqAjwCku5aNL2D3S/ybTTyPxHtbc YbClGWrHV2ABpMOWHL25POzByleM3r9FLdva3d3g= Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by sourceware.org (Postfix) with ESMTPS id 1CB4138515E6 for ; Mon, 31 May 2021 14:57:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1CB4138515E6 Received: by mail-qk1-x736.google.com with SMTP id j184so11429592qkd.6 for ; Mon, 31 May 2021 07:57:00 -0700 (PDT) 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=+NfTOejQ60t24YvX+aqgXNX1fc0mNWi8b5spzmraEv8=; b=Ktp3Cv0vKdfDl3ZfMd+t9IrQCR8uR40aD7gh4ubdWgdZ16n3dLK1acJZY+tziPmr4W DvnnVGkZfhiAoYdj4cwsiyHO8zUf+VXPFr81DcES1IMw4CTu6ePUjx2XTXE8z7VWBmwA SPmLOSoZJ5jK2u8deL8uCTVuTmYWrcNSP01g2K32PpEQaFn2bUKwPno87mkg5/93CbEH UulK9R242lo+485HYz30gZIYSNTU0ZIdbxSJNVidNNKWKyUPOaVPJtCvuCUChbPEAQyq 39iES+rowZ85TCIcLoHYJgumVcDKljNP5/rTLgg4MZTjW65EZ+dOyKUQnM+049xa6VG5 9zIg== X-Gm-Message-State: AOAM530vfo8VNiRZ7/AHduvuLAk6IZgAvFgaAzNseoFykg9FQJOhaF+F HC4BLdmXoHBd4qmDpxz8x9ULpg== X-Google-Smtp-Source: ABdhPJzn68CXZins/Q/HZv8bhSSRMGR2w3Nbe+grHiTslvV6CKmlr6HDX+kanwGRHvpmdiCx1X+RqQ== X-Received: by 2002:a05:620a:8d6:: with SMTP id z22mr17002813qkz.407.1622473019653; Mon, 31 May 2021 07:56:59 -0700 (PDT) Received: from ?IPv6:2804:7f0:4841:5c9d:d181:e3a7:9333:1f86? ([2804:7f0:4841:5c9d:d181:e3a7:9333:1f86]) by smtp.gmail.com with ESMTPSA id e19sm8548335qtr.45.2021.05.31.07.56.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 May 2021 07:56:59 -0700 (PDT) Subject: Re: [PATCH,v2] [AArch64] MTE corefile support To: Simon Marchi , gdb-patches@sourceware.org References: <20210518202047.3492211-1-luis.machado@linaro.org> <20210526140838.3856474-1-luis.machado@linaro.org> <4ae84e2c-f0c4-bcac-1e5d-b9b34d8521db@linaro.org> <87af0c4e-7a26-ecde-dc4e-95f96ec2ccc8@polymtl.ca> Message-ID: <860e15d8-ed55-d5de-6d72-1aedd9a84f93@linaro.org> Date: Mon, 31 May 2021 11:56:53 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <87af0c4e-7a26-ecde-dc4e-95f96ec2ccc8@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, catalin.marinas@arm.com Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 5/31/21 11:49 AM, Simon Marchi wrote: > On 2021-05-31 10:12 a.m., Luis Machado wrote: >>>> @@ -71,4 +72,18 @@ extern CORE_ADDR aarch64_mte_set_ltag (CORE_ADDR address, CORE_ADDR tag); >>>> It is always possible to get the logical tag. */ >>>> extern CORE_ADDR aarch64_mte_get_ltag (CORE_ADDR address); >>>> +/* MTE-specific NT_MEMTAG header. */ >>>> +struct tag_dump_mte >>>> +{ >>>> + /* Size of the tag granule in bytes. */ >>>> + uint16_t granule_byte_size; >>>> + /* Size of the tag in bits. */ >>>> + uint16_t tag_bit_size; >>>> + /* Reserved field for the future. */ >>>> + uint16_t __unused; >>>> +}; >>> >>> This struct is unused. >>> >> >> I'm inclined to leave that as documentation instead, so it is clear what the header sizes are referring to. > > The thing is that somebody reading the code in the .c seeing the > arbitrary sizeofs will note have a clue to go look at > arch/aarch64-mte-linux.h for explanations. So another option would be > to write it as a comment near the code. Something like: > > /* The header follows the following format: > > struct > { > /* Size of the tag granule in bytes. */ > uint16_t granule_byte_size; > /* Size of the tag in bits. */ > uint16_t tag_bit_size; > /* Reserved field for the future. */ > uint16_t __unused; > }; > */ > > Another option would be to have the structure and refer to its fields in > sizeof: > > store_unsigned_integer (buf, sizeof (tag_dump_mte::granule_byte_size), > byte_order, AARCH64_MTE_GRANULE_SIZE); I think that would work as well. I can change it for the next iteration.