From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id zUU4Lt/9VWpQhwcAWB0awg (envelope-from ) for ; Tue, 14 Jul 2026 05:14:07 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=FVizpngE; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=FVizpngE; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id ADACD1E09E; Tue, 14 Jul 2026 05:14:07 -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,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham 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 6B7831E099 for ; Tue, 14 Jul 2026 05:14:06 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2101F4BA2E0C for ; Tue, 14 Jul 2026 09:14:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2101F4BA2E0C Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=FVizpngE; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=FVizpngE Received: from OSPPR02CU001.outbound.protection.outlook.com (mail-norwayeastazlp170130007.outbound.protection.outlook.com [IPv6:2a01:111:f403:c20f::7]) by sourceware.org (Postfix) with ESMTPS id D4D914BA5439 for ; Tue, 14 Jul 2026 09:13:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D4D914BA5439 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D4D914BA5439 Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c20f::7 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1784020415; cv=pass; b=rHh+3hX+tggn2hAdSbgWk3j/0qKpX3DaNstMeBqgJmGOTKWvZ4iAgPdww+jeAxrxXd08i+lSzm5Wz+K6Ug+/8/+Gg1c216ln1yEoGB6U6Kz2X95idVzu/k2TPSFaV7u1liRHq8bHWZMdNmCNnUHbbr8xei+S9foOJbkR3bBLBaE= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1784020415; c=relaxed/simple; bh=pMB1oHP17w+MDydNPVLYy8GzyvbF0I2ItMIEBwWIu5w=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=MQYPQrpt83jb3BpMvSXVTqbXlI9cYRuQEO50VMfpq3EknVztK72ehkhHdfVgRy+gcpFDe8yGRtn3Lazh+kEwKXLeZl2oIMwau+meFgvlRa1+Gzpv988pfnYkto/jOazWwQBOJv9TKDJh4f6MnhaHG8gXKf0W4hKYEbSXGbi+jG0= ARC-Authentication-Results: i=3; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=FVizpngE; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=FVizpngE DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4D914BA5439 ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=kWI8k8ALgdz7abxl3lpjLELVRYi3hCCZ7LP3KYybmvcQH0MX2gwxUylmbCeG4t0wcfHBcC59T3JFcVjLy5sFCfPFcBf4lhs8SsvGdACDmeZM1Xf0wPiZWrUMH+4826tuzJB3JB3rSjPgD62FEEcmhLS4WY3QYFHYwmdb5iffcaj6o6QGx5UWbHozYxceqJeWs+BpD2nIkDw8IInyEtVFlUiFlTQbZtHOqRQ3okQC3Y020gOEqK4WX2v5ZTJCFlf6ooe9SCnc0xRjfQSXWnaTl7gi8lsYURzD+ZMHRluRGzmHwghJxKJwoP+xEYwz+jSOrF9pdZGoTANZ9vfgQ8+JtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PtkKlGk33LJXSSQYdAzpVpBWQSljXmGICdhsfqKFiAs=; b=N2TfX88+txskCpe5WxJ4XIPTHD5BrwirjszRcYOcHbA499PRjtIrCaNcDeqotGTVTMECsfaj0X2ePu7lyP4zw4FFDKWcc6WqXmKDU9IS1kKh6wLNz+XQ0t5MdwZqFsw+2AHuIDkJFOL9oTkKjLbjURT87Zz3yhS3Plr/Td77eCS3Zou9h9si1d29o8BBYKi0Ol//c3jaNG/oyzk2Ohpq5sa5YXOYjQhmdyosNhqZQmiqu4o5QNQbS572FHOfz7dPWGiidDKKXADtrlmAz4IrT10HrKa/dSroe+F+YhsLw0MwIOVhqK6I5OHk4h5ZkFDLdBsxSmdenE4eRNhHvPJbpg== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=linaro.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PtkKlGk33LJXSSQYdAzpVpBWQSljXmGICdhsfqKFiAs=; b=FVizpngEffjXcVhLW2q1FG6yTx1noZ8lfzkXQp4TspAO6a0lMZZ/vRl0jTbwJpd0oi7GZVvHVTMtlEesZiWFHBD3BVtnE5ggR3rZgPF93xZBSHMz7cumecG880+aVpXZ88n4cHUcyBZOIjeZTEHTYD5fWb+uokcAd6/E1eoXKoY= Received: from AM0PR02CA0157.eurprd02.prod.outlook.com (2603:10a6:20b:28d::24) by GVUPR08MB11930.eurprd08.prod.outlook.com (2603:10a6:150:347::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.19; Tue, 14 Jul 2026 09:13:24 +0000 Received: from AMS1EPF0000008E.eurprd05.prod.outlook.com (2603:10a6:20b:28d:cafe::c) by AM0PR02CA0157.outlook.office365.com (2603:10a6:20b:28d::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.202.19 via Frontend Transport; Tue, 14 Jul 2026 09:13:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by AMS1EPF0000008E.mail.protection.outlook.com (10.167.242.85) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.223.9 via Frontend Transport; Tue, 14 Jul 2026 09:13:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vs7fVX270DNSIx8iW0HA2imWMTiJdBqoIGOIyOfOqcoPtxSHrqwnMskurrBszFdZDsa7lHqIS80J7IF4jZ91BSj4D/Y9Zw8DGOPCI2ROVoLg5w23EycSYHYFh2Trczn07xG/QkIuJGBSfbQNMhID2IHKUe75YtwWNiSWq7jot2JzR/olepBn5ACiRnevwHblAvd3F1pDu+GEmng/xAPTOdDezjjOG+K3DZGDU2TppwWcntJM3KN+jsDAab3BMrBoLDEqkM3ccUlyMQQ3bCw/jTCGq46XaNTY2/yPO1QYKHWLFqEwS6Mqyao3lfSBoVj0lkDp4ab7bRTOhdEce11Kdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PtkKlGk33LJXSSQYdAzpVpBWQSljXmGICdhsfqKFiAs=; b=NV3VDqqANTX433XvfcVPopPbIBtWSOwK2KPpRXWrV7Qc6peTbXCvPE7PN6Oil5xylS7HASOkHcCn+lpVk/225j/Ja2wox8bQHhB4V3ahMuzqbEnCFQRLK76JTIKrIXZBiv1P/Y9mafxAxxjNQdGLlcDvmQ14oS2vHPEafbMUlZ7vFTMMnB3TDIRqv31VA4pOJWt74eoRLwPv9uCitGo4p64DZZjdw8FNS5cHs/oky6pN8VgUaG8EerI8oSGiS5ZeGVlK9afq7FjtflPA81AByxFEyvnhNHM+d/nr+RQ/rRD+2YlkdOpPOD77yjUMRr8GVP+iHns9gEqaOUjoX/LeKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PtkKlGk33LJXSSQYdAzpVpBWQSljXmGICdhsfqKFiAs=; b=FVizpngEffjXcVhLW2q1FG6yTx1noZ8lfzkXQp4TspAO6a0lMZZ/vRl0jTbwJpd0oi7GZVvHVTMtlEesZiWFHBD3BVtnE5ggR3rZgPF93xZBSHMz7cumecG880+aVpXZ88n4cHUcyBZOIjeZTEHTYD5fWb+uokcAd6/E1eoXKoY= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB8659.eurprd08.prod.outlook.com (2603:10a6:20b:563::10) by AM7PR08MB5512.eurprd08.prod.outlook.com (2603:10a6:20b:de::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.223.10; Tue, 14 Jul 2026 09:12:22 +0000 Received: from AS8PR08MB8659.eurprd08.prod.outlook.com ([fe80::96bf:2de3:5eab:70ae]) by AS8PR08MB8659.eurprd08.prod.outlook.com ([fe80::96bf:2de3:5eab:70ae%5]) with mapi id 15.21.0202.014; Tue, 14 Jul 2026 09:12:22 +0000 Message-ID: <042de0a8-d0e4-4ad3-880a-684ab6a22077@arm.com> Date: Tue, 14 Jul 2026 10:12:20 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 09/10] gdb/linux-tdep: parse ProtectionKey in /proc/PID/smaps To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org, Luis Machado , Luis Machado , Andrew Burgess , Yury Khrustalev , Pedro Alves , Tom Tromey References: <20260707154900.94542-1-matthieu.longo@arm.com> <20260707154900.94542-10-matthieu.longo@arm.com> <87qzlczms3.fsf@linaro.org> From: Matthieu Longo Content-Language: en-US In-Reply-To: <87qzlczms3.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0201.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a5::8) To AS8PR08MB8659.eurprd08.prod.outlook.com (2603:10a6:20b:563::10) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB8659:EE_|AM7PR08MB5512:EE_|AMS1EPF0000008E:EE_|GVUPR08MB11930:EE_ X-MS-Office365-Filtering-Correlation-Id: ba608441-a20f-44b2-cd2e-08dee188287d x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|366016|23010399003|1800799024|376014|18002099003|22082099003|11063799006|5023799004|56012099006|4143699003|6133799003; X-Microsoft-Antispam-Message-Info-Original: QV3SJDsfiYlkB8eZ43Jzqag/r0kpLPrKMdbh85lVBs6xKlETw912K9N7ds2r1N1c52ripte1kyuq8m3ZU5WVNeLEW8c9S/MBg60ng6LNJpsRtbizYJ2UZVdZ4LNuZuVuY0Sk0mLTiCV6fYaR9geR0u0jq3BbcbhtANW7Zw0nZvc9G20Zbhbb4wNlfDrYA9oBq6ER2xstGdo2ebuxxjgVrcfWJmi4zcHOwxCLR9rKXFQbjmxJEY+p20SwwPEExwqHmzwQ6w8BoA3nBcoQbfb5xTl+6tV+RMFQhyX86hWzgmKLFPciPrbPZ+HPXmhV7i4GkbU2rXel9bhypSS8ys9ktt4ct64vSa0+H2Zf8f+gSM4TEbLXP7mi3f1DdV8IiNrc13d+Cl6T/DzjmIpSNAjGBkgl1CEk/pobItGamZOao7PxbEim/hVK5CWqbLlr2BR1C+T2yclbBef9Ta4eMcTzD1eaqjhARBggGpM9/gKAFQkJtBx7K/DLOH3m97BCxfr/7zSEqbhw0I1mzy4CX8mORO6H2PLJMOJf1yICMldN//M9JpwOK/QWO2hsBXstpx4NNux9phMfrSxl7Zy0UGER/bfAhLfRnDdVwxMtgD9fTsUlCXWjA8IxN2Fg4WklLBXU X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB8659.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(23010399003)(1800799024)(376014)(18002099003)(22082099003)(11063799006)(5023799004)(56012099006)(4143699003)(6133799003); DIR:OUT; SFP:1101; X-Exchange-RoutingPolicyChecked: KHc0j8wJ+9RSo1m2uBrAmH9jnDz/ld6K1gvcN4EtxwhLWUcSwP4xlmn8ZRtqnMF2xey4xS8eqS7qm6ma5qv7fgWcnPdAqu0rTzwlxOE3zfDcnzfyteqai0+WYwe7EZCa/ecFouZmTdcI3i39YO0aN6rkbJIiv3kKtZS5tqgggBsVV1SLfOJx/y/wijbJV9QWFhFCAcPz5JJ3HVMa5mWCDW21k5szPzmpUowwsfoFt4bKtK0Y5np54EZBhyiafsTaLFKGLFHbgJ6L1GJSD5DGrjQfrZSM4DN48uonJvoBT2awBVcwlhhTqyZddhHUyl0kbXssbFiIj4invOBuAog7SA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5512 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS1EPF0000008E.eurprd05.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 07ca5793-0754-419b-8baf-08dee188034b X-Microsoft-Antispam: BCL:0; ARA:13230040|35042699022|14060799003|82310400026|36860700016|376014|23010399003|1800799024|13003099007|22082099003|18002099003|5023799004|4143699003|11063799006|56012099006|6133799003; X-Microsoft-Antispam-Message-Info: ba6L2ZC4NqFUDWYSc0G5PZONHbkISKdK9aMr+IzdGBWDIzmCWBZ/RKjzKcCKldpIYbVDPEM0hGoHOU7Q7rIbuyLYuiguy+SB0tgDwdUpowsA3pFv95YAnjoql+Oe/LJyfAlL0Bly+fPD74EKjpJqgQqjWSJSeTpyHLdVvmKJnnl9ZahqbPbhuPeu1DWynrF6UnlRosD7w7zAy2eZrgp0zL8jZphWsa+Xp5pSo7Nhp5Fbw+by4B6qurPm6biFD7AfcDu/wcq47Rf7iyLnLwVPFsecz/X2GP/9R475HLcxtt4mhhjp44SHeTMQE6XzsZmvA7JSp4VvYPT9mJLlJt8VgyBGCZntJ/3bRHN79ZccYKuvcuffYmDCwvyjL3Hll4X1jEAKZmGQ6ybwL4XGflPLxFSiQt4G9qqRjkf7RONVJVzRN00IqTo8t9Y5jWJ13qVO5HD3aW2Qoo8XiFXsXhAlJo5SC/e/ebzseHeSof3QLlH3i3T8gIGuF99lqYecqHVYhfmxMhNBfdAC5t3qY4lUhgz011u5B/+Pwnnbq7iEbHDcBYstmIL43ipdGv5zA2V9YiiktdSLcdUFWpoQzYD8GNQxw7T7LinSJecTeXIoV/dv59ZiFtT2Zrov/vw9IKYBXRurk8JKzBZC/NhLJ0BNLhVLc4DTKIAkJfPJoSb7em0= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(35042699022)(14060799003)(82310400026)(36860700016)(376014)(23010399003)(1800799024)(13003099007)(22082099003)(18002099003)(5023799004)(4143699003)(11063799006)(56012099006)(6133799003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iKGO2vIEIjWANXRhttDybQxo0j1xcFHxuyB3tgM3VbztHG4dyJl9nKwPUMWWJG8KwoH05TrkjrqPDGk8nQmgwZcMjbmID8S/HF5tVP626aVo46IuEKm3BByb8f6efLW7+uF+ArY/UrQYhUN9VJNLzjwNHmwWLQombbkItTxOKCwSuIBKubC6xvUIoHmhky6EGyDfZSeteZ1IMngC8e8SWfSJXrAlh3pI0iCdWyvQzy7qN6hbKSjPsViYqJVZYtMeFmq+fwBe9jcH7MdJD7yn89/Fj+TslOZ+YI9q8xT9TU8uWwiKs308tGwtHlBDyZmctQ4B2aj83BjkXrq5AFGrnLmKRxRsZjXwI1F9be2qN9b5v2+4QKAacQvMJdQqGTo2xJxZjRwVoYOUG9IPjjGKvOb8zywWHPzx+YpwfYNkYJbbuH8v77en9/UA8srS5U4z X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2026 09:13:24.3367 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba608441-a20f-44b2-cd2e-08dee188287d X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: AMS1EPF0000008E.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVUPR08MB11930 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 09/07/2026 07:42, Thiago Jung Bauermann wrote: > Matthieu Longo writes: > >> Memory Protection Keys provide a mechanism for enforcing page-based >> protections without requiring modification of the page tables >> when an application changes protection domains. [1] >> >> The "ProtectionKey" field may be present in /proc/PID/smaps x86_64 >> and AArch64 systems since Linux 4.9, when the kernel is built with >> Memory Protection Keys support. > > /me from a previous life would feel the need to point out that it may > also be present on POWER systems. :) > Added PowerPC to the list. The "ProtectionKey" field may be present in /proc/PID/smaps x86_64, PowerPC, and AArch64 systems since Linux 4.9, when the kernel is built with Memory Protection Keys support. >> Add a new 'pkey' field to `struct smaps_data', and populate it when >> the "ProtectionKey" field is present. >> >> This prepares for displaying the protection key in 'info proc mappings'. >> >> [1]: https://docs.kernel.org/core-api/protection-keys.html, >> https://lkml.iu.edu/1512.0/03058.html > > I suggest linking to the commit that went upstream instead of the > mailing list patch: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c1192f842841 > Fixed. >> --- >> gdb/linux-tdep.c | 13 +++++++++++++ >> 1 file changed, 13 insertions(+) >> >> diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c >> index dbc69a5a7fc..d89c5ae8504 100644 >> --- a/gdb/linux-tdep.c >> +++ b/gdb/linux-tdep.c >> @@ -124,6 +124,7 @@ struct smaps_data >> >> ULONGEST rss; >> ULONGEST swap; >> + std::optional pkey; > > There's nothing in this patch series that uses the parsed pkey, so IMHO > (other maintainers may disagree) it makes more sense if this patch is > committed together with a patch that makes use of the field. > Nothing uses it yet because it is still unclear how to expose it to the users. I assume that "info proc mappings" is a good place to do it. As a reminder those are the existing columns: Start Addr End Addr Size Offset Perms File Should we add a new column "Protection Key" or "PKey" between "Offset" and "Perms" ? What do you think ? >> }; >> >> /* Whether to take the /proc/PID/coredump_filter into account when >> @@ -1553,6 +1554,7 @@ parse_smaps_data (const file_reader_t &freader) >> int mapping_file_p; >> ULONGEST rss = -1; >> ULONGEST swap = -1; >> + int pkey = -1; >> >> memset (&v, 0, sizeof (v)); >> struct mapping m = read_mapping (line); >> @@ -1653,6 +1655,16 @@ parse_smaps_data (const file_reader_t &freader) >> mapping_anon_p = 1; >> } >> } >> + >> + if (streq (keyword, "ProtectionKey:")) >> + { >> + if (sscanf (line, "%*s%d", &pkey) != 1) >> + { >> + warning (_("Error parsing %s's value in {s,}maps file '%s'"), >> + keyword, freader.c_filepath ()); >> + break; >> + } >> + } >> } >> /* Save the smaps entry to the vector. */ >> struct smaps_data map; >> @@ -1672,6 +1684,7 @@ parse_smaps_data (const file_reader_t &freader) >> map.inode = m.inode; >> map.rss = rss; >> map.swap = swap; >> + map.pkey.emplace (pkey); > > Shouldn't map.pkey be set only if pkey != -1? > Agree. Fixed. >> >> smaps.emplace_back (map); >> } > Matthieu