Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2060898lqe; Tue, 9 Apr 2024 08:29:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNBFtbLyZ7mUV1wP6xtcW1/9Q4IGIfik+tHG4rr7dJoUp0W/sdznAJhkSLIm5ZUz6scjFyDQ/9YZYeE2gbfcv7o12nf13Omuw2kwL/1Q== X-Google-Smtp-Source: AGHT+IFZ1U/ByOpClUiWNpfjd0hMIBcIJA8hAS+/AMpYNbt2uGu9tL42jsrerDE1vGLVbk7+OHt1 X-Received: by 2002:a05:6102:20c4:b0:479:df10:90c2 with SMTP id i4-20020a05610220c400b00479df1090c2mr9362314vsr.10.1712676570560; Tue, 09 Apr 2024 08:29:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712676570; cv=pass; d=google.com; s=arc-20160816; b=orTeKAet4Vivuz/J3Bf2JDyYazekH8L5aC0XPreUU2IVlNca+tyrrgmTz/AdQkfIDE W9juIwxj/OuTjsZOHaDWplLN0fYrourqeQc4F5D1opYJprTVIywUHEYN2m/Pf7eavIkY 7qmT4tq0VWnpBTGTPiUBCaJpyJ3H6tI4fqvRX6BkNeFkct8tWL2anTY4vmjul9QiNd0V SUsnb3gFDcUJ1yMQW4ut2J6pAUQG0Hhb93Oph+tFUhsssNuv0KTND8n0Y4iqoKRsA71y 3SU5IFyufLfEr7SQwETZLWZ7NtWruoFnFUd7j+e58YEg7MzdDFwhSLCtxcQOie7q6mrx IgfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=1805/slkPN5oXL08tm8W16/R7aKj48evMnoR/pNZZ2s=; fh=l5MCnW4eyfdjyifj19gTLZSLQV4AIkaiNXCMO0pNC50=; b=jCkjUw5NEdxJdHuOV13Z4Ph9yqJTcBWa9zXqP01K3kI9pkc/uz+iwua8QtAPJ6fY+J JvyS7YofAfi9fCQZkrAC6weQWSnJM5ZJ0yWGIwm13Y8ALjk27hX4roJQrecssha2gwV7 HDK6VvzErSTlHQ3Z1+702kHtMwFf30y9htf6y2PJqMlHnsJqDEneBRbunxTAX3ZXSWBG MZ1BF06vdV9ucKzIMzZmYRe0D6azplfWYIbJ/UTY9dQYhYjJTlBb8pXa+aF8G/Mvk6vN dW+PApfBF33FJj7qrTPxh+6wT7YAhcDvyKxQPW0NSnlnFGKbkvDQXDL72p5it2cfi/9b zO3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=alpha.franken.de); spf=pass (google.com: domain of linux-kernel+bounces-137218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137218-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k4-20020a67ef44000000b0047a13e03072si236948vsr.677.2024.04.09.08.29.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 08:29:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=alpha.franken.de); spf=pass (google.com: domain of linux-kernel+bounces-137218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137218-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 479911C20B92 for ; Tue, 9 Apr 2024 15:29:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9809F13D2B1; Tue, 9 Apr 2024 15:26:01 +0000 (UTC) Received: from elvis.franken.de (elvis.franken.de [193.175.24.41]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 002AC1304BD; Tue, 9 Apr 2024 15:25:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.175.24.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676361; cv=none; b=Fw6ajb5oZWP3KvZfInX5qSnZLtrvoWJREh4SdnEQ0sgOSCVGs2m/h3LzAbubT5sH8OZBHhLa/EaEFUb2huD0jNHUEW8TApAQ+bho94onhqR4Vmd+z2KFRLAH5HHGKStCYvjQs0KPHH7f8N9PqMCCnxYbzrJIauujg+y2ooB5EFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676361; c=relaxed/simple; bh=X2IfKt2qfJOWHO4OqiBIlMOe/82/ecVxOkQzXgLMQkQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=izvDVZDQ4VXoP2StHQUT/i6HSRRp4XUcknRu5yv9UjCEUkkJ+E1S6y3nM6uAolSYpU2gnkoSLwiobmJJaPxNYL6WErABAbXKeuAM8ZjeCwtPYUm5aXWx9TBsttD175q1xK5W6wiGsD96nSbJjhBbtMgRVyNa490WRdWUMgkdyP0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de; spf=pass smtp.mailfrom=alpha.franken.de; arc=none smtp.client-ip=193.175.24.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alpha.franken.de Received: from uucp by elvis.franken.de with local-rmail (Exim 3.36 #1) id 1ruCwh-0002sV-00; Tue, 09 Apr 2024 16:59:35 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 7DB4FC0135; Tue, 9 Apr 2024 16:59:02 +0200 (CEST) Date: Tue, 9 Apr 2024 16:59:02 +0200 From: Thomas Bogendoerfer To: Jiaxun Yang Cc: Oleg Nesterov , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xi Ruoyao Subject: Re: [PATCH] MIPS: scall: Save thread_info.syscall unconditionally on entry Message-ID: References: <20240328-mips_save_syscall-v1-1-9e1d62d6999d@flygoat.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=us-ascii Content-Disposition: inline In-Reply-To: <20240328-mips_save_syscall-v1-1-9e1d62d6999d@flygoat.com> On Thu, Mar 28, 2024 at 02:27:56PM +0000, Jiaxun Yang wrote: > thread_info.syscall is used by syscall_get_nr to supply syscall nr > over a thread stack frame. > > Previously, thread_info.syscall is only saved at syscall_trace_enter > when syscall tracing is enabled. However rest of the kernel code do > expect syscall_get_nr to be available without syscall tracing. The > previous design breaks collect_syscall. > > Move saving process to syscall entry to fix it. > > Reported-by: Xi Ruoyao > Link: https://github.com/util-linux/util-linux/issues/2867 > Signed-off-by: Jiaxun Yang > --- > arch/mips/include/asm/ptrace.h | 2 +- > arch/mips/kernel/asm-offsets.c | 1 + > arch/mips/kernel/ptrace.c | 15 ++++++--------- > arch/mips/kernel/scall32-o32.S | 23 +++++++++++++---------- > arch/mips/kernel/scall64-n32.S | 3 ++- > arch/mips/kernel/scall64-n64.S | 3 ++- > arch/mips/kernel/scall64-o32.S | 33 +++++++++++++++++---------------- > 7 files changed, 42 insertions(+), 38 deletions(-) applied to mips-fixes. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]