From patchwork Thu Oct 10 07:01:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13829639 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 F1B8FCF07B9 for ; Thu, 10 Oct 2024 07:05:06 +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:Cc:To:MIME-Version:Message-Id:Date: Subject: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=2EjHxSmss99RtbQfq4ZK7gzSk/jqcmegO+UCkjFVFUM=; b=RuxaVSgAY7gEmE 2JSb9nUXY5RqVK52dh1epIZXQEgrTPDdu8nuGFFWffJu+5PSBrhrOEarsUZsyYdWEpf332BZJvRCt SMYof5FrfHIJtPNjosq/3+/rjj5lx8ycmZmQLx+UvnWEq5QVbsgULzTdbCyDzKO/6VfaZx/ljGcEe bzSjB3kuDcoWD7hclLQgnIAGOiVlAVLxjgP71A+4YI28wKbXbbVjA3LTtZ2mO9hCbBLyqCNoUmh/A 8VO7WLkJMqX6NQU/m5A1tcCKdTk1KU99eQVS+RnQrbaxaN/Yndy9dLQAtIEEvCui8kB0GwznB09mw ZL+0mWZGYcBlnzwGO+WA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1synEL-0000000Bmi3-2G9X; Thu, 10 Oct 2024 07:05:01 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1synBS-0000000BleO-2EWK; Thu, 10 Oct 2024 07:02:06 +0000 From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1728543719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E4T95t+t5uIUSPRmbXi3insr6gkvL1A7vX9/M6uzeAI=; b=lmsrwGd/o99KSttwJ8sgkfe3ORDOYVzQtieE7kyC4+m+vRZ/tzWpxPQ8ePTZNQ19EFjx5I u3jGvagoJGW/qx9g2bUpnmEq8JoWczBHMUhDC79C1JomHxY98uotRFX+A96CPPno1gMwIu LyvrdSpMcdSsFeE5AWm4OzXxE/cIgCQiWE+WdzqZBRdbXLSt+FADnIPVu13PJJKh43s3lM jr/MVOD7fv5IDZjXZMEa9QSGaKAlyNTcMqwQmtVyZLRsNdOIMbYmcRsayg4uNcNoVlIB15 aYyMd6cpaCwNPFx2oScFtCmRqL8D8perF6lVmPIECmor4hdzn03+zzeo55ZhLA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1728543719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E4T95t+t5uIUSPRmbXi3insr6gkvL1A7vX9/M6uzeAI=; b=jky3v+I1IC+JVC8fX81ewpslVewnrQMUfSlcSSaPKvbXwS/AgvfDy+/FHxXQi6ThcgvJUH 9VEhGdOBmWvD01CA== Subject: [PATCH 00/28] vdso: Preparations for generic data storage Date: Thu, 10 Oct 2024 09:01:02 +0200 Message-Id: <20241010-vdso-generic-base-v1-0-b64f0842d512@linutronix.de> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAK57B2cC/x3MMQqAMAxA0atIZgNRa0WvIg5qY83SSgMiFO9uc fzD+xmUk7DCVGVIfItKDCWauoL9XINnFFcaWmpNQzTi7TSi51DYjtuqjLYjaw9nBrP1UNyV+JD nf87L+37En2/PYwAAAA== X-Change-ID: 20241009-vdso-generic-base-63066fd474b5 To: Guo Ren , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Russell King , Huacai Chen , WANG Xuerui , Theodore Ts'o , "Jason A. Donenfeld" , Thomas Bogendoerfer , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan , Vincenzo Frascino Cc: Christophe Leroy , linux-csky@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, =?utf-8?q?Thoma?= =?utf-8?q?s_Wei=C3=9Fschuh?= , Nam Cao X-Developer-Signature: v=1; a=ed25519-sha256; t=1728543717; l=6636; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=QNcCT8xdhsRdpIEe1ZjNJ7WuU4tLNw9Mj2qA/M/7NLg=; b=sQhdCAF4J2xGSbM7JksLHLhcrVflNnqDCh5fiBcZROnY5OCOWlamlaJcSOTO9oiyIYtO50MPw 565h0NVu1OkDw1F3hJlaEbk39HsimcY4lNzgNEvSbhPhR8U0cTPGVTN X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_000202_879922_0DA6FECF X-CRM114-Status: GOOD ( 14.69 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Historically each architecture defined their own datapage to store the VDSO data. This stands in contrast to the generic nature of the VDSO code itself. We plan to introduce a generic framework for the management of the VDSO data storage that can be used by all architectures and which works together with the existing generic VDSO code. Before that is possible align the different architectures by standardizing on the existing generic infrastructure and moving things out of the VDSO data page which does not belong there. Patches 1- 2: csky Patch 3: s390 Patches 4- 5: arm64 Patch 6: riscv Patch 7: arm Patch 8: LoongArch Patch 9: MIPS Patches 10-20: x86 Patches 21-27: powerpc Patch 28: Renamings to avoid a name clash with the new code. These patches are intended to be merged via the tip tree, so the following patches can be based on a unified base. The queue, including the full generic storage, is available at git://git.kernel.org/pub/scm/linux/kernel/git/thomas.weissschuh/linux.git vdso/store Signed-off-by: Thomas Weißschuh Acked-by: Heiko Carstens # s390 --- Nam Cao (1): vdso: Rename struct arch_vdso_data to arch_vdso_time_data Thomas Weißschuh (27): csky/vdso: Remove gettimeofday() and friends from VDSO csky/vdso: Remove arch_vma_name() s390/vdso: Drop LBASE_VDSO arm64: vdso: Drop LBASE_VDSO arm64: vdso: Use only one single vvar mapping riscv: vdso: Use only one single vvar mapping arm: vdso: Remove assembly for datapage access LoongArch: vDSO: Use vdso/datapage.h to access vDSO data MIPS: vdso: Avoid name conflict around "vdso_data" x86/mm/mmap: Remove arch_vma_name() x86: vdso: Use __arch_get_vdso_data() to access vdso data x86: vdso: Place vdso_data at beginning of vvar page x86: vdso: Access rng data from kernel without vvar x86: vdso: Allocate vvar page from C code x86: vdso: Access timens vdso data without vvar.h x86: vdso: Access rng vdso data without vvar.h x86: vdso: Move the rng offset to vsyscall.h x86: vdso: Access vdso data without vvar.h x86: vdso: Delete vvar.h x86: vdso: Split virtual clock pages into dedicated mapping powerpc: vdso: Remove offset comment from 32bit vdso_arch_data powerpc: procfs: Propagate error of remap_pfn_range() powerpc/pseries/lparcfg: Fix printing of system_active_processors powerpc/pseries/lparcfg: Use num_possible_cpus() for potential processors powerpc: Add kconfig option for the systemcfg page powerpc: Split systemcfg data out of vdso data page powerpc: Split systemcfg struct definitions out from vdso arch/Kconfig | 2 +- arch/arm/include/asm/vdso/gettimeofday.h | 4 +- arch/arm/vdso/Makefile | 2 +- arch/arm/vdso/datapage.S | 16 --- arch/arm/vdso/vdso.lds.S | 3 +- arch/arm64/include/asm/vdso.h | 9 +- arch/arm64/kernel/vdso.c | 43 +++----- arch/arm64/kernel/vdso/vdso.lds.S | 2 +- arch/arm64/kernel/vdso32/vdso.lds.S | 2 +- arch/csky/Kconfig | 4 - arch/csky/include/asm/vdso/clocksource.h | 9 -- arch/csky/include/asm/vdso/gettimeofday.h | 114 --------------------- arch/csky/include/asm/vdso/processor.h | 12 --- arch/csky/include/asm/vdso/vsyscall.h | 22 ---- arch/csky/kernel/vdso.c | 31 +----- arch/csky/kernel/vdso/Makefile | 1 - arch/csky/kernel/vdso/vdso.lds.S | 4 - arch/csky/kernel/vdso/vgettimeofday.c | 30 ------ arch/loongarch/include/asm/vdso/getrandom.h | 3 +- arch/loongarch/include/asm/vdso/gettimeofday.h | 4 +- arch/loongarch/include/asm/vdso/vdso.h | 18 +--- arch/loongarch/kernel/asm-offsets.c | 9 ++ arch/loongarch/vdso/vdso.lds.S | 8 +- arch/loongarch/vdso/vgetcpu.c | 2 +- arch/mips/vdso/genvdso.c | 4 +- arch/powerpc/Kconfig | 8 ++ arch/powerpc/include/asm/systemcfg.h | 52 ++++++++++ arch/powerpc/include/asm/vdso_datapage.h | 61 +---------- arch/powerpc/kernel/proc_powerpc.c | 37 +++++-- arch/powerpc/kernel/setup-common.c | 5 +- arch/powerpc/kernel/smp.c | 11 +- arch/powerpc/kernel/time.c | 4 + arch/powerpc/kernel/vdso.c | 20 ---- arch/powerpc/platforms/powernv/smp.c | 5 +- arch/powerpc/platforms/pseries/hotplug-cpu.c | 5 +- arch/powerpc/platforms/pseries/lparcfg.c | 5 +- arch/riscv/Kconfig | 2 +- .../riscv/include/asm/vdso/{data.h => time_data.h} | 8 +- arch/riscv/kernel/sys_hwprobe.c | 2 +- arch/riscv/kernel/vdso.c | 52 +++------- arch/riscv/kernel/vdso/hwprobe.c | 4 +- arch/s390/Kconfig | 2 +- arch/s390/include/asm/vdso.h | 3 - arch/s390/include/asm/vdso/data.h | 12 --- arch/s390/include/asm/vdso/time_data.h | 12 +++ arch/s390/kernel/vdso32/vdso32.lds.S | 2 +- arch/s390/kernel/vdso64/vdso64.lds.S | 2 +- arch/x86/entry/vdso/vdso-layout.lds.S | 20 ++-- arch/x86/entry/vdso/vma.c | 87 ++++++++++------ arch/x86/include/asm/vdso/getrandom.h | 10 +- arch/x86/include/asm/vdso/gettimeofday.h | 12 ++- arch/x86/include/asm/vdso/vsyscall.h | 14 ++- arch/x86/include/asm/vvar.h | 71 ------------- arch/x86/kernel/vmlinux.lds.S | 23 ----- arch/x86/mm/mmap.c | 5 - arch/x86/tools/relocs.c | 1 - include/vdso/datapage.h | 8 +- 57 files changed, 295 insertions(+), 628 deletions(-) --- base-commit: 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b change-id: 20241009-vdso-generic-base-63066fd474b5 Best regards,