From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +Z0dM9vVX2rkvSEAWB0awg (envelope-from ) for ; Tue, 21 Jul 2026 16:26:03 -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=FWW+RMMj; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CB2ED1E09E; Tue, 21 Jul 2026 16:26:03 -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 A4A9D1E033 for ; Tue, 21 Jul 2026 16:26:01 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 74B3B4BA2E17 for ; Tue, 21 Jul 2026 20:26:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74B3B4BA2E17 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=FWW+RMMj Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 41BF04BA5435 for ; Tue, 21 Jul 2026 20:25:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 41BF04BA5435 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 41BF04BA5435 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::330 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784665532; cv=none; b=lJkkgeGTZuoLu/jtTFZJRfcKj8KfxFsNYBeDvE+3stqtbNdfJZkuJwldo+HXv/nJCO1kNLsDEl2sKKgFv9U8WoyspagAItOQnxzmO7brgoK9saYJA52K9trZBQc/I4Td1MUEciEC9QyIrEXNT1WuaSfBlPgCOGezZdD8ofUr9Js= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784665532; c=relaxed/simple; bh=XAuVO9S64e0R4Ijb4gh2LOUgUj44TsQIcwxx50aGjck=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=fcf2JKTWJtwGUeN+lEucFbaXrF0QARWA84Cfvlvtap1pzBxFGE+bWrf/sVlkLOGZT4WPE5JqFPYpc/hcuf+89oWl6iunY+AdLi6XKFsG5q+bknXcIoyGK8sl0kwOi+TaYapi81zEEVr69WNIDqpD+0HZhEtPGJSxGyo3uS1n3Kc= 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=FWW+RMMj DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41BF04BA5435 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-495437bb891so44489195e9.1 for ; Tue, 21 Jul 2026 13:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784665531; x=1785270331; darn=sourceware.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=KNnhV2vCcoK0dwWKnnVEt/QPuIIBQsHSBBxnkcZXG6g=; b=FWW+RMMjcR0KkBMs/X0pu0AC6dGmhjCgrE2ul8wYUJBeQljy3piKUljJTqBtOASgKh zg6QqK4znoBZCu1yEJLPxRHEDAFkyMR5EkuqoaOIevQZ8QrjYc7vnBVTK/GbKUb9AWe5 UFjVb00RcZGE20qRpGHSJhZZ8k8PIU8MhY4oF3+UJJX773qB/al6Wr4bNdFmopHdlHRE 2tPCK3fl2J3ItFYecxaM6Zt8m2IOuZcIGQtjpn2hNvSKuUwtjWQ5uAHNJCVXaT7LIT/C X3SWlCQ+bccsQQ32itZcr13TLXZUY02p6sWl6dt76x2aj2vwQa0h9NOvgtjOFm2D0t6i TbxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784665531; x=1785270331; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:content-language: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=KNnhV2vCcoK0dwWKnnVEt/QPuIIBQsHSBBxnkcZXG6g=; b=V70hiOzqZLS4LNvE79/5FsqizTwXmetDoqG1buJsu+op7Hf7z5Q3QWgHETn4tf8WDb jnzVWHZbb2UI6ce873Y71Vbyq+e5bdSZOlNd3CHnXIKdMsOgveWKK7SLqaTCiZYJIQ4O Sp/i2sFSTsQEz3bTMMyJ8HBnHZevB73pbtpdsxaoHF6u0mSRZKhn4wsfYWF1Ifk+tEFb QWt+rg0//X0T9Vn/kita96fpcwSYAj1iWJK+2KCD9kH4vTUMJTBRySbyLsx0kL5DAkQV Eu2hB7skqq+8+V9HN/++bGydmGzckahrB50XGFRZKSt48zrtojdu1KSEHP2GJVtZHGfa Jxow== X-Forwarded-Encrypted: i=1; AHgh+RpDvdVedGRvbXqsK3STwEiGCAKjztzozAUgCAF0rzxB5EpG+rDSW9LdGQzevwcMdvR9PkWAun3VasdDmw==@sourceware.org X-Gm-Message-State: AOJu0YzTR2l22/zgMv3W/8N93CJPOD57JN4jtM83tBD/NhhiP9Bz02Qe mTmJOmzKB2fhpqg2ht34Z/jLrrv+I1qm9v882jQAb+bKGQ/G2lqfB1SM X-Gm-Gg: AfdE7cmUdggCl4dipq3IBGLCrwq0ja2RZC8+z2JqgUbo7MkOoETP4ycjqHbW+sDGd5X pQAg/i25A2EL7L0hcexkqVmSX0Wy2NvGzkU49PqCuWpox+vtlseRcaCZgS+V6lCKAQDPUbZ7G/J +NyN/Jb/Lm1yvVNmCX3bxm68nog9YW1tRlvtrMaT88tP7AP7UvAXrDjFtDQ7UyAQxFcD7b3j7Ge brRm8EhBIIYl8wgNxk2Z0SfYPV4Uut5372ov9Q69WFYWMlVb/976LKuL0zWpwadrIBbdNH5b8ky eSh1//5ZD0gOnVJPEWvIa0B+N0atWHF7KZMg1vxcj9UhZlp03JvV3pSj0OCLqjO2OqIj9cyA/Kt yDlZkV/RCKJ6dr11RCtdO+bvGdTFw1h004eZMOihH+cvu2HD1xeI9Cj/eN3/gPtpNcjhxPzqvIJ JN00UibBpHhFFDMAU= X-Received: by 2002:a05:600c:c4a2:b0:495:3bc6:d381 with SMTP id 5b1f17b1804b1-4956a4e5a5emr11140725e9.2.1784665530798; Tue, 21 Jul 2026 13:25:30 -0700 (PDT) Received: from [192.168.0.38] ([86.12.216.189]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956aae3861sm14867855e9.0.2026.07.21.13.25.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Jul 2026 13:25:30 -0700 (PDT) Message-ID: <29190e6c-7d33-4967-a21c-ed53cb1f43e2@gmail.com> Date: Tue, 21 Jul 2026 21:25:28 +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 Content-Language: en-US To: srinath.parvathaneni@arm.com, gdb-patches@sourceware.org Cc: guinevere@redhat.com, thiago.bauermann@linaro.org, Ezra.Sitorus@arm.com, Matthieu.Longo@arm.com, simark@simark.ca References: <20260714201530.78374-1-srinath.parvathaneni@arm.com> <20260714201530.78374-2-srinath.parvathaneni@arm.com> From: Luis In-Reply-To: <20260714201530.78374-2-srinath.parvathaneni@arm.com> 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 Sorry, missed some... On 14/07/2026 21:15, srinath.parvathaneni@arm.com wrote: > From: Srinath Parvathaneni > > Add support for the FEAT_S1POE POR_EL0 register on AArch64. > > This patch adds POR_EL0 to the AArch64 register set and reads/writes it > using the NT_ARM_POE ptrace regset. > > With this change, POR_EL0 is available through: > * info registers > * info registers por_el0 > * p $por_el0 > * 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) > --- > gdb/Makefile.in | 2 ++ > gdb/aarch64-linux-nat.c | 64 +++++++++++++++++++++++++++++++++ > gdb/aarch64-tdep.c | 23 ++++++++++++ > gdb/aarch64-tdep.h | 10 ++++++ > gdb/arch/aarch64-poe-linux.h | 29 +++++++++++++++ > gdb/arch/aarch64.c | 4 +++ > gdb/arch/aarch64.h | 8 ++++- > gdb/features/Makefile | 1 + > gdb/features/aarch64-poe.c | 68 ++++++++++++++++++++++++++++++++++++ > gdb/features/aarch64-poe.xml | 47 +++++++++++++++++++++++++ > gdb/nat/aarch64-poe-linux.h | 29 +++++++++++++++ > 11 files changed, 284 insertions(+), 1 deletion(-) > create mode 100644 gdb/arch/aarch64-poe-linux.h > create mode 100644 gdb/features/aarch64-poe.c > create mode 100644 gdb/features/aarch64-poe.xml > create mode 100644 gdb/nat/aarch64-poe-linux.h > > diff --git a/gdb/Makefile.in b/gdb/Makefile.in > index 57f384170ab..3dc9cd07dcb 100644 > --- a/gdb/Makefile.in > +++ b/gdb/Makefile.in > @@ -1292,6 +1292,7 @@ HFILES_NO_SRCDIR = \ > arch/aarch32.h \ > arch/aarch64-fpmr-linux.h \ > arch/aarch64-gcs-linux.h \ > + arch/aarch64-poe-linux.h \ > arch/aarch64.h \ > arch/aarch64-insn.h \ > arch/aarch64-mte.h \ > @@ -1540,6 +1541,7 @@ HFILES_NO_SRCDIR = \ > namespace.h \ > nat/aarch64-fpmr-linux.h \ > nat/aarch64-gcs-linux.h \ > + nat/aarch64-poe-linux.h \ > nat/aarch64-hw-point.h \ > nat/aarch64-linux.h \ > nat/aarch64-linux-hw-point.h \ Let's keep these entries sorted alphabetically. > diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c > index 52ace4aab41..8e29c42908c 100644 > --- a/gdb/aarch64-linux-nat.c > +++ b/gdb/aarch64-linux-nat.c > @@ -34,6 +34,7 @@ > #include "arch/arm.h" > #include "nat/aarch64-fpmr-linux.h" > #include "nat/aarch64-gcs-linux.h" > +#include "nat/aarch64-poe-linux.h" > #include "nat/aarch64-linux.h" > #include "nat/aarch64-linux-hw-point.h" > #include "nat/aarch64-mte-linux-ptrace.h" > @@ -602,6 +603,54 @@ store_gcsregs_to_thread (regcache *regcache) > perror_with_name (_("Unable to store GCS registers")); > } > > +/* Fill GDB's register array with the POE register value from the current > + thread. */ > + > +static void > +fetch_poeregs_from_thread (regcache *regcache) > +{ > + aarch64_gdbarch_tdep *tdep > + = gdbarch_tdep (regcache->arch ()); > + > + gdb_assert (tdep->has_poe ()); > + > + uint64_t user_poe; > + iovec iovec; > + > + iovec.iov_base = &user_poe; > + iovec.iov_len = sizeof (user_poe); > + > + int tid = get_ptrace_pid (regcache->ptid ()); > + if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_POE, &iovec) != 0) > + perror_with_name (_("Unable to fetch POE register")); > + > + regcache->raw_supply (tdep->poe_regnum, &user_poe); > +} > + > +/* Store the NT_ARM_POE register contents from GDB's REGCACHE to the > + thread associated with REGCACHE. */ wront identation above. > + > +static void > +store_poeregs_to_thread (struct regcache *regcache) > +{ > + aarch64_gdbarch_tdep *tdep > + = gdbarch_tdep (regcache->arch ()); > + > + gdb_assert (tdep->has_poe ()); > + > + int tid = regcache->ptid ().lwp (); > + > + iovec iovec; > + uint64_t user_poe; > + iovec.iov_base = &user_poe; > + iovec.iov_len = sizeof (user_poe); > + > + regcache->raw_collect (tdep->poe_regnum, &user_poe); > + > + if (ptrace (PTRACE_SETREGSET, tid, NT_ARM_POE, &iovec) != 0) > + perror_with_name (_("Unable to store POE register")); > +} > + > /* Fill GDB's REGCACHE with the FPMR register set content from the > thread associated with REGCACHE. */ > > @@ -683,6 +732,9 @@ aarch64_fetch_registers (struct regcache *regcache, int regno) > if (tdep->has_gcs_linux ()) > fetch_gcsregs_from_thread (regcache); > > + if (tdep->has_poe ()) > + fetch_poeregs_from_thread (regcache); > + > if (tdep->has_fpmr ()) > fetch_fpmr_from_thread (regcache); > } > @@ -722,6 +774,9 @@ aarch64_fetch_registers (struct regcache *regcache, int regno) > && (regno == tdep->gcs_reg_base || regno == tdep->gcs_linux_reg_base > || regno == tdep->gcs_linux_reg_base + 1)) > fetch_gcsregs_from_thread (regcache); > + /* POE register? */ > + else if (tdep->has_poe () && (regno == tdep->poe_regnum)) > + fetch_poeregs_from_thread (regcache); > /* FPMR? */ > else if (tdep->has_fpmr () && (regno == tdep->fpmr_regnum)) > fetch_fpmr_from_thread (regcache); > @@ -802,6 +857,9 @@ aarch64_store_registers (struct regcache *regcache, int regno) > > if (tdep->has_fpmr ()) > store_fpmr_to_thread (regcache); > + > + if (tdep->has_poe ()) > + store_poeregs_to_thread (regcache); > } > /* General purpose register? */ > else if (regno < AARCH64_V0_REGNUM) > @@ -836,6 +894,9 @@ aarch64_store_registers (struct regcache *regcache, int regno) > /* FPMR? */ > else if (tdep->has_fpmr () && regno == tdep->fpmr_regnum) > store_fpmr_to_thread (regcache); > + /* POE register? */ > + else if (tdep->has_poe () && regno == tdep->poe_regnum) > + store_poeregs_to_thread (regcache); > > /* PAuth registers are read-only. */ > } > @@ -1024,6 +1085,9 @@ aarch64_linux_nat_target::read_description () > /* Check for FPMR. */ > features.fpmr = hwcap2 & HWCAP2_FPMR; > > + /* Check for POE support. */ > + features.poe = hwcap2 & HWCAP2_POE; > + > return aarch64_read_description (features); > } > > diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c > index a84da1fd59e..2e86d6e0452 100644 > --- a/gdb/aarch64-tdep.c > +++ b/gdb/aarch64-tdep.c > @@ -164,6 +164,11 @@ static const char *const aarch64_gcs_register_names[] = { > "gcspr" > }; > > +static const char *const aarch64_poe_register_names[] = { > + /* Permission Overlay Extension Register. */ > + "por_el0" > +}; > + > static const char *const aarch64_gcs_linux_register_names[] = { > /* Field in struct user_gcs. */ > "gcs_features_enabled", > @@ -4136,6 +4141,10 @@ aarch64_features_from_target_desc (const struct target_desc *tdesc) > features.fpmr = (tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.fpmr") > != nullptr); > > + /* Check for POE feature. */ > + features.poe = (tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.poe") > + != nullptr); > + > return features; > } > > @@ -4556,6 +4565,19 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > fpmr_regnum, "fpmr"); > } > > + int poe_regnum = -1; > + const struct tdesc_feature *feature_poe > + = tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.poe"); > + if (feature_poe != nullptr) > + { > + poe_regnum = num_regs; > + for (i = 0; i < ARRAY_SIZE (aarch64_poe_register_names); i++) > + valid_p &= tdesc_numbered_register (feature_poe, tdesc_data.get (), > + poe_regnum + i, > + aarch64_poe_register_names[i]); > + num_regs++; > + } > + > int first_sme_regnum = -1; > int first_sme2_regnum = -1; > int first_sme_pseudo_regnum = -1; > @@ -4756,6 +4778,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) > tdep->gcs_reg_base = first_gcs_regnum; > tdep->gcs_linux_reg_base = first_gcs_linux_regnum; > tdep->fpmr_regnum = fpmr_regnum; > + tdep->poe_regnum = poe_regnum; > > /* Set the SME register set details. The pseudo-registers will be adjusted > later. */ > diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h > index dff05a08f84..3c5d10beee5 100644 > --- a/gdb/aarch64-tdep.h > +++ b/gdb/aarch64-tdep.h > @@ -208,6 +208,16 @@ struct aarch64_gdbarch_tdep : gdbarch_tdep_base > return gcs_linux_reg_base != -1; > } > > + /* POE register. This is -1 if no POE feature is available. */ > + int poe_regnum = -1; > + > + /* Returns true if the target supports the POE feature. */ > + bool > + has_poe () const > + { > + return poe_regnum != -1; > + } > + > /* First FPMR register. This is -1 if FPMR is not supported. */ > int fpmr_regnum = -1; > > diff --git a/gdb/arch/aarch64-poe-linux.h b/gdb/arch/aarch64-poe-linux.h > new file mode 100644 > index 00000000000..8623fa43b54 > --- /dev/null > +++ b/gdb/arch/aarch64-poe-linux.h > @@ -0,0 +1,29 @@ > +/* Common Linux target-dependent definitions for AArch64 POE > + > + Copyright (C) 2026 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#ifndef GDB_ARCH_AARCH64_POE_LINUX_H > +#define GDB_ARCH_AARCH64_POE_LINUX_H > + > +/* Feature check for Permission Overlay Extension. */ > +#define AARCH64_HWCAP2_POE (1ULL << 63) > + > +/* Data or instruction abort caused by Protection Key Violation. */ > +#define AARCH64_SEGV_PKUERR 4 > + > +#endif /* GDB_ARCH_AARCH64_POE_LINUX_H. */ > diff --git a/gdb/arch/aarch64.c b/gdb/arch/aarch64.c > index 2401a325b7b..a567938d06d 100644 > --- a/gdb/arch/aarch64.c > +++ b/gdb/arch/aarch64.c > @@ -28,6 +28,7 @@ > #include "../features/aarch64-sme2.c" > #include "../features/aarch64-tls.c" > #include "../features/aarch64-gcs.c" > +#include "../features/aarch64-poe.c" > #include "../features/aarch64-gcs-linux.c" > > /* See arch/aarch64.h. */ > @@ -77,6 +78,9 @@ aarch64_create_target_description (const aarch64_features &features) > if (features.fpmr) > regnum = create_feature_aarch64_fpmr (tdesc.get (), regnum); > > + if (features.poe) > + regnum = create_feature_aarch64_poe (tdesc.get (), regnum); > + > return tdesc; > } > > diff --git a/gdb/arch/aarch64.h b/gdb/arch/aarch64.h > index cf7318cbe74..ba90d55c3bb 100644 > --- a/gdb/arch/aarch64.h > +++ b/gdb/arch/aarch64.h > @@ -35,6 +35,8 @@ struct aarch64_features > bool pauth = false; > bool mte = false; > bool fpmr = false; > + /* Whether the Permission Overlay Extension (FEAT_S1POE) is supported. */ > + bool poe = false; > > /* A positive TLS value indicates the number of TLS registers available. */ > uint8_t tls = 0; > @@ -70,7 +72,8 @@ inline bool operator==(const aarch64_features &lhs, const aarch64_features &rhs) > && lhs.sme2 == rhs.sme2 > && lhs.gcs == rhs.gcs > && lhs.gcs_linux == rhs.gcs_linux > - && lhs.fpmr == rhs.fpmr; > + && lhs.fpmr == rhs.fpmr > + && lhs.poe == rhs.poe; > } > > namespace std > @@ -103,6 +106,9 @@ namespace std > > /* FPMR feature. */ > h = h << 1 | features.fpmr; > + > + /* POE feature. */ > + h = h << 1 | features.poe; > return h; > } > }; > diff --git a/gdb/features/Makefile b/gdb/features/Makefile > index 161a7453d66..cc77e5bb652 100644 > --- a/gdb/features/Makefile > +++ b/gdb/features/Makefile > @@ -207,6 +207,7 @@ FEATURE_XMLFILES = aarch64-core.xml \ > aarch64-pauth.xml \ > aarch64-mte.xml \ > aarch64-gcs.xml \ > + aarch64-poe.xml \ > aarch64-gcs-linux.xml \ > arc/v1-core.xml \ > arc/v1-aux.xml \ > diff --git a/gdb/features/aarch64-poe.c b/gdb/features/aarch64-poe.c > new file mode 100644 > index 00000000000..4bd795e9fe6 > --- /dev/null > +++ b/gdb/features/aarch64-poe.c > @@ -0,0 +1,68 @@ > +/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro: > + Original: aarch64-poe.xml */ > + > +#include "gdbsupport/tdesc.h" > + > +static int > +create_feature_aarch64_poe (struct target_desc *result, long regnum) > +{ > + struct tdesc_feature *feature; > + > + feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.poe"); > + tdesc_type_with_fields *type_with_fields; > + type_with_fields = tdesc_create_enum (feature, "por_el0_fmt", 4); > + tdesc_add_enum_value (type_with_fields, 0, "---"); > + tdesc_add_enum_value (type_with_fields, 1, "r--"); > + tdesc_add_enum_value (type_with_fields, 2, "--x"); > + tdesc_add_enum_value (type_with_fields, 3, "r-x"); > + tdesc_add_enum_value (type_with_fields, 4, "-w-"); > + tdesc_add_enum_value (type_with_fields, 5, "rw-"); > + tdesc_add_enum_value (type_with_fields, 6, "-wx"); > + tdesc_add_enum_value (type_with_fields, 7, "rwx"); > + tdesc_add_enum_value (type_with_fields, 8, "???"); > + tdesc_add_enum_value (type_with_fields, 9, "???"); > + tdesc_add_enum_value (type_with_fields, 10, "???"); > + tdesc_add_enum_value (type_with_fields, 11, "???"); > + tdesc_add_enum_value (type_with_fields, 12, "???"); > + tdesc_add_enum_value (type_with_fields, 13, "???"); > + tdesc_add_enum_value (type_with_fields, 14, "???"); > + tdesc_add_enum_value (type_with_fields, 15, "???"); > + > + type_with_fields = tdesc_create_flags (feature, "por_el0_flags", 8); > + tdesc_type *field_type; > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P15", 60, 63, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P14", 56, 59, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P13", 52, 55, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P12", 48, 51, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P11", 44, 47, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P10", 40, 43, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P9", 36, 39, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P8", 32, 35, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P7", 28, 31, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P6", 24, 27, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P5", 20, 23, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P4", 16, 19, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P3", 12, 15, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P2", 8, 11, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P1", 4, 7, field_type); > + field_type = tdesc_named_type (feature, "por_el0_fmt"); > + tdesc_add_typed_bitfield (type_with_fields, "P0", 0, 3, field_type); > + > + tdesc_create_reg (feature, "por_el0", regnum++, 1, "system", 64, "por_el0_flags"); > + return regnum; > +} > diff --git a/gdb/features/aarch64-poe.xml b/gdb/features/aarch64-poe.xml > new file mode 100644 > index 00000000000..58fc4f80d5c > --- /dev/null > +++ b/gdb/features/aarch64-poe.xml > @@ -0,0 +1,47 @@ > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > diff --git a/gdb/nat/aarch64-poe-linux.h b/gdb/nat/aarch64-poe-linux.h > new file mode 100644 > index 00000000000..f3d0256da3f > --- /dev/null > +++ b/gdb/nat/aarch64-poe-linux.h > @@ -0,0 +1,29 @@ > +/* Common native Linux definitions for AArch64 Permission Overlay Extension. > + > + Copyright (C) 2026 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#include Shouldn´t the above be inside the include guard? > +#ifndef GDB_NAT_AARCH64_POE_LINUX_H > +#define GDB_NAT_AARCH64_POE_LINUX_H > + > +/* Feature check for Permission Overlay Extension. */ > +#ifndef HWCAP2_POE > +#define HWCAP2_POE (1ULL << 63) > +#endif /* HWCAP2_POE. */ > + > +#endif /* GDB_NAT_AARCH64_POE_LINUX_H. */