From patchwork Thu Oct 10 11:33:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13830001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08253CF11D2 for ; Thu, 10 Oct 2024 11:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VzzrIJOoccLZThZLp3kOXktHyMNXE6/2voWdPpMOjWQ=; b=FNptCsszatlnP0FGIEin8aUjuh P8dOoiUrVgdcqCW5rui35sZhWv4QPfbOpTDtVeXTZ7iBqvFD9uArmdHZVkGZOMlpADd8c6hax4PVA tAV+j8C68ICND5lQ+ZCoH52paeRKqGxhQZ9d8zyQuUFXW6Znrx6ANNWukwGMdK2lHTz9F870AXYs7 HkNGKpI9nVJthlKNRnZbfNH7YqmpYKow/LxSEQIPEHggIlOUTiECau6Ff5P4hzTjpbylBxGogN9Rw QtEswkhzJf11z0X7Xzb+Af/5gtY/8OdWN2rHt4LVjmdLwZsutbcS+2HyoP1tU338WtApnrBJKtTKg lKQM6vPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syrjG-0000000CcC4-41s1; Thu, 10 Oct 2024 11:53:15 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syrQj-0000000CYGa-0WSM for linux-arm-kernel@lists.infradead.org; Thu, 10 Oct 2024 11:34:08 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a93c1cc74fdso139032966b.3 for ; Thu, 10 Oct 2024 04:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728560043; x=1729164843; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VzzrIJOoccLZThZLp3kOXktHyMNXE6/2voWdPpMOjWQ=; b=Yi1aI23Fn3GZF04nJb0fHKuf2DqGghT9/JlnwdUQKVzu+7hExCSEv5dbdkx/yknM6h 89kt81JFaOB3LFG6qOElCWfsfKt25JNtq4L+LRAKoq5czwqIWWU2KDc5pBn8EnKO7fIh kPqr3FILAGWmZa6JmF2Ne3uZ61XJklVLRMsVrJV3QxbFVNPFdsslc92y9LIHvHcFedYl qyHNnyCIgLiNWZ6a28SrCbwoaiPENXW+Uo8Un1cNnQ85WC5R6O7BdgzsVkppKmq3r1Fp otv6R9VvP0y7+c0hCYBTA/uF/fFuthoV2lapWyIk+vsa8SLUHjfl83+ie8uv6DsQgqSK YMsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728560043; x=1729164843; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VzzrIJOoccLZThZLp3kOXktHyMNXE6/2voWdPpMOjWQ=; b=v029YA7EXaXknwhi0laVwQems+6kwHSxoe8RzL3iat8Y8fZxRTJbCzSz8tH9r0Cl5N R1POXM5Y+EpmttP/RFBuLINpQPJoyUb3gHy/6JjuoiQZUs4BZpBieOdhKWppwcQIxmyh u97q+XRQSYWs/7zpm6D6gIoj2i/EW/scwWwx3qDmU1xmAWSAW0YNfOq9EdP6lqRIZxLD z7Af9GwK8ocaZnWFEni1ATWHNFMWU1N2DJhcEvjSM6NssKoTYeHVxBNqKR5xMhRKnk96 GmQcxDnFSzXlI9iPPMyuHRodCKhJzEbOJ1955K/SIFLmqTbfxhSxm3eJAG4puttOQ0sx NhQw== X-Gm-Message-State: AOJu0Yy587DZujcLw8jqrpNnNFvFWiFjPsPB7ZG3gdSoV9r8nNPsy20V eBcTiA7RMzO+by56mMLO4zUm6fxwncUPgnoagGbqzlRJvvvMp8tBOXJ4l/M7isM= X-Google-Smtp-Source: AGHT+IHADUgNkk0hVOK1JFXtca7534b5748m22i8omloPYXVG1QKj3GD3Xqq0GICp3+Pdqz4GrjLzQ== X-Received: by 2002:a17:906:730b:b0:a99:4a87:cc7c with SMTP id a640c23a62f3a-a998d34c373mr530776766b.58.1728560043498; Thu, 10 Oct 2024 04:34:03 -0700 (PDT) Received: from lino.lan ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a7f25406sm77619066b.69.2024.10.10.04.34.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 04:34:03 -0700 (PDT) From: Linus Walleij Date: Thu, 10 Oct 2024 13:33:50 +0200 Subject: [PATCH RFC 12/28] ARM: entry: Rename syscall invocation MIME-Version: 1.0 Message-Id: <20241010-arm-generic-entry-v1-12-b94f451d087b@linaro.org> References: <20241010-arm-generic-entry-v1-0-b94f451d087b@linaro.org> In-Reply-To: <20241010-arm-generic-entry-v1-0-b94f451d087b@linaro.org> To: Oleg Nesterov , Russell King , Kees Cook , Andy Lutomirski , Will Drewry , Frederic Weisbecker , "Paul E. McKenney" , Jinjie Ruan , Arnd Bergmann , Ard Biesheuvel , Al Viro Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.14.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_043405_216226_99E8B118 X-CRM114-Status: GOOD ( 15.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Now that we do not have a separate trace syscall invocation path, rename the invocation functions to be generic. This can be squashed into the previous patch, it is just done here for the previous patch to be easier to get a cleaner diff and be easier to read. Signed-off-by: Linus Walleij --- arch/arm/include/asm/syscall.h | 2 +- arch/arm/kernel/entry-common.S | 10 +++++----- arch/arm/kernel/syscall.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/arch/arm/include/asm/syscall.h b/arch/arm/include/asm/syscall.h index 9c664d8c5718..b94fd7ce17f8 100644 --- a/arch/arm/include/asm/syscall.h +++ b/arch/arm/include/asm/syscall.h @@ -19,7 +19,7 @@ extern const unsigned long sys_call_table[]; -int invoke_syscall_trace(void *table, struct pt_regs *regs, int scno); +int invoke_syscall(void *table, struct pt_regs *regs, int scno); static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs) diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index f0f1f8723965..f1e48002bd30 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -260,7 +260,7 @@ ENTRY(vector_swi) stmdb sp!, {r4, r5} @ push fifth and sixth args mov r0, tbl mov r2, scno @ syscall number from r7 - bl invoke_syscall_trace + bl invoke_syscall cmp r0, #0 beq ret_fast_syscall /* This path taken when tracing */ @@ -390,7 +390,7 @@ ENDPROC(sys_mmap2) * r1: regs * r2: syscall number */ -SYM_TYPED_FUNC_START(invoke_syscall_trace_asm) +SYM_TYPED_FUNC_START(invoke_syscall_asm) #ifdef CONFIG_CPU_SPECTRE csdb #endif @@ -400,17 +400,17 @@ SYM_TYPED_FUNC_START(invoke_syscall_trace_asm) /* Make space to copy the two syscall stack arguments */ sub sp, sp, #S_OFF mov scno, r2 - badr lr, __invoke_syscall_trace_ret @ return right here + badr lr, __invoke_syscall_ret @ return right here ldmia r1, {r0 - r6} @ reload r0-r6 from regs stmia sp, {r4, r5} @ copy stack arguments ldr pc, [tbl, scno, lsl #2] @ call sys_* routine -__invoke_syscall_trace_ret: +__invoke_syscall_ret: /* Drop the copied stack arguments */ add sp, sp, #S_OFF pop {r4 - r10, lr} ARM( mov pc, lr ) THUMB( bx lr ) -SYM_FUNC_END(invoke_syscall_trace_asm) +SYM_FUNC_END(invoke_syscall_asm) #ifdef CONFIG_OABI_COMPAT diff --git a/arch/arm/kernel/syscall.c b/arch/arm/kernel/syscall.c index ab9e66da0a80..968cec945a7e 100644 --- a/arch/arm/kernel/syscall.c +++ b/arch/arm/kernel/syscall.c @@ -8,9 +8,9 @@ static inline bool has_syscall_work(unsigned long flags) return unlikely(flags & _TIF_SYSCALL_WORK); } -int invoke_syscall_trace_asm(void *table, struct pt_regs *regs, int scno); +int invoke_syscall_asm(void *table, struct pt_regs *regs, int scno); -__visible int invoke_syscall_trace(void *table, struct pt_regs *regs, int scno) +__visible int invoke_syscall(void *table, struct pt_regs *regs, int scno) { unsigned long flags = read_thread_flags(); int ret; @@ -22,7 +22,7 @@ __visible int invoke_syscall_trace(void *table, struct pt_regs *regs, int scno) } if (scno < NR_syscalls) { - ret = invoke_syscall_trace_asm(table, regs, scno); + ret = invoke_syscall_asm(table, regs, scno); goto exit_save; }