From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id dcZ/MFbXX2rpxCEAWB0awg (envelope-from ) for ; Tue, 21 Jul 2026 16:32:22 -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=LZrTaXFR; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id AECCF1E09E; Tue, 21 Jul 2026 16:32:22 -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 DFBF31E033 for ; Tue, 21 Jul 2026 16:32:21 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4DD3F4BA2E37 for ; Tue, 21 Jul 2026 20:32:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4DD3F4BA2E37 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=LZrTaXFR Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 2994B4BA2E16 for ; Tue, 21 Jul 2026 20:30:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2994B4BA2E16 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 2994B4BA2E16 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784665812; cv=none; b=oLb3qzq6ZFzDwiMZoch+JAXDL/Lfo3J/hdCmdrKqsviYJ3L6pcey6Oftj+wwp4qpz81ZLCoFpllVd34ck1qbO5Gl0QAS1G2Xdql4J1gw5pJqWEgtddYoWXVijvCvxYt/U44Qr20/sBKLjqaYv9nRBW+hjlFV3ZKGd7fNqp3EsMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784665812; c=relaxed/simple; bh=9UAHoduOboZ1pcLVjebWJJpnNdcP+5ix1MCd5OIXxo4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=VcsvMS+a0oqmTV2XfXaH2fIGJN/aMRMtZX6obpr3jSydyf+kkeSVrnXcE+1B6+a/RRHftUuUfukFG9ow8zIYl0eUHByKEybJ8rw7SyGB+vO3vSUURJfZ6wr1sXUQdcQPOhSLk7mtHLVUauk8S1IkL429drnrZ5mQqEackEeoK2g= 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=LZrTaXFR DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2994B4BA2E16 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4955158f26aso22396935e9.3 for ; Tue, 21 Jul 2026 13:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784665811; x=1785270611; 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=dR3BL2a/rGodoDjYzjNyPGJjUXOQucI0VFdHuo8OgRg=; b=LZrTaXFR8o+By5phWGpMvDw3lTt0w8fhBgNKAncbNFRIM52tKZouFU3kDqsxPlSw8X NzmVALD7g1pzKXoO7lnPsQWnRwEVf5BfNNRCCjQFxxdbrj8lg84weSM+nKH6q3P9n6TA lhjcCpgj9IYaS/R5SMptJr1VHCKVtBpLdFt1XFpjrt+efBQGugoQXsXnWca+BrvaQf4g Gz4umuPJsQUFtRh4Bj3RseCZZ2G/ZST9etxcEAkfD4Hu9A1Qrri/iskJIU0vuera1PZk 1SXRjZ/vNEGtwzt03XSw9xx5GCVtLFqzEEH/gitObKYmiEods1v8OG24WNZ2OMjV9GFC ADjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784665811; x=1785270611; 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=dR3BL2a/rGodoDjYzjNyPGJjUXOQucI0VFdHuo8OgRg=; b=FDrzZcEynWV4eS3cbb2ZhJGe5sqh824OKiIOIYj1+p+f8U8ORigmTEIbI1m3HxYgv/ 6+WiJI+qKVNOAJoZipF3X9jHeqKDLDv+f11uYoKvzrT4HCtCeGf1zS9M8R/tel//YV/e GY1vm8xiMuP9t9rka9ENaaIsyQCgM6F/bcA7zzKF4X6cSEJOHuaQy3wlRzx9d3yWsyE5 ooFIgU2L5ZJf/tBWWF72FWdnPcIUoMaJUTWcS7aIgvfTV21WpcNzI29NbIi2axAD8m33 2Jca5bXWpmATWCiwIARUHUv+yjrEo81HJaQBWJDm+p6vDXhqDsBtXjfVlL9qNipHbWaQ kv+w== X-Forwarded-Encrypted: i=1; AHgh+RqnzZ1y+LElBQeekdS/qksPe7RY9PaLzj28oK/vfdwoWWcZE+P8VvQOm8fbS9sf/0xu0Aihu5U0/uwZag==@sourceware.org X-Gm-Message-State: AOJu0YzqUwOI1Ctde7Y3GNilGo6JG/qOKntdPDes2pFJO/aisOvHafgf KxiI+TmU/dhSn9dxZaQHABzGA3f1ufLLWvZ157YlFS7T9Q5eT2uImCc8 X-Gm-Gg: AR+sD12Aw8o0oR/u7HWfibPtCvjX0RUZDhT33KxgRfWHTXAdE1YhlGaPKq2x9aHYRRp 8WBt48rm5xL9HL82qcssZvd5rPXz29B8QOi9wtnpkrw3YnkpZ8xhWN17wlF1kimTpgQbWRAX4k6 PpTZy0K2cIDmjOVXYX7KQRJJEx08VlVbJJLqWWvf/I592xPrhShAnMqgm9mhizCBPvCMv8YU67E 9c0jlmP9UpPcWDZGOaktBiHA/kRbGZ3d1JvTDJQRVFCCKBkIeSvPO35yjYbkDvrAx+aIwz+79vR ujTKswb5YMKKDboVNDekoBAyZvgMSeazEV2Ur7EKBoKVDk2hJmo1P1B9iAhPi8VMZ0dMhF91vzq HUbOtKao9rZYxllA9Plj5HDaeRSH8/dYq19H7vEHJqWwov8Hk9ZB8iFOElWXjbnLvytp7M4Akhk UZaqn3hlySr9f6rGc= X-Received: by 2002:a05:600c:8b16:b0:495:69eb:27fe with SMTP id 5b1f17b1804b1-49569eb28a0mr21980115e9.11.1784665810974; Tue, 21 Jul 2026 13:30:10 -0700 (PDT) Received: from [192.168.0.38] ([86.12.216.189]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4956aae3861sm15134495e9.0.2026.07.21.13.30.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Jul 2026 13:30:10 -0700 (PDT) Message-ID: <3ae1161e-bc58-4cc4-a71d-c12b5b62d611@gmail.com> Date: Tue, 21 Jul 2026 21:30:09 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/5] [PATCH 2/5] gdb: Improve SIGSEGV diagnostics for POE faults 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-3-srinath.parvathaneni@arm.com> From: Luis In-Reply-To: <20260714201530.78374-3-srinath.parvathaneni@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 14/07/2026 21:15, srinath.parvathaneni@arm.com wrote: > From: Srinath Parvathaneni > > When a SIGSEGV is caused by a Permission Overlay violation, include > additional information in GDB's error message to help identify the > failing address along with the responsible protection key causing > this fault. > > Example: > (gdb) c > Continuing. > > Program received signal SIGSEGV, Segmentation fault > Protection Key Violation while accessing address 0x0000fffff7ff3000 with Protection Key = 1. > 0x0000aaaaaaaa0a3c in main () at poe_sigsegv.c:26 > > Approved-by: Thiago Jung Bauermann > --- > gdb/aarch64-linux-tdep.c | 21 ++++++++++++++++++--- > 1 file changed, 18 insertions(+), 3 deletions(-) > > diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c > index f11eccc1bc1..b8a02ab9972 100644 > --- a/gdb/aarch64-linux-tdep.c > +++ b/gdb/aarch64-linux-tdep.c > @@ -53,6 +53,7 @@ > > #include "arch/aarch64-fpmr-linux.h" > #include "arch/aarch64-gcs-linux.h" > +#include "arch/aarch64-poe-linux.h" > #include "arch/aarch64-mte.h" > #include "arch/aarch64-mte-linux.h" > #include "arch/aarch64-pauth-linux.h" > @@ -2675,11 +2676,12 @@ aarch64_linux_report_signal_info (struct gdbarch *gdbarch, > { > aarch64_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > > - if (!(tdep->has_mte () || tdep->has_gcs ()) || siggnal != GDB_SIGNAL_SEGV) > + if (!(tdep->has_mte () || tdep->has_gcs () || tdep->has_poe ()) > + || siggnal != GDB_SIGNAL_SEGV) > return; > > CORE_ADDR fault_addr = 0; > - long si_code = 0, si_errno = 0; > + long si_code = 0, si_errno = 0, si_pkey = -1; > > try > { > @@ -2687,6 +2689,9 @@ aarch64_linux_report_signal_info (struct gdbarch *gdbarch, > violation. */ > si_code = parse_and_eval_long ("$_siginfo.si_code"); > si_errno = parse_and_eval_long ("$_siginfo.si_errno"); > + if (tdep->has_poe ()) > + si_pkey = parse_and_eval_long > + ("$_siginfo._sifields._sigfault._._addr_pkey.si_pkey"); > > fault_addr > = parse_and_eval_long ("$_siginfo._sifields._sigfault.si_addr"); > @@ -2703,6 +2708,8 @@ aarch64_linux_report_signal_info (struct gdbarch *gdbarch, > meaning = _("Memory tag violation"); > else if (si_code == AARCH64_SEGV_CPERR && si_errno == 0) > meaning = _("Guarded Control Stack error"); > + else if (si_code == AARCH64_SEGV_PKUERR) > + meaning = _("Protection Key Violation"); > else > return; > > @@ -2734,6 +2741,14 @@ aarch64_linux_report_signal_info (struct gdbarch *gdbarch, > uiout->field_string ("logical-tag", hex_string (ltag)); > } > } > + /* For POE SEGSEGV, show additional information. */ Is this really supposed to be POE SEGSEGV or is it a typo? > + else if (si_code == AARCH64_SEGV_PKUERR) > + { > + uiout->text (_(" while accessing address ")); > + uiout->field_core_addr ("fault-addr", gdbarch, fault_addr); > + uiout->text (" with Protection Key = "); Missing internationalization above. > + uiout->field_signed ("protection-key", si_pkey); > + } > else if (si_code != AARCH64_SEGV_CPERR) > { > uiout->text ("\n"); > @@ -3054,7 +3069,7 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) > aarch64_linux_decode_memtag_section); > } > > - if (tdep->has_mte () || tdep->has_gcs ()) > + if (tdep->has_mte () || tdep->has_gcs () || tdep->has_poe ()) > set_gdbarch_report_signal_info (gdbarch, aarch64_linux_report_signal_info); > > /* Initialize the aarch64_linux_record_tdep. */