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 89E8B1EEA46 for ; Tue, 21 Jan 2025 12:42:42 +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=1737463364; cv=none; b=H/Ry8HC/Kl6Cj9/vWq2U8YFyDDcw6N9ma5Vi1zPdKhtxhZgDKPsQMUYAoP7lnGFVRU+LkWiPTTYc9asMxovrV47toPVJWOA2u6eSwEnCjpw1Sb6J1OW5QU1OJkUOhDnGWMzQDvFwVWrt/iDUusgubtVEyBPZ+qk4S7xlE19xxic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737463364; c=relaxed/simple; bh=W04COKGgIFcbZ7vRPq6iSi+ZHAWDdFauX56uaACzLFE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tml55xn+nY002tbqW3jL8uwNFqx3Yo66GmS+ncl2qfVokOWu5yGJBQFJ0JVge2AdPGCvJiJeW7wevex921ttey4zYl8F5LgX73V2Ubxg1D5efy+V/S5VVxqKAhjIsT02ACk8l8pfoJ9Kum9K7Drl/++Iijb+3ERrVGGwc2HHV80= 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 2740B72C8F5; Tue, 21 Jan 2025 15:42:41 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id F18D57CCB3A; Tue, 21 Jan 2025 14:42:40 +0200 (IST) Date: Tue, 21 Jan 2025 14:42:40 +0200 From: "Dmitry V. Levin" To: Madhavan Srinivasan Cc: Christophe Leroy , Alexey Gladkov , Oleg Nesterov , Michael Ellerman , Eugene Syromyatnikov , Mike Frysinger , Renzo Davoli , Davide Berardi , strace-devel@lists.strace.io, Nicholas Piggin , Naveen N Rao , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value() Message-ID: <20250121124240.GA26746@strace.io> References: <20250113171054.GA589@strace.io> <6558110c-c2cb-4aa3-9472-b3496f71ebb8@csgroup.eu> <20250114170400.GB11820@strace.io> <20250120171249.GA17320@strace.io> <70dc8099-e725-4069-9b3a-af31578278e2@linux.ibm.com> <70cb8e5b-7ee5-494a-a02a-ef286f8c970c@csgroup.eu> <697c1f59-80d7-4958-a8c1-e988f657d437@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <697c1f59-80d7-4958-a8c1-e988f657d437@linux.ibm.com> On Tue, Jan 21, 2025 at 05:55:40PM +0530, Madhavan Srinivasan wrote: > On 1/21/25 4:58 PM, Christophe Leroy wrote: > > Le 21/01/2025 à 12:13, Madhavan Srinivasan a écrit : > >> On 1/20/25 10:42 PM, Dmitry V. Levin wrote: > >>> On Mon, Jan 20, 2025 at 02:51:38PM +0100, Christophe Leroy wrote: > >>>> Le 14/01/2025 à 18:04, Dmitry V. Levin a écrit : > >>>>> On Mon, Jan 13, 2025 at 06:34:44PM +0100, Christophe Leroy wrote: > >>>>>> Le 13/01/2025 à 18:10, Dmitry V. Levin a écrit : > >>>>>>> Bring syscall_set_return_value() in sync with syscall_get_error(), > >>>>>>> and let upcoming ptrace/set_syscall_info selftest pass on powerpc. > >> > >> Sorry for getting to this thread late. > >> > >> Tried the series without this patch in > >> > >> 1) power9 PowerNV system and in power10 pSeries lpar > >> > >> # ./set_syscall_info > >> TAP version 13 > >> 1..1 > >> # Starting 1 tests from 1 test cases. > >> #  RUN           global.set_syscall_info ... > >> #            OK  global.set_syscall_info > >> ok 1 global.set_syscall_info > >> # PASSED: 1 / 1 tests passed. > >> # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 > >> > >> and in both case set_syscall_info passes. > >> Will look at it further. > > > > I guess it works because power9/10 are using scv not sc for system call, hence using the new ABI ? > > yeah, I guess. > This is from the a Power8 pSeries lpar without this patch > > # ./set_syscall_info > TAP version 13 > 1..1 > # Starting 1 tests from 1 test cases. > # RUN global.set_syscall_info ... > # set_syscall_info.c:428:set_syscall_info:wait #5: unexpected stop signal 11 > # 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've enhanced error diagnostics of the test a bit. Inspired by this powerpc bug, in the next iteration of the patchset the test would also invoke PTRACE_GET_SYSCALL_INFO right after PTRACE_SET_SYSCALL_INFO to check whether the changes are applied by the kernel correctly. Without the fix, in non-svc case the test would complain this way: # set_syscall_info.c:119:set_syscall_info:Expected exp_exit->rval (-38) == info->exit.rval (38) # set_syscall_info.c:120:set_syscall_info:wait #4: PTRACE_GET_SYSCALL_INFO #2: exit stop mismatch -- ldv