From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED2E71BBBE0 for ; Mon, 13 Jan 2025 17:50:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.17.235.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736790605; cv=none; b=rYUfdq79wOOxHXT+tUK9Yjbkp1qI/lbL3TvZqV+XBb0a1xxPQNw4ZoMpad6PNutxJkeFyR0ZjRDh7IGTlUD9e6ibfLI/pOZqAKy1KEQE8nMlvybBKxrHIBOKkl8/QIbuNPaCd1jZupjATdpxm8syaCUDBB85Wfjk9IH6AXseihw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736790605; c=relaxed/simple; bh=kaTWYQPSqadXU7fwMAp6+2b0n1Z0eWXkAERthKJvUXc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=W6+Isf3FdhGxa84iY8Sh1wYXeiftN9aVSrilSOli/eZqIa54/RUMnlto9aqWHz5SdBfokecskWuTsaysFLkn5barCqrWn9vS2TS6k4gdofWUAf3tA60pXTVetwlTsv7/LsjOMVMTKRngUF390Zlx8Guy3qcSLmk4OzfM9H8PJ9w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu; spf=pass smtp.mailfrom=csgroup.eu; arc=none smtp.client-ip=93.17.235.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=csgroup.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=csgroup.eu Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4YWzsl0knNz9sS7; Mon, 13 Jan 2025 18:34:51 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aQe7aT3g5CqG; Mon, 13 Jan 2025 18:34:51 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4YWzsd6c22z9sRk; Mon, 13 Jan 2025 18:34:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C46E08B76C; Mon, 13 Jan 2025 18:34:45 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id JGvQgK_t-4vp; Mon, 13 Jan 2025 18:34:45 +0100 (CET) Received: from [192.168.235.99] (unknown [192.168.235.99]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 39FCA8B768; Mon, 13 Jan 2025 18:34:45 +0100 (CET) Message-ID: <6558110c-c2cb-4aa3-9472-b3496f71ebb8@csgroup.eu> Date: Mon, 13 Jan 2025 18:34:44 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/7] powerpc: properly negate error in syscall_set_return_value() To: "Dmitry V. Levin" , Oleg Nesterov , Michael Ellerman Cc: Eugene Syromyatnikov , Mike Frysinger , Renzo Davoli , Davide Berardi , strace-devel@lists.strace.io, Madhavan Srinivasan , Nicholas Piggin , Naveen N Rao , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20250113171054.GA589@strace.io> Content-Language: fr-FR From: Christophe Leroy In-Reply-To: <20250113171054.GA589@strace.io> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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. > > This reverts commit 1b1a3702a65c ("powerpc: Don't negate error in > syscall_set_return_value()"). There is a clear detailed explanation in that commit of why it needs to be done. If you think that commit is wrong you have to explain why with at least the same level of details. > > Signed-off-by: Dmitry V. Levin > --- > arch/powerpc/include/asm/syscall.h | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h > index 3dd36c5e334a..422d7735ace6 100644 > --- a/arch/powerpc/include/asm/syscall.h > +++ b/arch/powerpc/include/asm/syscall.h > @@ -82,7 +82,11 @@ static inline void syscall_set_return_value(struct task_struct *task, > */ > if (error) { > regs->ccr |= 0x10000000L; > - regs->gpr[3] = error; > + /* > + * In case of an error regs->gpr[3] contains > + * a positive ERRORCODE. > + */ > + regs->gpr[3] = -error; > } else { > regs->ccr &= ~0x10000000L; > regs->gpr[3] = val;