From patchwork Tue Oct 1 19:51:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 13818693 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58A391CDA09; Tue, 1 Oct 2024 19:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727812322; cv=none; b=XHHaqev98zPmY4uKXB1ewvZYpLTTKFCUYvBUGfmeQk/FZhGOmkU3h+7wpAWC1OItd385aFW0D6prvAmNPSHEQEm0w31w9/giq+HE0RtR0ThDbJ5l/vl2XgUWFeyLYG+BBLRqFXKnnlEVBblBJwtgUDIUkaCDvysnc77+4QJeb6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727812322; c=relaxed/simple; bh=TIHjBTyVKePvkd7vZH1lHOHBvlKGISrLpJ5DUm++GS0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TWKNQdh0jOZEG/QU3yAMJQgX+tOx3HDPvE12cg9oYHOVz2qiMdjqTPLqbFoTo0YZQXKv7TuQp9pzo5MeI0OkaSNbr3J/jtEjSgwLJwAd2sp77CRpAOBK3t5dBZVuTpqy9MDKP+1v8p4d++rxkv9hUtli0gwERtiwBRG1qReD0bw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=RJ4Ya5VS; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="RJ4Ya5VS" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xa+Bc4wVHUCS0MYJrH7PUOO8ca5otHSXeMvqCaG7vM4=; b=RJ4Ya5VSUbwwVGt4ysRf3GwF0H PAoJxqkFKxB2czgdULb4WWTjI7XBUshmtsithiaYtxK3C8Mbjp8P2Cw6c3dNOVqNctMDHDyWdTQtH g5fUYtD9aPk7NxIb9BF1CZfiEQoA6mUurUImL82jhc0Rb5b8yU72Zjvc/hsxT0GY1BdY5qDURuvQy 8NeYejteB8BlUL3rc9tme/hsxGXfbsoAMzkSPuREZQJDdPXoNJoN6SkQi3zR07cmlkteGJyCIxj0/ K6cWcbCGd4XEpfx3CITKrrgerDwDtU8ukv0/l0g62lkd25g+Pj3DpISafvWxjl5AlzHT4OFHSOuyC JEhasm4A==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.98 #2 (Red Hat Linux)) id 1sviuc-0000000HLtz-2ksp; Tue, 01 Oct 2024 19:51:58 +0000 Date: Tue, 1 Oct 2024 20:51:58 +0100 From: Al Viro To: linux-arch@vger.kernel.org Cc: Linus Torvalds , linux-parisc@vger.kernel.org, Vineet Gupta Subject: [PATCH 1/3] parisc: get rid of private asm/unaligned.h Message-ID: <20241001195158.GA4135693@ZenIV> References: <20241001195107.GA4017910@ZenIV> Precedence: bulk X-Mailing-List: linux-parisc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20241001195107.GA4017910@ZenIV> Sender: Al Viro Declarations local to arch/*/kernel/*.c are better off *not* in a public header - arch/parisc/kernel/unaligned.h is just fine for those bits. With that done parisc asm/unaligned.h is reduced to include of asm-generic/unaligned.h and can be removed - unaligned.h is in mandatory-y in include/asm-generic/Kbuild. Signed-off-by: Al Viro Acked-by: Helge Deller --- arch/parisc/include/asm/unaligned.h | 11 ----------- arch/parisc/kernel/traps.c | 2 ++ arch/parisc/kernel/unaligned.c | 1 + arch/parisc/kernel/unaligned.h | 3 +++ 4 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 arch/parisc/include/asm/unaligned.h create mode 100644 arch/parisc/kernel/unaligned.h diff --git a/arch/parisc/include/asm/unaligned.h b/arch/parisc/include/asm/unaligned.h deleted file mode 100644 index c0621295100d..000000000000 --- a/arch/parisc/include/asm/unaligned.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_PARISC_UNALIGNED_H -#define _ASM_PARISC_UNALIGNED_H - -#include - -struct pt_regs; -void handle_unaligned(struct pt_regs *regs); -int check_unaligned(struct pt_regs *regs); - -#endif /* _ASM_PARISC_UNALIGNED_H */ diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 294b0e026c9a..a111d7362d56 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c @@ -47,6 +47,8 @@ #include #include +#include "unaligned.h" + #if defined(CONFIG_LIGHTWEIGHT_SPINLOCK_CHECK) #include #endif diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c index 3e79e40e361d..99897107d800 100644 --- a/arch/parisc/kernel/unaligned.c +++ b/arch/parisc/kernel/unaligned.c @@ -15,6 +15,7 @@ #include #include #include +#include "unaligned.h" /* #define DEBUG_UNALIGNED 1 */ diff --git a/arch/parisc/kernel/unaligned.h b/arch/parisc/kernel/unaligned.h new file mode 100644 index 000000000000..c1aa4b12e284 --- /dev/null +++ b/arch/parisc/kernel/unaligned.h @@ -0,0 +1,3 @@ +struct pt_regs; +void handle_unaligned(struct pt_regs *regs); +int check_unaligned(struct pt_regs *regs); From patchwork Tue Oct 1 19:53:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Viro X-Patchwork-Id: 13818694 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 160FE19D894; Tue, 1 Oct 2024 19:53:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727812384; cv=none; b=GZ7gV/YrdN5H0WoUACAmdz42puZLQLafd+2zYhBFDULFxDL6kRbiCzbqPU3oU7B60jr1dq1a0aiXCgtAztX3ZijkL0EtA50hgks7M85/Dl+N9KPUN8Vgr9Ha0WaawvRwAH6va8WshKmAcUuCvScu22yQPmL1tb8ATo/6XB+wAMA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727812384; c=relaxed/simple; bh=m1fCNDHHE5yacpCqSDEonHrjUjBQyDnJZdVlgbWMXaY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nNV4OUv4tWrkUqySSBVWGcz3uTIjzlbH6KvlCcTNBbzp8YDsYubAuF5s5QnS+FhJNAhchGjOAHk+rw11v+BZ25YtUNQocQYGi7pWL6ZzkxmKRvyWwnJHOrwVATbzBoM+KkmZHZ3iebNC7pp1aTGXsmrGXPbWXc2ZVXqM3Gd8M18= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=rjKI26XN; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="rjKI26XN" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5EVxBGPp7KGspKutgQuR6iCITjad0JGZJJIjxk3aigs=; b=rjKI26XNH4mwnLSIiAR6/5K4Yf 3XsMqr1A1taSsSeYitGtdIwkYfU33jONiNJU75qEftLrjZnGpIxpCbIhrpVFpq9YvY5flkjmtcETH O5s79phbB0tjHU6++gTizy1x3xzW9EgVhEZ0iWgz6LMIS6UVri9V+6koDcqDvLNDcwmAsXS1Mg+Bv KKaszQQ2XyCc31AkUoktaUS16tmGmByVaI3/kS13Mp3sIdA6oLAiHLNnS0vPSPo8S3DgzbCJ9kFWH iAO+eZE7oxS8XwEWu0XECv53BXfGqRlclTpKykqVbu18KY3tL+X7QOi7Jwet9QJhIFWQk5Ud+pWB0 NXSsG5VQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.98 #2 (Red Hat Linux)) id 1svivc-0000000HLw5-2va1; Tue, 01 Oct 2024 19:53:00 +0000 Date: Tue, 1 Oct 2024 20:53:00 +0100 From: Al Viro To: linux-arch@vger.kernel.org Cc: Linus Torvalds , linux-parisc@vger.kernel.org, Vineet Gupta Subject: [PATCH 2/3] arc: get rid of private asm/unaligned.h Message-ID: <20241001195300.GB4135693@ZenIV> References: <20241001195107.GA4017910@ZenIV> Precedence: bulk X-Mailing-List: linux-parisc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20241001195107.GA4017910@ZenIV> Sender: Al Viro Declarations local to arch/*/kernel/*.c are better off *not* in a public header - arch/arc/kernel/unaligned.h is just fine for those bits. Unlike the parisc case, here we have an extra twist - asm/mmu.h has an implicit dependency on struct pt_regs, and in some users that used to be satisfied by include of asm/ptrace.h from asm/unaligned.h (note that asm/mmu.h itself did _not_ pull asm/unaligned.h - it relied upon the users having pulled asm/unaligned.h before asm/mmu.h got there). Seeing that asm/mmu.h only wants struct pt_regs * arguments in an extern, just pre-declare it there - less brittle that way. With that done _all_ asm/unaligned.h instances are reduced to include of asm-generic/unaligned.h and can be removed - unaligned.h is in mandatory-y in include/asm-generic/Kbuild. What's more, we can move asm-generic/unaligned.h to linux/unaligned.h and switch includes of to ; that's better off as an auto-generated commit, though, to be done by Linus at -rc1 time next cycle. Signed-off-by: Al Viro Acked-by: Vineet Gupta --- arch/arc/include/asm/mmu.h | 1 + arch/arc/include/asm/unaligned.h | 27 --------------------------- arch/arc/kernel/traps.c | 1 + arch/arc/kernel/unaligned.c | 1 + arch/arc/kernel/unaligned.h | 16 ++++++++++++++++ 5 files changed, 19 insertions(+), 27 deletions(-) delete mode 100644 arch/arc/include/asm/unaligned.h create mode 100644 arch/arc/kernel/unaligned.h diff --git a/arch/arc/include/asm/mmu.h b/arch/arc/include/asm/mmu.h index 9febf5bc3de6..4ae2db59d494 100644 --- a/arch/arc/include/asm/mmu.h +++ b/arch/arc/include/asm/mmu.h @@ -14,6 +14,7 @@ typedef struct { unsigned long asid[NR_CPUS]; /* 8 bit MMU PID + Generation cycle */ } mm_context_t; +struct pt_regs; extern void do_tlb_overlap_fault(unsigned long, unsigned long, struct pt_regs *); #endif diff --git a/arch/arc/include/asm/unaligned.h b/arch/arc/include/asm/unaligned.h deleted file mode 100644 index cf5a02382e0e..000000000000 --- a/arch/arc/include/asm/unaligned.h +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) - */ - -#ifndef _ASM_ARC_UNALIGNED_H -#define _ASM_ARC_UNALIGNED_H - -/* ARC700 can't handle unaligned Data accesses. */ - -#include -#include - -#ifdef CONFIG_ARC_EMUL_UNALIGNED -int misaligned_fixup(unsigned long address, struct pt_regs *regs, - struct callee_regs *cregs); -#else -static inline int -misaligned_fixup(unsigned long address, struct pt_regs *regs, - struct callee_regs *cregs) -{ - /* Not fixed */ - return 1; -} -#endif - -#endif /* _ASM_ARC_UNALIGNED_H */ diff --git a/arch/arc/kernel/traps.c b/arch/arc/kernel/traps.c index a19751e824fb..41af02081549 100644 --- a/arch/arc/kernel/traps.c +++ b/arch/arc/kernel/traps.c @@ -20,6 +20,7 @@ #include #include #include +#include "unaligned.h" void die(const char *str, struct pt_regs *regs, unsigned long address) { diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c index 99a9b92ed98d..d2f5ceaaed1b 100644 --- a/arch/arc/kernel/unaligned.c +++ b/arch/arc/kernel/unaligned.c @@ -12,6 +12,7 @@ #include #include #include +#include "unaligned.h" #ifdef CONFIG_CPU_BIG_ENDIAN #define BE 1 diff --git a/arch/arc/kernel/unaligned.h b/arch/arc/kernel/unaligned.h new file mode 100644 index 000000000000..5244453bb85f --- /dev/null +++ b/arch/arc/kernel/unaligned.h @@ -0,0 +1,16 @@ +struct pt_regs; +struct callee_regs; + +#ifdef CONFIG_ARC_EMUL_UNALIGNED +int misaligned_fixup(unsigned long address, struct pt_regs *regs, + struct callee_regs *cregs); +#else +static inline int +misaligned_fixup(unsigned long address, struct pt_regs *regs, + struct callee_regs *cregs) +{ + /* Not fixed */ + return 1; +} +#endif +