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: sparclinux@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