From patchwork Mon Feb 8 22:18:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 41977 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D7568389364E; Mon, 8 Feb 2021 22:18:50 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id C6605388A018 for ; Mon, 8 Feb 2021 22:18:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C6605388A018 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: 6+lzFGgeoeXMMEHsFduoH+ScpRNSPqrRIwBPr57nLolfbWG3O+agmCR3a9P9AHbkp8OoOsxysn UvZGZE9WogwQVQem+lz0fq+MnGKx93diqZfB//FtyAG0Kfch8BF79vpNCKvGHLBxQ4sFkfJQWr HCJWeGAmIWHOCBCCASo+eg+JFcnSDBxLxCqUKq3PSsZYgHNuu386O3C4sE7aAI2r9DfvYFhuli siPvLRw2MinSy5ZhQ7ciw1O8aGwG6vqLQ+reU0zaHN+BsAmUsJvEeJbZw6tLrvfHbqkKcpC3WU Kdk= X-IronPort-AV: E=Sophos;i="5.81,163,1610438400"; d="scan'208";a="60196447" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 08 Feb 2021 14:18:46 -0800 IronPort-SDR: A69qX5mIuOrfTFrqArlCZgpjm+HMLPoXJ2utkwV1dhYWBlj4XTKsg2xjIftkH9kKms68aOvCZ6 44iYNCuLjE+dEDAS3XfqzC19BkWsD3S8DsvTbkb5WlFrfgr8QstBPwIl9U4mrim9IoVPE7DdbL lZ2hIntfw2wlkNdS+QahSIjw6X8MdM2DlCThJsYuzjs3i0pAJCT6mjKTEnorejYLFqZ51T/vVu AsZtIwcBTo211dOkPskGLhJThT3cEZk0j88nG10aVKzh9qvf4l1jOd8rNDjrm7VyUEjTsSz/yI Ips= Date: Mon, 8 Feb 2021 22:18:41 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Subject: Add more ptrace constants for AArch64 and PowerPC Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3129.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Linux 5.10 adds PTRACE_PEEKMTETAGS and PTRACE_POKEMTETAGS for AArch64. Adding those shows up that glibc is also missing PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP, for AArch64 (where they were added to Linux in 5.3) and for PowerPC (where they were added in Linux 4.20); it already has those two defines for x86. Add all those defines to glibc's headers. Tested with build-many-glibcs.py for aarch64-linux-gnu and powerpc-linux-gnu. diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h index 806178af0e..de26da0023 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/aarch64/sys/ptrace.h @@ -82,6 +82,22 @@ enum __ptrace_request PTRACE_SYSCALL = 24, #define PT_SYSCALL PTRACE_SYSCALL + /* Continue and stop at the next syscall, it will not be executed. */ + PTRACE_SYSEMU = 31, +#define PT_SYSEMU PTRACE_SYSEMU + + /* Single step the process, the next syscall will not be executed. */ + PTRACE_SYSEMU_SINGLESTEP = 32, +#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP + + /* Read MTE tags. */ + PTRACE_PEEKMTETAGS = 33, +#define PT_PEEKMTETAGS PTRACE_PEEKMTETAGS + + /* Write MTE tags. */ + PTRACE_POKEMTETAGS = 34, +#define PT_POKEMTETAGS PTRACE_POKEMTETAGS + /* Set ptrace filter options. */ PTRACE_SETOPTIONS = 0x4200, #define PT_SETOPTIONS PTRACE_SETOPTIONS diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h index 00730cf5d3..032c91e817 100644 --- a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h +++ b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h @@ -70,6 +70,8 @@ __BEGIN_DECLS # undef PTRACE_SYSCALL_INFO_ENTRY # undef PTRACE_SYSCALL_INFO_EXIT # undef PTRACE_SYSCALL_INFO_SECCOMP +# undef PTRACE_SYSEMU +# undef PTRACE_SYSEMU_SINGLESTEP # undef PTRACE_TRACEME #endif @@ -188,6 +190,14 @@ enum __ptrace_request PTRACE_SETVSRREGS = 28, #define PT_SETVSRREGS PTRACE_SETVSRREGS + /* Continue and stop at the next syscall, it will not be executed. */ + PTRACE_SYSEMU = 29, +#define PT_SYSEMU PTRACE_SYSEMU + + /* Single step the process, the next syscall will not be executed. */ + PTRACE_SYSEMU_SINGLESTEP = 30, +#define PT_SYSEMU_SINGLESTEP PTRACE_SYSEMU_SINGLESTEP + /* Execute process until next taken branch. */ PTRACE_SINGLEBLOCK = 256, #define PT_STEPBLOCK PTRACE_SINGLEBLOCK