From patchwork Thu Jun 20 16:23:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 92566 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 929E2389247F for ; Thu, 20 Jun 2024 16:26:46 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by sourceware.org (Postfix) with ESMTPS id 6ACD13892474 for ; Thu, 20 Jun 2024 16:24:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6ACD13892474 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6ACD13892474 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=139.178.84.217 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718900696; cv=none; b=BhNFIEKY5+kaHOb+AZz5lQpJdcTwCV80XQb/b1QMxSGLt59PdifYlkhlOCg9z/P/Li0sZ1q/ZpNSAXl+L0RZwoFgH8Ac5vTQ4t+UT2hTFGMOlHBjXvFA3yWKqWjcIQzr1SOEjBzKqMZrYEXGxNPyoSr4JNK+nu8eCy2eb2grdS0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718900696; c=relaxed/simple; bh=CTMiij8diPtp23L47nQHWXQrj3MX4OJNEzgig287ZPA=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=hPmtJYQcJmSvJ8EmaoEaH+KopGEbKwjUsbiDfiooMBe2kGkf0/8zAXGJLCiQo4+hLfuI6AWf5QrQLehiN7ltqI5LkZ3ytSMVsGB/QJwI00sas7HDzBK1/iCeapsDk59zckqQfc44gXpb1bUUJwkCftUYihT49x/ndxIuDvCcAMc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D4CB9621EF; Thu, 20 Jun 2024 16:24:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DEAEC2BD10; Thu, 20 Jun 2024 16:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718900691; bh=CTMiij8diPtp23L47nQHWXQrj3MX4OJNEzgig287ZPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=liP+clW/FYJDMFwHv7e2XTi4LYa5eTnDyL47NLmiZ3cdTxaeJVM6WiqLSOvjZXten pE6JYMMTtK2vXsP1OXrG0X/wzRuupXj07RgRMay50dms6iT69PyESvm8MZAALUCwW6 ScElgo7HBzd1he0cQvkNBktxqXYA3+ZQp+4j7Eyi0zUX6iTS+26CH6314rMnHOCsxp 2GZ0MxgqvDjTVnlva8n8/w9P6j9/14JsdOE3xslLC/hd1U15iSxzjY7Gdw5OPMjGTi FxE0zxbrXL4hhuRiBxV9AFKTmJuqA88W9aUdlZqe/hk7lAm9X+hHNtXkp5bF7KXdDP LnYwGSfr5+nRQ== From: Arnd Bergmann To: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Helge Deller , linux-parisc@vger.kernel.org, "David S. Miller" , Andreas Larsson , sparclinux@vger.kernel.org, Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Naveen N . Rao" , linuxppc-dev@lists.ozlabs.org, Brian Cain , linux-hexagon@vger.kernel.org, Guo Ren , linux-csky@vger.kernel.org, Heiko Carstens , linux-s390@vger.kernel.org, Rich Felker , John Paul Adrian Glaubitz , linux-sh@vger.kernel.org, "H. Peter Anvin" , Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, libc-alpha@sourceware.org, musl@lists.openwall.com, ltp@lists.linux.it, stable@vger.kernel.org Subject: [PATCH 11/15] hexagon: fix fadvise64_64 calling conventions Date: Thu, 20 Jun 2024 18:23:12 +0200 Message-Id: <20240620162316.3674955-12-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240620162316.3674955-1-arnd@kernel.org> References: <20240620162316.3674955-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org From: Arnd Bergmann fadvise64_64() has two 64-bit arguments at the wrong alignment for hexagon, which turns them into a 7-argument syscall that is not supported by Linux. The downstream musl port for hexagon actually asks for a 6-argument version the same way we do it on arm, csky, powerpc, so make the kernel do it the same way to avoid having to change both. Link: https://github.com/quic/musl/blob/hexagon/arch/hexagon/syscall_arch.h#L78 Cc: stable@vger.kernel.org Signed-off-by: Arnd Bergmann --- arch/hexagon/include/asm/syscalls.h | 6 ++++++ arch/hexagon/kernel/syscalltab.c | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 arch/hexagon/include/asm/syscalls.h diff --git a/arch/hexagon/include/asm/syscalls.h b/arch/hexagon/include/asm/syscalls.h new file mode 100644 index 000000000000..40f2d08bec92 --- /dev/null +++ b/arch/hexagon/include/asm/syscalls.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include + +asmlinkage long sys_hexagon_fadvise64_64(int fd, int advice, + u32 a2, u32 a3, u32 a4, u32 a5); diff --git a/arch/hexagon/kernel/syscalltab.c b/arch/hexagon/kernel/syscalltab.c index 0fadd582cfc7..5d98bdc494ec 100644 --- a/arch/hexagon/kernel/syscalltab.c +++ b/arch/hexagon/kernel/syscalltab.c @@ -14,6 +14,13 @@ #undef __SYSCALL #define __SYSCALL(nr, call) [nr] = (call), +SYSCALL_DEFINE6(hexagon_fadvise64_64, int, fd, int, advice, + SC_ARG64(offset), SC_ARG64(len)) +{ + return ksys_fadvise64_64(fd, SC_VAL64(loff_t, offset), SC_VAL64(loff_t, len), advice); +} +#define sys_fadvise64_64 sys_hexagon_fadvise64_64 + void *sys_call_table[__NR_syscalls] = { #include };