From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63725200BBF; Mon, 3 Feb 2025 10:35:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=194.107.17.57 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738578946; cv=none; b=m7UY05zweRptcIADuBAOER0P5qmwATFM6irugu/jttJkpdv1VJuvgG602Wv0KSmt8jmaXHS65f4kqisI19NJS0yzh6Lt46NqBMdIsspqRPh+yvhf1bQIju4ng5jw0jhuozDrzZIPAo0ohUgrI3tNXxHVIegVw3zQrpJjELc70kY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738578946; c=relaxed/simple; bh=D5Jv3FPUdrdfdsx4anIJHNUlSFE+deaFBpMQvm/GgIE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RCgF66EDFeJqSh0HHe4Yz/PdcAnb7/12EcJtOr2TntGtyaesDN/fKDItSBa2Ws8omv0vbiN/VSPCTmmKwSYy2Zti7IrfTfi/feNZ+BlrYNMCgb2WFyy8ze5CwiSmlVauMq0MtK0zClhexqRqjWwSboGh5bic43t+GHiq/RP+In8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strace.io; spf=pass smtp.mailfrom=altlinux.org; arc=none smtp.client-ip=194.107.17.57 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strace.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 35C8572C8F5; Mon, 3 Feb 2025 13:35:43 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 1956F7CCB3A; Mon, 3 Feb 2025 12:35:43 +0200 (IST) Date: Mon, 3 Feb 2025 12:35:43 +0200 From: "Dmitry V. Levin" To: Alexander Gordeev Cc: linux-snps-arc@lists.infradead.org, Rich Felker , Thomas Gleixner , Andreas Larsson , John Paul Adrian Glaubitz , x86@kernel.org, linux-kernel@vger.kernel.org, "James E.J. Bottomley" , Guo Ren , linux-csky@vger.kernel.org, linux-kselftest@vger.kernel.org, "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org, WANG Xuerui , linux-api@vger.kernel.org, Will Deacon , Eugene Syromyatnikov , Anton Ivanov , Jonas Bonn , linux-s390@vger.kernel.org, Madhavan Srinivasan , Vasily Gorbik , Yoshinori Sato , linux-sh@vger.kernel.org, Michael Ellerman , Helge Deller , Huacai Chen , Russell King , Christophe Leroy , Dave Hansen , Ingo Molnar , Geert Uytterhoeven , Vineet Gupta , Christian Borntraeger , Arnd Bergmann , linux-arch@vger.kernel.org, Shuah Khan , Albert Ou , Mike Frysinger , Davide Berardi , Renzo Davoli , linux-um@lists.infradead.org, Heiko Carstens , strace-devel@lists.strace.io, Charlie Jenkins , Naveen N Rao , Nicholas Piggin , Stefan Kristiansson , linux-m68k@lists.linux-m68k.org, Borislav Petkov , loongarch@lists.linux.dev, Paul Walmsley , Stafford Horne , Johannes Berg , linux-arm-kernel@lists.infradead.org, Brian Cain , Michal Simek , Thomas Bogendoerfer , linux-parisc@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Oleg Nesterov , Dinh Nguyen , linux-riscv@lists.infradead.org, Palmer Dabbelt , Sven Schnelle , Richard Weinberger , Andrew Morton , Alexey Gladkov , "David S. Miller" Subject: Re: [PATCH v4 0/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO API Message-ID: <20250203103542.GA16165@strace.io> References: <20250203065849.GA14120@strace.io> Precedence: bulk X-Mailing-List: linux-api@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Feb 03, 2025 at 10:29:37AM +0100, Alexander Gordeev wrote: > On Mon, Feb 03, 2025 at 08:58:49AM +0200, Dmitry V. Levin wrote: > > Hi Dmitry, > > > PTRACE_SET_SYSCALL_INFO is a generic ptrace API that complements > > PTRACE_GET_SYSCALL_INFO by letting the ptracer modify details of > > system calls the tracee is blocked in. > ... > > FWIW, I am getting these on s390: > > # ./tools/testing/selftests/ptrace/set_syscall_info > TAP version 13 > 1..1 > # Starting 1 tests from 1 test cases. > # RUN global.set_syscall_info ... > # set_syscall_info.c:87:set_syscall_info:Expected exp_entry->nr (-1) == info->entry.nr (65535) > # set_syscall_info.c:88:set_syscall_info:wait #3: PTRACE_GET_SYSCALL_INFO #2: syscall nr mismatch > # set_syscall_info: Test terminated by assertion > # FAIL global.set_syscall_info > not ok 1 global.set_syscall_info > # FAILED: 0 / 1 tests passed. > # Totals: pass:0 fail:1 xfail:0 xpass:0 skip:0 error:0 > > I remember one of the earlier versions (v1 or v2) was working for me. > > Thanks! In v3, this test was extended to check whether PTRACE_GET_SYSCALL_INFO called immediately after PTRACE_SET_SYSCALL_INFO returns the same syscall number, and on s390 it apparently doesn't, thanks to its implementation of syscall_get_nr() that returns 0xffff in this case. To workaround this, we could either change syscall_get_nr() to return -1 in this case, or add an #ifdef __s390x__ exception to the test. What would you prefer? -- ldv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40611C02192 for ; Mon, 3 Feb 2025 10:57:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pS16XKuutiik95YX2Qpn2XWv4wVzwD1ljIlvMzVOANs=; b=b3RC/k/kSJTFC1 M7s24zwgcq1Z+MdvVSxfiVMScPZ1LAn8O2EXEXK4PeveEJfnD4uwuh1vnpE+oXLyJS66iUT7Ba5zh zEZSlByirVmfb14WxRMGkNPcutHReWmVFeNd2O+hxRK0F4eBW6gH+yZrMS/rJtRfcIOilnz0MexE4 6/z5HpJyVUgRTK0POLUH8n80fFxMepUGFuE7kwgtEYzVyoVSRMKvAkpSj/Wu2Aol5R8ugXownxKnt 5Bk7+775qetUiIXVWQIfb9ajl1cTzOaz//Us4klKBNzkRHyx19bh2V/8ZrPdRlw8Hn+yokTjFbQ5h w93L+Kh7sTZSM12TWGyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1teu8n-0000000FAlx-2vi4; Mon, 03 Feb 2025 10:57:21 +0000 Received: from vmicros1.altlinux.org ([194.107.17.57]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tetnu-0000000F8R7-0waq; Mon, 03 Feb 2025 10:35:48 +0000 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 33C4872C8CC; Mon, 3 Feb 2025 13:35:43 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 1956F7CCB3A; Mon, 3 Feb 2025 12:35:43 +0200 (IST) Date: Mon, 3 Feb 2025 12:35:43 +0200 From: "Dmitry V. Levin" To: Alexander Gordeev Cc: linux-snps-arc@lists.infradead.org, Rich Felker , Thomas Gleixner , Andreas Larsson , John Paul Adrian Glaubitz , x86@kernel.org, linux-kernel@vger.kernel.org, "James E.J. Bottomley" , Guo Ren , linux-csky@vger.kernel.org, linux-kselftest@vger.kernel.org, "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org, WANG Xuerui , linux-api@vger.kernel.org, Will Deacon , Eugene Syromyatnikov , Anton Ivanov , Jonas Bonn , linux-s390@vger.kernel.org, Madhavan Srinivasan , Vasily Gorbik , Yoshinori Sato , linux-sh@vger.kernel.org, Michael Ellerman , Helge Deller , Huacai Chen , Russell King , Christophe Leroy , Dave Hansen , Ingo Molnar , Geert Uytterhoeven , Vineet Gupta , Christian Borntraeger , Arnd Bergmann , linux-arch@vger.kernel.org, Shuah Khan , Albert Ou , Mike Frysinger , Davide Berardi , Renzo Davoli , linux-um@lists.infradead.org, Heiko Carstens , strace-devel@lists.strace.io, Charlie Jenkins , Naveen N Rao , Nicholas Piggin , Stefan Kristiansson , linux-m68k@lists.linux-m68k.org, Borislav Petkov , loongarch@lists.linux.dev, Paul Walmsley , Stafford Horne , Johannes Berg , linux-arm-kernel@lists.infradead.org, Brian Cain , Michal Simek , Thomas Bogendoerfer , linux-parisc@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Oleg Nesterov , Dinh Nguyen , linux-riscv@lists.infradead.org, Palmer Dabbelt , Sven Schnelle , Richard Weinberger , Andrew Morton , Alexey Gladkov , "David S. Miller" Subject: Re: [PATCH v4 0/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO API Message-ID: <20250203103542.GA16165@strace.io> References: <20250203065849.GA14120@strace.io> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250203_023546_591166_D1BC158C X-CRM114-Status: GOOD ( 15.36 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Mon, Feb 03, 2025 at 10:29:37AM +0100, Alexander Gordeev wrote: > On Mon, Feb 03, 2025 at 08:58:49AM +0200, Dmitry V. Levin wrote: > > Hi Dmitry, > > > PTRACE_SET_SYSCALL_INFO is a generic ptrace API that complements > > PTRACE_GET_SYSCALL_INFO by letting the ptracer modify details of > > system calls the tracee is blocked in. > ... > > FWIW, I am getting these on s390: > > # ./tools/testing/selftests/ptrace/set_syscall_info > TAP version 13 > 1..1 > # Starting 1 tests from 1 test cases. > # RUN global.set_syscall_info ... > # set_syscall_info.c:87:set_syscall_info:Expected exp_entry->nr (-1) == info->entry.nr (65535) > # set_syscall_info.c:88:set_syscall_info:wait #3: PTRACE_GET_SYSCALL_INFO #2: syscall nr mismatch > # set_syscall_info: Test terminated by assertion > # FAIL global.set_syscall_info > not ok 1 global.set_syscall_info > # FAILED: 0 / 1 tests passed. > # Totals: pass:0 fail:1 xfail:0 xpass:0 skip:0 error:0 > > I remember one of the earlier versions (v1 or v2) was working for me. > > Thanks! In v3, this test was extended to check whether PTRACE_GET_SYSCALL_INFO called immediately after PTRACE_SET_SYSCALL_INFO returns the same syscall number, and on s390 it apparently doesn't, thanks to its implementation of syscall_get_nr() that returns 0xffff in this case. To workaround this, we could either change syscall_get_nr() to return -1 in this case, or add an #ifdef __s390x__ exception to the test. What would you prefer? -- ldv _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB1F6C02196 for ; Mon, 3 Feb 2025 10:57:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+Mz4XJrnDPcc/srRozJrImopilbpJhBud49ubF/PscE=; b=CqA3IStzMfIhBv M00RsfaYuNsMIRgIYgX3zBPc7lyZZPiGCdbunWSbRW5FVIIuc8KIrhWTp+26xbzB6X79jDZR5HFI6 /TQmc0Y4KZCgDZsbgJo/zzdLOyLi3Q0PfrN3mZoxgYYmX4Wp1Fyq1iD9lFKvc5mjCe3T/dfxzbE0n /zMnHPaSuWuItd6Jd4J+sCme8mNr4OJODGgII9qIZteMzgV7oCamL98IEa12HXW1tdx7Qg0rSv1QO x7cghOy1J+037O9TKie5d/nfheVgfIJmVLjOodsFyOUtGk63amQJG5a3n2OPOMp9W1YkpnCn0obax goQ97V1W0cHVLwy+g3EA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1teu8o-0000000FAmD-17ez; Mon, 03 Feb 2025 10:57:22 +0000 Received: from vmicros1.altlinux.org ([194.107.17.57]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tetnu-0000000F8R7-0waq; Mon, 03 Feb 2025 10:35:48 +0000 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 33C4872C8CC; Mon, 3 Feb 2025 13:35:43 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 1956F7CCB3A; Mon, 3 Feb 2025 12:35:43 +0200 (IST) Date: Mon, 3 Feb 2025 12:35:43 +0200 From: "Dmitry V. Levin" To: Alexander Gordeev Cc: linux-snps-arc@lists.infradead.org, Rich Felker , Thomas Gleixner , Andreas Larsson , John Paul Adrian Glaubitz , x86@kernel.org, linux-kernel@vger.kernel.org, "James E.J. Bottomley" , Guo Ren , linux-csky@vger.kernel.org, linux-kselftest@vger.kernel.org, "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-hexagon@vger.kernel.org, WANG Xuerui , linux-api@vger.kernel.org, Will Deacon , Eugene Syromyatnikov , Anton Ivanov , Jonas Bonn , linux-s390@vger.kernel.org, Madhavan Srinivasan , Vasily Gorbik , Yoshinori Sato , linux-sh@vger.kernel.org, Michael Ellerman , Helge Deller , Huacai Chen , Russell King , Christophe Leroy , Dave Hansen , Ingo Molnar , Geert Uytterhoeven , Vineet Gupta , Christian Borntraeger , Arnd Bergmann , linux-arch@vger.kernel.org, Shuah Khan , Albert Ou , Mike Frysinger , Davide Berardi , Renzo Davoli , linux-um@lists.infradead.org, Heiko Carstens , strace-devel@lists.strace.io, Charlie Jenkins , Naveen N Rao , Nicholas Piggin , Stefan Kristiansson , linux-m68k@lists.linux-m68k.org, Borislav Petkov , loongarch@lists.linux.dev, Paul Walmsley , Stafford Horne , Johannes Berg , linux-arm-kernel@lists.infradead.org, Brian Cain , Michal Simek , Thomas Bogendoerfer , linux-parisc@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Oleg Nesterov , Dinh Nguyen , linux-riscv@lists.infradead.org, Palmer Dabbelt , Sven Schnelle , Richard Weinberger , Andrew Morton , Alexey Gladkov , "David S. Miller" Subject: Re: [PATCH v4 0/7] ptrace: introduce PTRACE_SET_SYSCALL_INFO API Message-ID: <20250203103542.GA16165@strace.io> References: <20250203065849.GA14120@strace.io> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250203_023546_591166_D1BC158C X-CRM114-Status: GOOD ( 15.36 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On Mon, Feb 03, 2025 at 10:29:37AM +0100, Alexander Gordeev wrote: > On Mon, Feb 03, 2025 at 08:58:49AM +0200, Dmitry V. Levin wrote: > > Hi Dmitry, > > > PTRACE_SET_SYSCALL_INFO is a generic ptrace API that complements > > PTRACE_GET_SYSCALL_INFO by letting the ptracer modify details of > > system calls the tracee is blocked in. > ... > > FWIW, I am getting these on s390: > > # ./tools/testing/selftests/ptrace/set_syscall_info > TAP version 13 > 1..1 > # Starting 1 tests from 1 test cases. > # RUN global.set_syscall_info ... > # set_syscall_info.c:87:set_syscall_info:Expected exp_entry->nr (-1) == info->entry.nr (65535) > # set_syscall_info.c:88:set_syscall_info:wait #3: PTRACE_GET_SYSCALL_INFO #2: syscall nr mismatch > # set_syscall_info: Test terminated by assertion > # FAIL global.set_syscall_info > not ok 1 global.set_syscall_info > # FAILED: 0 / 1 tests passed. > # Totals: pass:0 fail:1 xfail:0 xpass:0 skip:0 error:0 > > I remember one of the earlier versions (v1 or v2) was working for me. > > Thanks! In v3, this test was extended to check whether PTRACE_GET_SYSCALL_INFO called immediately after PTRACE_SET_SYSCALL_INFO returns the same syscall number, and on s390 it apparently doesn't, thanks to its implementation of syscall_get_nr() that returns 0xffff in this case. To workaround this, we could either change syscall_get_nr() to return -1 in this case, or add an #ifdef __s390x__ exception to the test. What would you prefer? -- ldv _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc