From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kTleN9plZGrJgiwAWB0awg (envelope-from ) for ; Sat, 25 Jul 2026 03:29:30 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=C4A+xYEx; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id DF7141E09E; Sat, 25 Jul 2026 03:29:30 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 7D62D1E099 for ; Sat, 25 Jul 2026 03:29:30 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AE3084BA7999 for ; Sat, 25 Jul 2026 07:29:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE3084BA7999 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=C4A+xYEx Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 643514BA2E15 for ; Sat, 25 Jul 2026 07:29:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 643514BA2E15 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 643514BA2E15 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784964546; cv=none; b=l3S9ps7ksuWRKOrPmPdP7Da5VldB/ir/NnaRDhww2udV9FJgFRCut221Y1cF5Gg05w2nI/uK8oCQbPHyxS7YkoT5/MFP7DqIjBHlyn6EW7drhop/A2WHwtaTl+3MV7ujEQVrw+0qygrGFkab8PpMVk/3P9YVjsZwidj5jADvp1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784964546; c=relaxed/simple; bh=kw9Zj7C1riMXKEC7PlHLNppCci0pIBXGHi9Jbxbop9g=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=hyFLDGGbb6C+APeaW6pyCiNRSlnI/6MnOuYluFCx+vc9XWCFkA775gvzJFFm5rSKMsmnkCz3RNSF1aQX6KvRckuJx2Iii6ETzwrYR7rzNo0jVXR6qzKG2rlrFRL/rWnBV7OuOQapNbo7UAaYF+9L5+ramX5MZ53jHnufu8wPgFk= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=C4A+xYEx DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 643514BA2E15 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-47f7027ca11so649308f8f.3 for ; Sat, 25 Jul 2026 00:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784964545; x=1785569345; darn=sourceware.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=QhR0Zowl+rbfJnpQsM0AY2ggmIBKqolGF70jUODoYD4=; b=C4A+xYEx90Ggj2rlK2VkHsx6dfnswAMOjo2C3xBTCMWbaWXoUeXHM+gbKmnwIfA1XM AeXlr6wTUpG6EZqoVsOnCZLRKbeqig5gaZfQmcK0PiaRHGLA3ST0ljANZQAxRqLaqRxu MFKm0rj/u7t7VzSgWU+P0PgAa1DI19LmQGFVTfzPPFGwbvSv17xD9hzB11jGjOb/rXh6 UD0R9jutDi1YWOwmVWS9PT/ibngw/5YiKMKxc1MVCcHMG+JQl4iqJj71Tn1JMGA5uqA9 olvmSMsNI8fMOEM21WGLM+SJOMFkWteDZPRirdrYVxJFCJfSWPD1Kd0HPT7Dbrn7ROhm +NTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784964545; x=1785569345; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=QhR0Zowl+rbfJnpQsM0AY2ggmIBKqolGF70jUODoYD4=; b=GqI8t67O9usPuIPRkFNzZ3zHCebmnBPpn8ZWrSehb9JuZsKVVdO7UdEnUjlDEvodrW xklZLF87/paq8FqSJeQ5aCpo8TgcKZEP49lB20rxAgvc9nTrKyjfIl0r3WYtPE1GWXhL Phlxrk0NGDrr854wuPk/V1aE3GBe6Eb4Zwu9ceOVdKDJSOtFvWdNEjv0Pr4WjcnYBYQW rYc2HqusUdX4JOO6SrhZSsUdCjnzlxrXtMZ4WDouWm9rAd+o5Li7aQfZ43XZ3IfqEtXb VvSGZQO4Flx3fMRRJEFSxyriYDNocQGBv6u664i0SRxxEW+pGD+67eea9bkecoHUDeUG co9g== X-Gm-Message-State: AOJu0YySrKRmhVNqAqwVxQAjzBJvUzVK+xa4I/XXa3uhyEkqPE5tA1/L GE5W6tEzCG7IM2PuVUBUXptjHIbMzPWf5KO9T6M9zeDCaVI9tCZWA0Af X-Gm-Gg: AR+sD10TVL6NQznZZaOUsujWuXWbsZg6ZS7ZsdxtfZepbvXbed7dp5xr/EtozWCwnBG 9s+yL8Ajx5HLGB8qQdK3sMfJAXDoHE04TtL8CHnuDc3/Y7/ZZ2FmmpDAVDRp5GpSgh+Kf5/wQjd XM15CT0cJxaAeCL7O/0iXiGzNYwxEF6onhEtZpTQzXLzSucDbVgnEqwMpQYHIEGxUC9uFaiTLLs IjoSAXFKSfEmCjlC/4mguFHUaec3OUqcNwWolrtuBOV97Ggds0uSZiXnefLpTqXMwbAnfE9GvKD JZin1/3OcgnJb4+WCPxIdhgMmansCeGjbSJg9Q5ztLdZYkCTA707XfBfLEZH/m2Zp5Oa563eZJ+ brBwmt5m6+UNBMAZJNSQTD1i5kq31ABAlw5CHIEV4jO0/iO/+tFlpCSBp82VEWimyaNAnFWF0k+ T8ssb2/HOe+5zvoP8= X-Received: by 2002:a05:6000:615:b0:47f:95ec:a49b with SMTP id ffacd0b85a97d-47f9fe97cc8mr1403931f8f.34.1784964545169; Sat, 25 Jul 2026 00:29:05 -0700 (PDT) Received: from [192.168.0.38] ([86.12.216.189]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f96b9abc0sm11178440f8f.32.2026.07.25.00.29.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 25 Jul 2026 00:29:04 -0700 (PDT) Message-ID: Date: Sat, 25 Jul 2026 08:29:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/5] [PATCH 1/5] gdb/aarch64: Add POR_EL0 register support for FEAT_S1POE To: Thiago Jung Bauermann , Srinath Parvathaneni Cc: "gdb-patches@sourceware.org" , "guinevere@redhat.com" , Ezra Sitorus , Matthieu Longo , "simark@simark.ca" , Yury Khrustalev References: <20260714201530.78374-1-srinath.parvathaneni@arm.com> <20260714201530.78374-2-srinath.parvathaneni@arm.com> <29190e6c-7d33-4967-a21c-ed53cb1f43e2@gmail.com> <87fr17lhpx.fsf@linaro.org> Content-Language: en-US From: Luis In-Reply-To: <87fr17lhpx.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Hi, On 25/07/2026 07:13, Thiago Jung Bauermann wrote: > Srinath Parvathaneni writes: > >>>> * p/x $por_el0 >>>> * set $por_el0 = >>>> >>>> Example: >>>> (gdb) info register por_el0 >>>> por_el0 0x7 [ P15=--- P14=--- P13=--- P12=--- P11=--- P10=--- P9=--- P8=--- P7=--- >> P6=--- P5=--- P4=--- P3=--- P2=--- P1=--- P0=rwx ] >>>> (gdb) set $por_el0=0xffffffff77777777 >>>> (gdb) info register por_el0 >>>> por_el0 0xffffffff77777777 [ P15=??? P14=??? P13=??? P12=??? P11=??? P10=??? P9=??? >> P8=??? P7=rwx P6=rwx P5=rwx P4=rwx P3=rwx P2=rwx P1=rwx P0=rwx ] >>>> (gdb) p $por_el0 >>>> $1 = [ P15=??? P14=??? P13=??? P12=??? P11=??? P10=??? P9=??? P8=??? P7=rwx P6=rwx >> P5=rwx P4=rwx P3=rwx P2=rwx P1=rwx P0=rwx ] >>>> (gdb) p/x $por_el0 >>>> $2 = 0xffffffff77777777 >>>> (gdb) set $por_el0=0x57 >>>> (gdb) info register por_el0 >>>> por_el0 0x57 [ P15=--- P14=--- P13=--- P12=--- P11=--- P10=--- P9=--- P8=--- P7=--- >> P6=--- P5=--- P4=--- P3=--- P2=--- P1=rw- P0=rwx ] >>>> (gdb) set $por_el0=0xf7f7f7f7f7f7f7f7 >>>> (gdb) info register por_el0 >>>> por_el0 0xf7f7f7f7f7f7f7f7 [ P15=??? P14=rwx P13=??? P12=rwx P11=??? P10=rwx P9=??? >> P8=rwx P7=??? P6=rwx P5=??? P4=rwx P3=??? P2=rwx P1=??? P0=rwx ] >>>> (gdb) >>> >>> Looking at the output above I think it is a bit hard to read. > > I think part of the reason for it being hard to read is that the output > is very wide. Indeed. I mean, as an overview it's fine. But it really depends on the most common use case for this register. What I want to steer clear from is something like we have for SVE registers. It is a barrage of text that isn´t very easy to use. > > One way to address this is Srinath's suggestion below to not print > zeroed keys. Another would be to improve the output of the flag type to > add line breaks when the terminal's width is reached, as is done when > printing array values. > > Another option would be to use a struct rather than a flags type. Then > there would be one type per field, and it would be possible to display > (and set) only one key. > > Not sure which of them I prefer. The struct idea has the advantage of > letting the user easily set protection keys individually. OTOH it's > not printed isn a very compact way. > > If easily displaying/setting individual keys isn't that important, I > think I slightly prefer not printing zeroed keys as Srinath suggests, > possibly coupled with adding line breaks when the line is too long, to > address the case of having many keys set in the register. > Good suggestions. I'd say if users want... - An overview with permissions, then print what we have above - To use it as a mask, we should have the raw value - To read/write individual P entries within the register, then we should have pseudo-registers that map back to por_el0. The pseudo registers would leave the interpretation of the raw values out of the XML, therefore remote stubs wouldn´t need to pass that sort of information. Stretching it a little bit, remote stubs could even send a modified version of these fields in the XML and gdb would start printing something else.