From patchwork Tue Sep 26 17:22:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13399424 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 F3E5EE7E65B for ; Tue, 26 Sep 2023 17:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/vaiUDIXW+7iUtRWb/DoO8JTbmUt2keUlC9oHDZHXdE=; b=pZicd3g8NqzMim jZhxbMYqVmQaMteHtVn44kyrN5AW30d0NdUWMpknNP3sMpeP92shWg/4hylqcDEPfLXu1UCc5nLfG TlEYttcYXLxNGVJCDcAI9y4fHsUt4MIITJLRVD0+ehz8I78ygPIpmRBR+Xqagbi9dSb1QgiOrBgoA k3gcBg3QQnAc6JJlwN1J7Ne9I4UkysSPT8HvqbxJJXQ0gEMJ0lrY6fJJZDaQlo7y9x6eIJlaC1cYs Eoc6ISNLIcFlHsvWuAar3GjXOXAnYaREKDkV5viO/Xkc3/pxC5sd6WTXnbA35KtFMgQsLm6eGBsBy N3cvLqgG6SYJhKWPob+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qlBm4-00GmGi-0H; Tue, 26 Sep 2023 17:23:04 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qlBm1-00GmG2-1G for linux-arm-kernel@lists.infradead.org; Tue, 26 Sep 2023 17:23:02 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id CC117B80EBC; Tue, 26 Sep 2023 17:22:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06493C433C7; Tue, 26 Sep 2023 17:22:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695748979; bh=de4PaIe+gi6uEbnNSfbPH0YnkVx5n1zdlOSbQRUr3R0=; h=From:To:Cc:Subject:Date:From; b=hBLd32l3ouSF4pP2Rfe6jGzyEY4zTZRNbyPjNq7hLseYmzVm3j2mIUM080MmsQVXB Y3qIu2vb44eRdlLzw4FbbydqVtacnC79Z8gVDEuhIvvPoBKOGPYTr44ud9D/sI2YOw UDRMIGZQnKhqjGjt1U8SB5wHI7g/nSl4bw5byXzjrSiH7x0rDmx/Vr4eYzxSJJXPQq h4itxT41PNAfrYanOcTwQO5windtKNu6XVTGV+iyLJIecsiHPoYV9hzgSKd422/aLO DZPyDai3P+nm9c9EN7oKhGJPMNis3CE7uiXHvgvrNUuOjJs8aLyYULQVA9m69EnOLT FXpL4whjGsjeg== From: Masahiro Yamada To: patches@armlinux.org.uk Cc: linux-kernel@vger.kernel.org, Russell King , Masahiro Yamada , linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: make self-contained for ARM Date: Wed, 27 Sep 2023 02:22:53 +0900 Message-Id: <20230926172253.73204-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230926_102301_583341_E6658B85 X-CRM114-Status: GOOD ( 11.07 ) 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 When I compiled the following code for ARM, I encountered numerous errors. [Test Code] #include #include int foo(int *x, int __user *ptr) { return get_user(*x, ptr); } To fix them, make some asm headers self-contained: 1. In arch/arm/include/asm/traps.h, include for __init, and for asmlinkage. 2. In arch/arm/include/asm/domain.h, include for current_thread_info(). 3. In arch/arm/include/asm/uaccess.h, include for might_fault(). Signed-off-by: Masahiro Yamada --- KernelVersion: v6.6-rc1 arch/arm/include/asm/domain.h | 2 +- arch/arm/include/asm/traps.h | 2 ++ arch/arm/include/asm/uaccess.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h index 41536feb4392..d48859fdf32c 100644 --- a/arch/arm/include/asm/domain.h +++ b/arch/arm/include/asm/domain.h @@ -8,8 +8,8 @@ #define __ASM_PROC_DOMAIN_H #ifndef __ASSEMBLY__ +#include #include -#include #endif /* diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h index 0aaefe3e1700..d44df9eac170 100644 --- a/arch/arm/include/asm/traps.h +++ b/arch/arm/include/asm/traps.h @@ -2,6 +2,8 @@ #ifndef _ASMARM_TRAP_H #define _ASMARM_TRAP_H +#include +#include #include struct pt_regs; diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index bb5c81823117..6a2cc57f015a 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -8,6 +8,7 @@ /* * User space memory access functions */ +#include #include #include #include