From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6425C8F58; Wed, 19 Feb 2025 17:16:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.133.224.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739985368; cv=none; b=ZsXURLcP01yG782DM514f6OtvM8vz04uNmpDnuDCi0qAbwnpBxs28oOI9tZhkPS52hYeZSYPGAid9Yp4rC2doCKPOQXzKGYEchVtl9h6C3WH4OVn++TqoiFmXJ8B+JDAYtit/HPjorAX2q9+37GYj2dHc38Pbxhe87va/NTC4Ug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739985368; c=relaxed/simple; bh=7QI0wT4+63qh/XUmz07BMZkRninTpYvjv4idET9mc5E=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=EeoKwkDoiuqkVws/peZWoQR4G4vxfLjIos7nUrbWYOymatWtUs8xmrwi8IDwQJs1wZ7BjqW7cUV9E35cyjt2UO+knXQXxVygshZbsg5ElhdSdQPN2T8aOTjjNBM33NnzZM5BfoR/+/Hy9Vrrt2jdOTudOCDuE6mIY8GKP7GnOAU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk; spf=none smtp.mailfrom=orcam.me.uk; arc=none smtp.client-ip=78.133.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=orcam.me.uk Received: by angie.orcam.me.uk (Postfix, from userid 500) id 247399200B3; Wed, 19 Feb 2025 18:16:05 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 1E09592009E; Wed, 19 Feb 2025 17:16:05 +0000 (GMT) Date: Wed, 19 Feb 2025 17:16:05 +0000 (GMT) From: "Maciej W. Rozycki" To: "Dmitry V. Levin" cc: Andrew Morton , Oleg Nesterov , Alexey Gladkov , Eugene Syromyatnikov , Charlie Jenkins , Helge Deller , Mike Frysinger , Renzo Davoli , Davide Berardi , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Brian Cain , Huacai Chen , WANG Xuerui , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , Dinh Nguyen , Jonas Bonn , Stefan Kristiansson , Stafford Horne , "James E.J. Bottomley" , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "David S. Miller" , Andreas Larsson , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Chris Zankel , Max Filippov , Arnd Bergmann , strace-devel@lists.strace.io, linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org Subject: Re: [PATCH v6 3/6] syscall.h: introduce syscall_set_nr() In-Reply-To: <20250217091034.GD18175@strace.io> Message-ID: References: <20250217091034.GD18175@strace.io> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) 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 On Mon, 17 Feb 2025, Dmitry V. Levin wrote: > diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h > index ea050b23d428..b956b015641c 100644 > --- a/arch/mips/include/asm/syscall.h > +++ b/arch/mips/include/asm/syscall.h > @@ -41,6 +41,20 @@ static inline long syscall_get_nr(struct task_struct *task, > return task_thread_info(task)->syscall; > } > > +static inline void syscall_set_nr(struct task_struct *task, > + struct pt_regs *regs, > + int nr) > +{ > + /* > + * New syscall number has to be assigned to regs[2] because > + * syscall_trace_entry() loads it from there unconditionally. That label is called `trace_a_syscall' in arch/mips/kernel/scall64-o32.S instead. To bring some order and avoid an inaccuracy here should the odd one be matched to the other three? > + * > + * Consequently, if the syscall was indirect and nr != __NR_syscall, > + * then after this assignment the syscall will cease to be indirect. > + */ > + task_thread_info(task)->syscall = regs->regs[2] = nr; > +} > + > static inline void mips_syscall_update_nr(struct task_struct *task, > struct pt_regs *regs) > { Otherwise: Reviewed-by: Maciej W. Rozycki for this part, thank you! Maciej