Received: by 2002:a05:6520:1682:b0:147:d1a0:b502 with SMTP id ck2csp5594875lkb; Mon, 11 Oct 2021 09:37:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN+EEWj025UTy+esx19Qw7oXqniXWWvb4CU9GP4aPkSfykofVtsG7yqsGG7xaUdcS+BhCu X-Received: by 2002:a17:90a:ab94:: with SMTP id n20mr23434pjq.146.1633970227881; Mon, 11 Oct 2021 09:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633970227; cv=none; d=google.com; s=arc-20160816; b=IgoaBiEqAwnASPC6kLBJ6W1sHbsLQU9M4yWGak2ZSoiJuQyHq+jPFmlSp3F5V0yMjp wSNol93RMWoxg7m0gUzaioyN+uEj8MTBqeRsaghBaxgxOm5lGrh/67jPK0BzA+wDw+k0 lPi6BJI7J4mXmXoseqysy7DvFMWPx1/cD+5BxwugkVfHPuLQmHU7KU51JrAE3L+hyYxo xhfmANfU+RSj1pE64ajPZYgLI9a2fJOswDjfFRKkIE+ZpfXSP8uSsgjKPJt9ZWqEkM/X 9iaIx1hEFkQNXyEFlQXO722nqdLX3kJgYigmaQR38Rg1qXD1sdaD7sGV+vAP1mhPx/pW JvNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h7rerrhbuMZjpahMMUFyECDSWCRrN971RFGUuMwlG/8=; b=mGRYAV81gAxsjJz3KwtKpO1YqWdrefcb8eKepbVqgDWMittLF3fnVaVoiwIEG2VO7W KYgvRg/FXBeqljlsm1o+439A0kSYzbOp0zwsfaxHRzn1+GB9i4V3xDtI8BRazNiFagAf qvhWVXDFooBG00D0rD3KeFSCUCAVjQDYKkQbbP9yGxGWrj3URN1hvFPYqjjRoEss0pYu 4qANyLqf4jSyh3YBLoFKoC2b1ENi+OX2CiHchDsy6JW3LD6aqWKi9u1LqKc+QsF8mgV3 h7vsxFxEpLeo5Si49P2GVeXSaFF8IBImnpBDDpQYOgF26VvF4J0jggVUTUrd1kgZweye WIyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=12oRwUJx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e17si5555034pfv.216.2021.10.11.09.36.52; Mon, 11 Oct 2021 09:37:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=12oRwUJx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241571AbhJKONB (ORCPT + 99 others); Mon, 11 Oct 2021 10:13:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:34548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243253AbhJKOKX (ORCPT ); Mon, 11 Oct 2021 10:10:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 57C71610C7; Mon, 11 Oct 2021 14:02:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633960951; bh=+Q/6xv4ZZ8kq77n5qn7BldO3d78CjdNUeqKeh4DyJGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=12oRwUJxpZsrVmQzfAaRCRQTE0Q5//aRFLXlbyGFGtnyLzSd8ANyBfkeSAWLSg1Is pINEF3QWInNLr1IDyAyNV0Xaqm6PP4/nW1xjDQPezxp9f9mUWB3tJSjEdoPHMqPowR 0Wlk0lxoXN06+/xcXgEEjRDfWypHaVLk89vmcs90= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tong Tiangen , Kefeng Wang , Palmer Dabbelt , Sasha Levin Subject: [PATCH 5.14 123/151] riscv/vdso: Refactor asm/vdso.h Date: Mon, 11 Oct 2021 15:46:35 +0200 Message-Id: <20211011134521.788888454@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011134517.833565002@linuxfoundation.org> References: <20211011134517.833565002@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tong Tiangen [ Upstream commit bb4a23c994aebcd96c567a0be8e964d516bd4a61 ] The asm/vdso.h will be included in vdso.lds.S in the next patch, the following cleanup is needed to avoid syntax error: 1.the declaration of sys_riscv_flush_icache() is moved into asm/syscall.h. 2.the definition of struct vdso_data is moved into kernel/vdso.c. 2.the definition of VDSO_SYMBOL is placed under "#ifndef __ASSEMBLY__". Also remove the redundant linux/types.h include. Signed-off-by: Tong Tiangen Reviewed-by: Kefeng Wang Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin --- arch/riscv/include/asm/syscall.h | 1 + arch/riscv/include/asm/vdso.h | 16 ++++++++++------ arch/riscv/kernel/syscall_table.c | 1 - arch/riscv/kernel/vdso.c | 5 ++++- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/arch/riscv/include/asm/syscall.h b/arch/riscv/include/asm/syscall.h index b933b1583c9f..34fbb3ea21d5 100644 --- a/arch/riscv/include/asm/syscall.h +++ b/arch/riscv/include/asm/syscall.h @@ -82,4 +82,5 @@ static inline int syscall_get_arch(struct task_struct *task) #endif } +asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t); #endif /* _ASM_RISCV_SYSCALL_H */ diff --git a/arch/riscv/include/asm/vdso.h b/arch/riscv/include/asm/vdso.h index 893e47195e30..a4a979c89ea0 100644 --- a/arch/riscv/include/asm/vdso.h +++ b/arch/riscv/include/asm/vdso.h @@ -16,18 +16,22 @@ #ifdef CONFIG_MMU #include -#include +/* + * All systems with an MMU have a VDSO, but systems without an MMU don't + * support shared libraries and therefor don't have one. + */ +#ifdef CONFIG_MMU -#ifndef CONFIG_GENERIC_TIME_VSYSCALL -struct vdso_data { -}; -#endif +#ifndef __ASSEMBLY__ +#include #define VDSO_SYMBOL(base, name) \ (void __user *)((unsigned long)(base) + __vdso_##name##_offset) #endif /* CONFIG_MMU */ -asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t); +#endif /* !__ASSEMBLY__ */ + +#endif /* CONFIG_MMU */ #endif /* _ASM_RISCV_VDSO_H */ diff --git a/arch/riscv/kernel/syscall_table.c b/arch/riscv/kernel/syscall_table.c index a63c667c27b3..44b1420a2270 100644 --- a/arch/riscv/kernel/syscall_table.c +++ b/arch/riscv/kernel/syscall_table.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #undef __SYSCALL diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c index 25a3b8849599..72e93d218335 100644 --- a/arch/riscv/kernel/vdso.c +++ b/arch/riscv/kernel/vdso.c @@ -12,10 +12,13 @@ #include #include #include +#include + #ifdef CONFIG_GENERIC_TIME_VSYSCALL #include #else -#include +struct vdso_data { +}; #endif extern char vdso_start[], vdso_end[]; -- 2.33.0