From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8dW0FormfGr5UyEAWB0awg (envelope-from ) for ; Wed, 12 Aug 2026 17:32:58 -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=qbLfgAUA; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 586421E09B; Wed, 12 Aug 2026 17:32:58 -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 [IPv6:2620:52:6:3111::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 8DE651E09B for ; Wed, 12 Aug 2026 17:32:57 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1448A4BB3B8A for ; Wed, 12 Aug 2026 21:32:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1448A4BB3B8A 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=qbLfgAUA Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id DA32F4BA798C for ; Wed, 12 Aug 2026 21:32:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DA32F4BA798C 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 DA32F4BA798C Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786570349; cv=none; b=gxiPENFLNcF1W6Ypk4Q70eGZGwvicUDp9bzV0WyqFmk8kpPm60UNckSXuHHQ6cGbB5bzYgMkHgnSxQ2QGXRKrAD/eWL7TJoXynXp+liCG7ozQAe7FwQTzJQXdPaM2GVxY2PAvbLghm3Xb75tPzJ9xuMe3vx+95WmZtfU0xtprms= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786570349; c=relaxed/simple; bh=vJq8prWSwSJIm/cJPO15KBHaUKApDT+XW/ajumUjdeo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=BGf3W3IbOElprXxmZq1RQ1vTquzif1cGh9IeSNE+rTBL14LarLOwW7zrLhTpR9x2iEoovIiXea5ie7QA64ymcSfHibOU82PDPyC/moo2MhY0/vpai8WN+iCbdPFLGc144+rXl6KdXJPj6Mem8u4fhUTfPqJgsEaqSCTwy+naSHo= 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=qbLfgAUA DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA32F4BA798C Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-47fe89fb333so821607f8f.3 for ; Wed, 12 Aug 2026 14:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786570347; x=1787175147; 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=c7k3PNWpMfX87SybJ26C0UD5v/B2InbMflip/wSSkGg=; b=qbLfgAUAyZdoR8uS1PlrBURtGrMddAzi8HyTAn5Htk/lPistURXEVb5V9n4GXX2HD9 0vxE1N8sWoPA1tdd0S24okF82s7PBc9BzmFuvYqZtD+lS1SsAFkXVAqMrDZDtS0rp6Kv +o6z3ZKgpQqIzOajwg5a0O0taxmk4f4CTxRR6RNzq6Hbn9siG0fxyiUlbhqYKwMQggu/ Opzfe4ZRAodYlhJJ/tSvK9wwF3DemEx3MTk47hxrFNClHFl81EExzsOo8LIE7SuhzLzx L623nDTNOuEVkekIh+Gt7hYNjlWiik+MnSqrjYvGd0CndQtTeIg7wMs7YXshZ2hCNFEJ K6SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786570347; x=1787175147; 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=c7k3PNWpMfX87SybJ26C0UD5v/B2InbMflip/wSSkGg=; b=W7TQCBsarQWrQPVDO7rPbiWWEytEKC7vuOhnMzbvz6bc98msNH8wMQxUuGpoQgtUFo 5qeFoozLvITXcHmxHcVS2k+L1nXYtAswMwrvIZhW7FsBryFd8cCOIdEtsyvaLGFHxT4N 5xeMfnErXVrG2Ur/X5tWmJhtrJ/aMhCR0rWGTEXqRmGN38sJN/pd5EJWYXcBSNxcZHKb pYOOt7oKkZW9eEL6mIOCdndupN5dS/F7Aw8TBK6ry2x4nt+HNM9l/mYc6LYGc/wsPHCh OvzVoUy9GbO1Fh5FedEQ2lYw2jCOf3MgshchZeOtamDAdXnOvn6bfTFlAZCcgroM4zU8 i0zg== X-Forwarded-Encrypted: i=1; AHgh+RpwJQf1/z3K0aqAMoworTpHGEH9SfMMrZ0D2ye6BHS+hFeZV+S3bewxBWhk9tmAzpVKvxf0hVY/K8+mfg==@sourceware.org X-Gm-Message-State: AOJu0YzWhbmHFb3+/nycTHE/gbFd9TYER+l/wObc3BosoTi7qr78A+Zr 30JV0fqvj8PpbfSWmkgIniuUraPSarHIR4r8msXyhA/yEd7NH7MwYKpk X-Gm-Gg: AR+sD12qpTWixGHfzrn1FVmxgG3i4k7wnPZUDcUvb9RtcDJ+WUvyocjBgZqQVGSHHF1 PEZoX6sEz6WTKtYssnsX4k6wpfBWuJDvyEJUoTLRZaHufzrnVE0fm+4ooLkCYXCqK8pwZj3rlPV kMtWe9lvs1kMUygcdtMimZZeM+2aeyITfqNPnzoA0HnYNBBwEQefDPRjF+QvDFhc0+q/qK/6uqH Lv4m1xJ30weBNT/gYs8GlNkfbUn83jVQmpGoggK91iu9FLzUp2lSLM1rR2RWFCNuW7Pb9oVPSg/ KQGoiV637ecqHTxKwwRF8n8tikZLqVg1gDbeWHtIcP1HW1L+o9pawRovDO/Wr19rTzvz7RAjmvG AmuYAcN70t19uxDbtGdO1DejarIip+hLeUO+8qi7Ps0OAHZvqc4N2PoWY53QL/DqnHv0jRBslTu Vu5imniAs5EDRwczAltv2xhLlVpcU76ylIduu6lMjm5B1eyvQcuJg+BM+Ek/yncdGGQWUVgPek8 A== X-Received: by 2002:a05:6000:4919:b0:47f:b51d:f0ec with SMTP id ffacd0b85a97d-48159eea06cmr1391601f8f.15.1786570347341; Wed, 12 Aug 2026 14:32:27 -0700 (PDT) Received: from [192.168.0.38] ([86.12.216.189]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4815a569ab3sm665566f8f.11.2026.08.12.14.32.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Aug 2026 14:32:26 -0700 (PDT) Message-ID: Date: Wed, 12 Aug 2026 22:32:25 +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: Srinath Parvathaneni , Thiago Jung Bauermann , GDB Patches Cc: "guinevere@redhat.com" , Ezra Sitorus , Matthieu Longo , "simark@simark.ca" , Peter Maydell References: <20260714201530.78374-1-srinath.parvathaneni@arm.com> <20260714201530.78374-2-srinath.parvathaneni@arm.com> <87bjbvlhey.fsf@linaro.org> <87tspmkiy4.fsf@linaro.org> Content-Language: en-US From: Luis In-Reply-To: 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 folks, Apologies for the delayed reply. On 07/08/2026 20:51, Srinath Parvathaneni wrote: > 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. > > > > Hi Luis/Thiago, > > After looking at the suggestions in the thread, I made a few changes to the > POR_EL0 interface. The custom display for por_el0 has been updated, and I've > also added support for pseudo registers for the individual permission > fields. > > Could you please have a look at the output below? If this looks ok, I'll > re-spin > the series, address the remaining review comments and send it out for > another > review. > > Also added a new group (por) for por_el0 register along with poe pseduo > registers. > > Set 1: > (gdb) info register por_el0 > por_el0        0x0000000000000077 [ P1=rwx P0=rwx ] > (gdb) info register por > por_el0        0x0000000000000077 [ P1=rwx P0=rwx ] > por_el0_p0     0x7                rwx > por_el0_p1     0x7                rwx > por_el0_p2     0x0                --- > por_el0_p3     0x0                --- > por_el0_p4     0x0                --- > por_el0_p5     0x0                --- > por_el0_p6     0x0                --- > por_el0_p7     0x0                --- > por_el0_p8     0x0                --- > por_el0_p9     0x0                --- > por_el0_p10    0x0                --- > por_el0_p11    0x0                --- > por_el0_p12    0x0                --- > por_el0_p13    0x0                --- > por_el0_p14    0x0                --- > por_el0_p15    0x0                --- > > Set 2: > (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) info register por > 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 ] > por_el0_p0     0x7                       rwx > por_el0_p1     0xf                        ??? > por_el0_p2     0x7                       rwx > por_el0_p3     0xf                        ??? > por_el0_p4     0x7                       rwx > por_el0_p5     0xf                      ??? > por_el0_p6     0x7                      rwx > por_el0_p7     0xf                      ??? > por_el0_p8     0x7                            rwx > por_el0_p9     0xf                             ??? > por_el0_p10    0x7                           rwx > por_el0_p11    0xf                            ??? > por_el0_p12    0x7                           rwx > por_el0_p13    0xf                            ??? > por_el0_p14    0x7                           rwx > por_el0_p15    0xf                            ??? > > Set 3: > (gdb) set $por_el0=0x0123456789abcdef > (gdb) info register por_el0 > por_el0        0x0123456789abcdef [ P14=r-- P13=--x P12=r-x P11=-w- >                                                   P10=rw- P9=-wx P8=rwx > P7=??? >                                                    P6=??? P5=??? P4=??? > P3=??? >                                                    P2=??? P1=??? P0=??? ] > (gdb) info register por > por_el0        0x0123456789abcdef [ P14=r-- P13=--x P12=r-x P11=-w- >                                                   P10=rw- P9=-wx P8=rwx > P7=??? >                                                   P6=??? P5=??? P4=??? > P3=??? >                                                   P2=??? P1=??? P0=??? ] > por_el0_p0     0xf                     ??? > por_el0_p1     0xe                    ??? > por_el0_p2     0xd                    ??? > por_el0_p3     0xc                    ??? > por_el0_p4     0xb                         ??? > por_el0_p5     0xa                         ??? > por_el0_p6     0x9                         ??? > por_el0_p7     0x8                         ??? > por_el0_p8     0x7                         rwx > por_el0_p9     0x6                         -wx > por_el0_p10    0x5                         rw- > por_el0_p11    0x4                        -w- > por_el0_p12    0x3                        r-x > por_el0_p13    0x2                        --x > por_el0_p14    0x1                        r-- > por_el0_p15    0x0                        --- > (gdb) > > Set 4: > (gdb) set $por_el0=0x7 > (gdb) info register por > por_el0        0x0000000000000007 [ P0=rwx ] > por_el0_p0     0x7                        rwx > por_el0_p1     0x0                        --- > por_el0_p2     0x0                       --- > por_el0_p3     0x0                        --- > por_el0_p4     0x0                        --- > por_el0_p5     0x0                        --- > por_el0_p6     0x0                        --- > por_el0_p7     0x0                        --- > por_el0_p8     0x0                        --- > por_el0_p9     0x0                        --- > por_el0_p10    0x0                        --- > por_el0_p11    0x0                        --- > por_el0_p12    0x0                        --- > por_el0_p13    0x0                        --- > por_el0_p14    0x0                        --- > por_el0_p15    0x0                        --- > (gdb) set $por_el0_p1=0x7 > (gdb) set $por_el0_p3=0x5 > (gdb) set $por_el0_p4=0x3 > (gdb) set $por_el0_p5=0x1 > (gdb) set $por_el0_p6=0xf > (gdb) info register por > por_el0        0x000000000f135077 [ P6=??? P5=r-- P4=r-x P3=rw- >                                                   P1=rwx P0=rwx ] > por_el0_p0     0x7                     rwx > por_el0_p1     0x7                   rwx > por_el0_p2     0x0                         --- > por_el0_p3     0x5                        rw- > por_el0_p4     0x3                        r-x > por_el0_p5     0x1                        r-- > por_el0_p6     0xf                        ??? > por_el0_p7     0x0                        --- > por_el0_p8     0x0                        --- > por_el0_p9     0x0                        --- > por_el0_p10    0x0                        --- > por_el0_p11    0x0                        --- > por_el0_p12    0x0                        --- > por_el0_p13    0x0                        --- > por_el0_p14    0x0                        --- > por_el0_p15    0x0                        --- > (gdb) > > Please let me know your comments, thanks. Thanks. I think this improves the usability quite a bit. Two comments on it, both not strong opinions: - The pseudo-register names could be shortened a bit. Or maybe autocompletion would work fine here. - Do we still have value in printing por_el0's subfields given we now have the pseudo-registers? As you've presented it, I think it's OK. But we might want to think about the above and make changes if those make sense.