* [PATCH 00/28] vdso: Preparations for generic data storage
@ 2024-10-10 7:01 Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 01/28] csky/vdso: Remove gettimeofday() and friends from VDSO Thomas Weißschuh
` (29 more replies)
0 siblings, 30 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh, Nam Cao
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 <thomas.weissschuh@linutronix.de>
---
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,
--
Thomas Weißschuh <thomas.weissschuh@linutronix.de>
^ permalink raw reply [flat|nested] 37+ messages in thread
* [PATCH 01/28] csky/vdso: Remove gettimeofday() and friends from VDSO
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 02/28] csky/vdso: Remove arch_vma_name() Thomas Weißschuh
` (28 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The time-related VDSO functionality was introduced in 2021 in
commit 87f3248cdb9a ("csky: Reconstruct VDSO framework") and
commit 0d3b051adbb7 ("csky: Add VDSO with GENERIC_GETTIMEOFDAY, GENERIC_TIME_VSYSCALL, HAVE_GENERIC_VDSO").
However the corresponding aux-vector entry AT_SYSINFO_EHDR was never
wired up, making these functions impossible to test or use.
The VDSO itself is kept as it also provides rt_sigreturn which is
exposed differently to userspace.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
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 | 24 +------
arch/csky/kernel/vdso/Makefile | 1 -
arch/csky/kernel/vdso/vdso.lds.S | 4 --
arch/csky/kernel/vdso/vgettimeofday.c | 30 --------
9 files changed, 2 insertions(+), 218 deletions(-)
diff --git a/arch/csky/Kconfig b/arch/csky/Kconfig
index 5479707eb5d10df1e083c9c7c547c266b64f4232..acc431c331b08eca0c853e96ead44478d99257dd 100644
--- a/arch/csky/Kconfig
+++ b/arch/csky/Kconfig
@@ -64,9 +64,6 @@ config CSKY
select GENERIC_IRQ_MULTI_HANDLER
select GENERIC_SCHED_CLOCK
select GENERIC_SMP_IDLE_THREAD
- select GENERIC_TIME_VSYSCALL
- select GENERIC_VDSO_32
- select GENERIC_GETTIMEOFDAY
select GX6605S_TIMER if CPU_CK610
select HAVE_ARCH_TRACEHOOK
select HAVE_ARCH_AUDITSYSCALL
@@ -80,7 +77,6 @@ config CSKY
select HAVE_DEBUG_KMEMLEAK
select HAVE_DYNAMIC_FTRACE
select HAVE_DYNAMIC_FTRACE_WITH_REGS
- select HAVE_GENERIC_VDSO
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_GRAPH_TRACER
select HAVE_FUNCTION_ERROR_INJECTION
diff --git a/arch/csky/include/asm/vdso/clocksource.h b/arch/csky/include/asm/vdso/clocksource.h
deleted file mode 100644
index dfca7b4724b798ea0e0f05ea7559a4570f8fa5f7..0000000000000000000000000000000000000000
--- a/arch/csky/include/asm/vdso/clocksource.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef __ASM_VDSO_CSKY_CLOCKSOURCE_H
-#define __ASM_VDSO_CSKY_CLOCKSOURCE_H
-
-#define VDSO_ARCH_CLOCKMODES \
- VDSO_CLOCKMODE_ARCHTIMER
-
-#endif /* __ASM_VDSO_CSKY_CLOCKSOURCE_H */
diff --git a/arch/csky/include/asm/vdso/gettimeofday.h b/arch/csky/include/asm/vdso/gettimeofday.h
deleted file mode 100644
index 6c4f1446944f94dc3f02a193260998231edea566..0000000000000000000000000000000000000000
--- a/arch/csky/include/asm/vdso/gettimeofday.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef __ASM_VDSO_CSKY_GETTIMEOFDAY_H
-#define __ASM_VDSO_CSKY_GETTIMEOFDAY_H
-
-#ifndef __ASSEMBLY__
-
-#include <asm/barrier.h>
-#include <asm/unistd.h>
-#include <abi/regdef.h>
-#include <uapi/linux/time.h>
-
-#define VDSO_HAS_CLOCK_GETRES 1
-
-static __always_inline
-int gettimeofday_fallback(struct __kernel_old_timeval *_tv,
- struct timezone *_tz)
-{
- register struct __kernel_old_timeval *tv asm("a0") = _tv;
- register struct timezone *tz asm("a1") = _tz;
- register long ret asm("a0");
- register long nr asm(syscallid) = __NR_gettimeofday;
-
- asm volatile ("trap 0\n"
- : "=r" (ret)
- : "r"(tv), "r"(tz), "r"(nr)
- : "memory");
-
- return ret;
-}
-
-static __always_inline
-long clock_gettime_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
-{
- register clockid_t clkid asm("a0") = _clkid;
- register struct __kernel_timespec *ts asm("a1") = _ts;
- register long ret asm("a0");
- register long nr asm(syscallid) = __NR_clock_gettime64;
-
- asm volatile ("trap 0\n"
- : "=r" (ret)
- : "r"(clkid), "r"(ts), "r"(nr)
- : "memory");
-
- return ret;
-}
-
-static __always_inline
-long clock_gettime32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
-{
- register clockid_t clkid asm("a0") = _clkid;
- register struct old_timespec32 *ts asm("a1") = _ts;
- register long ret asm("a0");
- register long nr asm(syscallid) = __NR_clock_gettime;
-
- asm volatile ("trap 0\n"
- : "=r" (ret)
- : "r"(clkid), "r"(ts), "r"(nr)
- : "memory");
-
- return ret;
-}
-
-static __always_inline
-int clock_getres_fallback(clockid_t _clkid, struct __kernel_timespec *_ts)
-{
- register clockid_t clkid asm("a0") = _clkid;
- register struct __kernel_timespec *ts asm("a1") = _ts;
- register long ret asm("a0");
- register long nr asm(syscallid) = __NR_clock_getres_time64;
-
- asm volatile ("trap 0\n"
- : "=r" (ret)
- : "r"(clkid), "r"(ts), "r"(nr)
- : "memory");
-
- return ret;
-}
-
-static __always_inline
-int clock_getres32_fallback(clockid_t _clkid, struct old_timespec32 *_ts)
-{
- register clockid_t clkid asm("a0") = _clkid;
- register struct old_timespec32 *ts asm("a1") = _ts;
- register long ret asm("a0");
- register long nr asm(syscallid) = __NR_clock_getres;
-
- asm volatile ("trap 0\n"
- : "=r" (ret)
- : "r"(clkid), "r"(ts), "r"(nr)
- : "memory");
-
- return ret;
-}
-
-uint64_t csky_pmu_read_cc(void);
-static __always_inline u64 __arch_get_hw_counter(s32 clock_mode,
- const struct vdso_data *vd)
-{
-#ifdef CONFIG_CSKY_PMU_V1
- return csky_pmu_read_cc();
-#else
- return 0;
-#endif
-}
-
-static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
-{
- return _vdso_data;
-}
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* __ASM_VDSO_CSKY_GETTIMEOFDAY_H */
diff --git a/arch/csky/include/asm/vdso/processor.h b/arch/csky/include/asm/vdso/processor.h
deleted file mode 100644
index 39a6b561d0cc846cfb39a962c17e46104ae04807..0000000000000000000000000000000000000000
--- a/arch/csky/include/asm/vdso/processor.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#ifndef __ASM_VDSO_CSKY_PROCESSOR_H
-#define __ASM_VDSO_CSKY_PROCESSOR_H
-
-#ifndef __ASSEMBLY__
-
-#define cpu_relax() barrier()
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __ASM_VDSO_CSKY_PROCESSOR_H */
diff --git a/arch/csky/include/asm/vdso/vsyscall.h b/arch/csky/include/asm/vdso/vsyscall.h
deleted file mode 100644
index c276211a7c4d56c48c0330e309c6e5a5c5c09dc9..0000000000000000000000000000000000000000
--- a/arch/csky/include/asm/vdso/vsyscall.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef __ASM_VDSO_CSKY_VSYSCALL_H
-#define __ASM_VDSO_CSKY_VSYSCALL_H
-
-#ifndef __ASSEMBLY__
-
-#include <vdso/datapage.h>
-
-extern struct vdso_data *vdso_data;
-
-static __always_inline struct vdso_data *__csky_get_k_vdso_data(void)
-{
- return vdso_data;
-}
-#define __arch_get_k_vdso_data __csky_get_k_vdso_data
-
-#include <asm-generic/vdso/vsyscall.h>
-
-#endif /* !__ASSEMBLY__ */
-
-#endif /* __ASM_VDSO_CSKY_VSYSCALL_H */
diff --git a/arch/csky/kernel/vdso.c b/arch/csky/kernel/vdso.c
index 5c9ef63c29f1d92570dbeba1249f04c267c5ff49..92ab8ac6a5960e30b660530ae9b10137d5872369 100644
--- a/arch/csky/kernel/vdso.c
+++ b/arch/csky/kernel/vdso.c
@@ -8,23 +8,19 @@
#include <linux/slab.h>
#include <asm/page.h>
-#include <vdso/datapage.h>
extern char vdso_start[], vdso_end[];
static unsigned int vdso_pages;
static struct page **vdso_pagelist;
-static union vdso_data_store vdso_data_store __page_aligned_data;
-struct vdso_data *vdso_data = vdso_data_store.data;
-
static int __init vdso_init(void)
{
unsigned int i;
vdso_pages = (vdso_end - vdso_start) >> PAGE_SHIFT;
vdso_pagelist =
- kcalloc(vdso_pages + 1, sizeof(struct page *), GFP_KERNEL);
+ kcalloc(vdso_pages, sizeof(struct page *), GFP_KERNEL);
if (unlikely(vdso_pagelist == NULL)) {
pr_err("vdso: pagelist allocation failed\n");
return -ENOMEM;
@@ -36,7 +32,6 @@ static int __init vdso_init(void)
pg = virt_to_page(vdso_start + (i << PAGE_SHIFT));
vdso_pagelist[i] = pg;
}
- vdso_pagelist[i] = virt_to_page(vdso_data);
return 0;
}
@@ -52,11 +47,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
static struct vm_special_mapping vdso_mapping = {
.name = "[vdso]",
};
- static struct vm_special_mapping vvar_mapping = {
- .name = "[vvar]",
- };
- vdso_len = (vdso_pages + 1) << PAGE_SHIFT;
+ vdso_len = vdso_pages << PAGE_SHIFT;
mmap_write_lock(mm);
vdso_base = get_unmapped_area(NULL, 0, vdso_len, 0, 0);
@@ -85,15 +77,6 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
}
vdso_base += (vdso_pages << PAGE_SHIFT);
- vvar_mapping.pages = &vdso_pagelist[vdso_pages];
- vma = _install_special_mapping(mm, vdso_base, PAGE_SIZE,
- (VM_READ | VM_MAYREAD), &vvar_mapping);
-
- if (IS_ERR(vma)) {
- ret = PTR_ERR(vma);
- mm->context.vdso = NULL;
- goto end;
- }
ret = 0;
end:
mmap_write_unlock(mm);
@@ -104,8 +87,5 @@ const char *arch_vma_name(struct vm_area_struct *vma)
{
if (vma->vm_mm && (vma->vm_start == (long)vma->vm_mm->context.vdso))
return "[vdso]";
- if (vma->vm_mm && (vma->vm_start ==
- (long)vma->vm_mm->context.vdso + PAGE_SIZE))
- return "[vdso_data]";
return NULL;
}
diff --git a/arch/csky/kernel/vdso/Makefile b/arch/csky/kernel/vdso/Makefile
index bc2261f5a8d4393d96c6b459730b0e37ce20ad4e..069ef0b17fe5235918a6aa13aa120857bbbf3faf 100644
--- a/arch/csky/kernel/vdso/Makefile
+++ b/arch/csky/kernel/vdso/Makefile
@@ -5,7 +5,6 @@ include $(srctree)/lib/vdso/Makefile
# Symbols present in the vdso
vdso-syms += rt_sigreturn
-vdso-syms += vgettimeofday
# Files to link into the vdso
obj-vdso = $(patsubst %, %.o, $(vdso-syms)) note.o
diff --git a/arch/csky/kernel/vdso/vdso.lds.S b/arch/csky/kernel/vdso/vdso.lds.S
index 590a6c79fff7d78dc22be83cc9fec113a2ff3bd5..8d226252d4394e4e2aed1cb7444b329c75eca386 100644
--- a/arch/csky/kernel/vdso/vdso.lds.S
+++ b/arch/csky/kernel/vdso/vdso.lds.S
@@ -49,10 +49,6 @@ VERSION
LINUX_5.10 {
global:
__vdso_rt_sigreturn;
- __vdso_clock_gettime;
- __vdso_clock_gettime64;
- __vdso_gettimeofday;
- __vdso_clock_getres;
local: *;
};
}
diff --git a/arch/csky/kernel/vdso/vgettimeofday.c b/arch/csky/kernel/vdso/vgettimeofday.c
deleted file mode 100644
index 55af30e8375288a52ac96d938feb496adc9cd7c6..0000000000000000000000000000000000000000
--- a/arch/csky/kernel/vdso/vgettimeofday.c
+++ /dev/null
@@ -1,30 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-
-#include <linux/time.h>
-#include <linux/types.h>
-#include <vdso/gettime.h>
-
-extern
-int __vdso_clock_gettime(clockid_t clock,
- struct old_timespec32 *ts)
-{
- return __cvdso_clock_gettime32(clock, ts);
-}
-
-int __vdso_clock_gettime64(clockid_t clock,
- struct __kernel_timespec *ts)
-{
- return __cvdso_clock_gettime(clock, ts);
-}
-
-int __vdso_gettimeofday(struct __kernel_old_timeval *tv,
- struct timezone *tz)
-{
- return __cvdso_gettimeofday(tv, tz);
-}
-
-int __vdso_clock_getres(clockid_t clock_id,
- struct old_timespec32 *res)
-{
- return __cvdso_clock_getres_time32(clock_id, res);
-}
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 02/28] csky/vdso: Remove arch_vma_name()
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 01/28] csky/vdso: Remove gettimeofday() and friends from VDSO Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 03/28] s390/vdso: Drop LBASE_VDSO Thomas Weißschuh
` (27 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
All callers of arch_vma_name() also get the name via vm_ops, which for
these VMAs will use the name from 'struct vma_special_mapping'.
Therefore the custom implementation is unnecessary and can be removed in
favor of the default implementation from kernel/signal.c.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/csky/kernel/vdso.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/arch/csky/kernel/vdso.c b/arch/csky/kernel/vdso.c
index 92ab8ac6a5960e30b660530ae9b10137d5872369..c54d019d66bcaf8ac4633067076679d83b67a8f8 100644
--- a/arch/csky/kernel/vdso.c
+++ b/arch/csky/kernel/vdso.c
@@ -82,10 +82,3 @@ int arch_setup_additional_pages(struct linux_binprm *bprm,
mmap_write_unlock(mm);
return ret;
}
-
-const char *arch_vma_name(struct vm_area_struct *vma)
-{
- if (vma->vm_mm && (vma->vm_start == (long)vma->vm_mm->context.vdso))
- return "[vdso]";
- return NULL;
-}
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 03/28] s390/vdso: Drop LBASE_VDSO
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 01/28] csky/vdso: Remove gettimeofday() and friends from VDSO Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 02/28] csky/vdso: Remove arch_vma_name() Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:54 ` Heiko Carstens
2024-10-10 7:01 ` [PATCH 04/28] arm64: vdso: " Thomas Weißschuh
` (26 subsequent siblings)
29 siblings, 1 reply; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
This constant is always "0", providing no value and making the logic
harder to understand.
Also prepare for a consolidation of the vdso linkerscript logic by
aligning it with other architectures.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/s390/include/asm/vdso.h | 3 ---
arch/s390/kernel/vdso32/vdso32.lds.S | 2 +-
arch/s390/kernel/vdso64/vdso64.lds.S | 2 +-
3 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h
index 91061f0279be4521a2b5470bcf8de6780b7d6806..92c73e4d97a93a90cb640d44fca9856f93e0be14 100644
--- a/arch/s390/include/asm/vdso.h
+++ b/arch/s390/include/asm/vdso.h
@@ -12,9 +12,6 @@ int vdso_getcpu_init(void);
#endif /* __ASSEMBLY__ */
-/* Default link address for the vDSO */
-#define VDSO_LBASE 0
-
#define __VVAR_PAGES 2
#define VDSO_VERSION_STRING LINUX_2.6.29
diff --git a/arch/s390/kernel/vdso32/vdso32.lds.S b/arch/s390/kernel/vdso32/vdso32.lds.S
index 65b9513a5a0ee2a7e3508a1d919f826c4b4184ca..c916c4f73f766ebcc9328b189e46015e67393b0d 100644
--- a/arch/s390/kernel/vdso32/vdso32.lds.S
+++ b/arch/s390/kernel/vdso32/vdso32.lds.S
@@ -16,7 +16,7 @@ SECTIONS
#ifdef CONFIG_TIME_NS
PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
#endif
- . = VDSO_LBASE + SIZEOF_HEADERS;
+ . = SIZEOF_HEADERS;
.hash : { *(.hash) } :text
.gnu.hash : { *(.gnu.hash) }
diff --git a/arch/s390/kernel/vdso64/vdso64.lds.S b/arch/s390/kernel/vdso64/vdso64.lds.S
index 753040a4b5ab271c432d4abcaa04d69a88d54b17..ec42b7d9cb53094b783c6b0492962af7e5027831 100644
--- a/arch/s390/kernel/vdso64/vdso64.lds.S
+++ b/arch/s390/kernel/vdso64/vdso64.lds.S
@@ -18,7 +18,7 @@ SECTIONS
#ifdef CONFIG_TIME_NS
PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
#endif
- . = VDSO_LBASE + SIZEOF_HEADERS;
+ . = SIZEOF_HEADERS;
.hash : { *(.hash) } :text
.gnu.hash : { *(.gnu.hash) }
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 04/28] arm64: vdso: Drop LBASE_VDSO
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (2 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 03/28] s390/vdso: Drop LBASE_VDSO Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-28 18:01 ` Will Deacon
2024-10-10 7:01 ` [PATCH 05/28] arm64: vdso: Use only one single vvar mapping Thomas Weißschuh
` (25 subsequent siblings)
29 siblings, 1 reply; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
This constant is always "0", providing no value and making the logic
harder to understand.
Also prepare for a consolidation of the vdso linkerscript logic by
aligning it with other architectures.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/arm64/include/asm/vdso.h | 9 +--------
arch/arm64/kernel/vdso/vdso.lds.S | 2 +-
arch/arm64/kernel/vdso32/vdso.lds.S | 2 +-
3 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/arch/arm64/include/asm/vdso.h b/arch/arm64/include/asm/vdso.h
index 4305995c8f82f416e6ce11280ac1dd19fbe25eec..3e3c3fdb184274abd20647335b19e81e709506db 100644
--- a/arch/arm64/include/asm/vdso.h
+++ b/arch/arm64/include/asm/vdso.h
@@ -5,13 +5,6 @@
#ifndef __ASM_VDSO_H
#define __ASM_VDSO_H
-/*
- * Default link address for the vDSO.
- * Since we randomise the VDSO mapping, there's little point in trying
- * to prelink this.
- */
-#define VDSO_LBASE 0x0
-
#define __VVAR_PAGES 2
#ifndef __ASSEMBLY__
@@ -20,7 +13,7 @@
#define VDSO_SYMBOL(base, name) \
({ \
- (void *)(vdso_offset_##name - VDSO_LBASE + (unsigned long)(base)); \
+ (void *)(vdso_offset_##name + (unsigned long)(base)); \
})
extern char vdso_start[], vdso_end[];
diff --git a/arch/arm64/kernel/vdso/vdso.lds.S b/arch/arm64/kernel/vdso/vdso.lds.S
index f204a9ddc83359fcbe87f24171389bb64e7adceb..4ec32e86a8da22d5e2315e55ae2e86ec8e7f5f9a 100644
--- a/arch/arm64/kernel/vdso/vdso.lds.S
+++ b/arch/arm64/kernel/vdso/vdso.lds.S
@@ -25,7 +25,7 @@ SECTIONS
#ifdef CONFIG_TIME_NS
PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
#endif
- . = VDSO_LBASE + SIZEOF_HEADERS;
+ . = SIZEOF_HEADERS;
.hash : { *(.hash) } :text
.gnu.hash : { *(.gnu.hash) }
diff --git a/arch/arm64/kernel/vdso32/vdso.lds.S b/arch/arm64/kernel/vdso32/vdso.lds.S
index 8d95d7d35057d27835dcd0643bb6a40adfcd8d5b..732702a187e9e8b62972ee0aad75c23568e5e779 100644
--- a/arch/arm64/kernel/vdso32/vdso.lds.S
+++ b/arch/arm64/kernel/vdso32/vdso.lds.S
@@ -22,7 +22,7 @@ SECTIONS
#ifdef CONFIG_TIME_NS
PROVIDE_HIDDEN(_timens_data = _vdso_data + PAGE_SIZE);
#endif
- . = VDSO_LBASE + SIZEOF_HEADERS;
+ . = SIZEOF_HEADERS;
.hash : { *(.hash) } :text
.gnu.hash : { *(.gnu.hash) }
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 05/28] arm64: vdso: Use only one single vvar mapping
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (3 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 04/28] arm64: vdso: " Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-28 18:39 ` Will Deacon
2024-10-10 7:01 ` [PATCH 06/28] riscv: " Thomas Weißschuh
` (24 subsequent siblings)
29 siblings, 1 reply; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The vvar mapping is the same for all processes. Use a single mapping to
simplify the logic and align it with the other architectures.
In addition this will enable the move of the vvar handling into generic code.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/arm64/kernel/vdso.c | 43 +++++++++++++------------------------------
1 file changed, 13 insertions(+), 30 deletions(-)
diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
index 706c9c3a7a50a4574e77da296e9c83e1e2a9f5ab..2d7f8502953bbcf5c9d32f970d92fed71894b5a9 100644
--- a/arch/arm64/kernel/vdso.c
+++ b/arch/arm64/kernel/vdso.c
@@ -39,8 +39,6 @@ struct vdso_abi_info {
const char *vdso_code_start;
const char *vdso_code_end;
unsigned long vdso_pages;
- /* Data Mapping */
- struct vm_special_mapping *dm;
/* Code Mapping */
struct vm_special_mapping *cm;
};
@@ -113,6 +111,8 @@ struct vdso_data *arch_get_vdso_data(void *vvar_page)
return (struct vdso_data *)(vvar_page);
}
+static const struct vm_special_mapping vvar_map;
+
/*
* The vvar mapping contains data for a specific time namespace, so when a task
* changes namespace we must unmap its vvar data for the old namespace.
@@ -129,12 +129,8 @@ int vdso_join_timens(struct task_struct *task, struct time_namespace *ns)
mmap_read_lock(mm);
for_each_vma(vmi, vma) {
- if (vma_is_special_mapping(vma, vdso_info[VDSO_ABI_AA64].dm))
- zap_vma_pages(vma);
-#ifdef CONFIG_COMPAT_VDSO
- if (vma_is_special_mapping(vma, vdso_info[VDSO_ABI_AA32].dm))
+ if (vma_is_special_mapping(vma, &vvar_map))
zap_vma_pages(vma);
-#endif
}
mmap_read_unlock(mm);
@@ -176,6 +172,11 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm,
return vmf_insert_pfn(vma, vmf->address, pfn);
}
+static const struct vm_special_mapping vvar_map = {
+ .name = "[vvar]",
+ .fault = vvar_fault,
+};
+
static int __setup_additional_pages(enum vdso_abi abi,
struct mm_struct *mm,
struct linux_binprm *bprm,
@@ -199,7 +200,7 @@ static int __setup_additional_pages(enum vdso_abi abi,
ret = _install_special_mapping(mm, vdso_base, VVAR_NR_PAGES * PAGE_SIZE,
VM_READ|VM_MAYREAD|VM_PFNMAP,
- vdso_info[abi].dm);
+ &vvar_map);
if (IS_ERR(ret))
goto up_fail;
@@ -229,7 +230,6 @@ static int __setup_additional_pages(enum vdso_abi abi,
enum aarch32_map {
AA32_MAP_VECTORS, /* kuser helpers */
AA32_MAP_SIGPAGE,
- AA32_MAP_VVAR,
AA32_MAP_VDSO,
};
@@ -254,10 +254,6 @@ static struct vm_special_mapping aarch32_vdso_maps[] = {
.pages = &aarch32_sig_page,
.mremap = aarch32_sigpage_mremap,
},
- [AA32_MAP_VVAR] = {
- .name = "[vvar]",
- .fault = vvar_fault,
- },
[AA32_MAP_VDSO] = {
.name = "[vdso]",
.mremap = vdso_mremap,
@@ -307,7 +303,6 @@ static int __init __aarch32_alloc_vdso_pages(void)
if (!IS_ENABLED(CONFIG_COMPAT_VDSO))
return 0;
- vdso_info[VDSO_ABI_AA32].dm = &aarch32_vdso_maps[AA32_MAP_VVAR];
vdso_info[VDSO_ABI_AA32].cm = &aarch32_vdso_maps[AA32_MAP_VDSO];
return __vdso_init(VDSO_ABI_AA32);
@@ -402,26 +397,14 @@ int aarch32_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
}
#endif /* CONFIG_COMPAT */
-enum aarch64_map {
- AA64_MAP_VVAR,
- AA64_MAP_VDSO,
-};
-
-static struct vm_special_mapping aarch64_vdso_maps[] __ro_after_init = {
- [AA64_MAP_VVAR] = {
- .name = "[vvar]",
- .fault = vvar_fault,
- },
- [AA64_MAP_VDSO] = {
- .name = "[vdso]",
- .mremap = vdso_mremap,
- },
+static struct vm_special_mapping aarch64_vdso_map __ro_after_init = {
+ .name = "[vdso]",
+ .mremap = vdso_mremap,
};
static int __init vdso_init(void)
{
- vdso_info[VDSO_ABI_AA64].dm = &aarch64_vdso_maps[AA64_MAP_VVAR];
- vdso_info[VDSO_ABI_AA64].cm = &aarch64_vdso_maps[AA64_MAP_VDSO];
+ vdso_info[VDSO_ABI_AA64].cm = &aarch64_vdso_map;
return __vdso_init(VDSO_ABI_AA64);
}
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 06/28] riscv: vdso: Use only one single vvar mapping
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (4 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 05/28] arm64: vdso: Use only one single vvar mapping Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 07/28] arm: vdso: Remove assembly for datapage access Thomas Weißschuh
` (23 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The vvar mapping is the same for all processes. Use a single mapping to
simplify the logic and align it with the other architectures.
In addition this will enable the move of the vvar handling into generic code.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/riscv/kernel/vdso.c | 52 ++++++++++++++++--------------------------------
1 file changed, 17 insertions(+), 35 deletions(-)
diff --git a/arch/riscv/kernel/vdso.c b/arch/riscv/kernel/vdso.c
index 98315b98256df412d48479c0114b5a5b49a7b583..3ca3ae4277e187e790a8bf513a9e80d8b6290bb2 100644
--- a/arch/riscv/kernel/vdso.c
+++ b/arch/riscv/kernel/vdso.c
@@ -23,11 +23,6 @@ enum vvar_pages {
VVAR_NR_PAGES,
};
-enum rv_vdso_map {
- RV_VDSO_MAP_VVAR,
- RV_VDSO_MAP_VDSO,
-};
-
#define VVAR_SIZE (VVAR_NR_PAGES << PAGE_SHIFT)
static union vdso_data_store vdso_data_store __page_aligned_data;
@@ -38,8 +33,6 @@ struct __vdso_info {
const char *vdso_code_start;
const char *vdso_code_end;
unsigned long vdso_pages;
- /* Data Mapping */
- struct vm_special_mapping *dm;
/* Code Mapping */
struct vm_special_mapping *cm;
};
@@ -92,6 +85,8 @@ struct vdso_data *arch_get_vdso_data(void *vvar_page)
return (struct vdso_data *)(vvar_page);
}
+static const struct vm_special_mapping rv_vvar_map;
+
/*
* The vvar mapping contains data for a specific time namespace, so when a task
* changes namespace we must unmap its vvar data for the old namespace.
@@ -108,12 +103,8 @@ int vdso_join_timens(struct task_struct *task, struct time_namespace *ns)
mmap_read_lock(mm);
for_each_vma(vmi, vma) {
- if (vma_is_special_mapping(vma, vdso_info.dm))
- zap_vma_pages(vma);
-#ifdef CONFIG_COMPAT
- if (vma_is_special_mapping(vma, compat_vdso_info.dm))
+ if (vma_is_special_mapping(vma, &rv_vvar_map))
zap_vma_pages(vma);
-#endif
}
mmap_read_unlock(mm);
@@ -155,43 +146,34 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm,
return vmf_insert_pfn(vma, vmf->address, pfn);
}
-static struct vm_special_mapping rv_vdso_maps[] __ro_after_init = {
- [RV_VDSO_MAP_VVAR] = {
- .name = "[vvar]",
- .fault = vvar_fault,
- },
- [RV_VDSO_MAP_VDSO] = {
- .name = "[vdso]",
- .mremap = vdso_mremap,
- },
+static const struct vm_special_mapping rv_vvar_map = {
+ .name = "[vvar]",
+ .fault = vvar_fault,
+};
+
+static struct vm_special_mapping rv_vdso_map __ro_after_init = {
+ .name = "[vdso]",
+ .mremap = vdso_mremap,
};
static struct __vdso_info vdso_info __ro_after_init = {
.name = "vdso",
.vdso_code_start = vdso_start,
.vdso_code_end = vdso_end,
- .dm = &rv_vdso_maps[RV_VDSO_MAP_VVAR],
- .cm = &rv_vdso_maps[RV_VDSO_MAP_VDSO],
+ .cm = &rv_vdso_map,
};
#ifdef CONFIG_COMPAT
-static struct vm_special_mapping rv_compat_vdso_maps[] __ro_after_init = {
- [RV_VDSO_MAP_VVAR] = {
- .name = "[vvar]",
- .fault = vvar_fault,
- },
- [RV_VDSO_MAP_VDSO] = {
- .name = "[vdso]",
- .mremap = vdso_mremap,
- },
+static struct vm_special_mapping rv_compat_vdso_map __ro_after_init = {
+ .name = "[vdso]",
+ .mremap = vdso_mremap,
};
static struct __vdso_info compat_vdso_info __ro_after_init = {
.name = "compat_vdso",
.vdso_code_start = compat_vdso_start,
.vdso_code_end = compat_vdso_end,
- .dm = &rv_compat_vdso_maps[RV_VDSO_MAP_VVAR],
- .cm = &rv_compat_vdso_maps[RV_VDSO_MAP_VDSO],
+ .cm = &rv_compat_vdso_map,
};
#endif
@@ -227,7 +209,7 @@ static int __setup_additional_pages(struct mm_struct *mm,
}
ret = _install_special_mapping(mm, vdso_base, VVAR_SIZE,
- (VM_READ | VM_MAYREAD | VM_PFNMAP), vdso_info->dm);
+ (VM_READ | VM_MAYREAD | VM_PFNMAP), &rv_vvar_map);
if (IS_ERR(ret))
goto up_fail;
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 07/28] arm: vdso: Remove assembly for datapage access
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (5 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 06/28] riscv: " Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 08/28] LoongArch: vDSO: Use vdso/datapage.h to access vDSO data Thomas Weißschuh
` (22 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
vdso/datapage.h provides a hidden declaration for _vdso_data.
When using it the compiler will automatically generate PC-relative
accesses which avoids the need for a custom assembly-based accessor.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
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 ++-
4 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/arch/arm/include/asm/vdso/gettimeofday.h b/arch/arm/include/asm/vdso/gettimeofday.h
index 2134cbd5469feef020ef30494b667b93972f9fac..592d3d015ca7298b3bc35871387dbb3e7f819827 100644
--- a/arch/arm/include/asm/vdso/gettimeofday.h
+++ b/arch/arm/include/asm/vdso/gettimeofday.h
@@ -15,8 +15,6 @@
#define VDSO_HAS_CLOCK_GETRES 1
-extern struct vdso_data *__get_datapage(void);
-
static __always_inline int gettimeofday_fallback(
struct __kernel_old_timeval *_tv,
struct timezone *_tz)
@@ -139,7 +137,7 @@ static __always_inline u64 __arch_get_hw_counter(int clock_mode,
static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
{
- return __get_datapage();
+ return _vdso_data;
}
#endif /* !__ASSEMBLY__ */
diff --git a/arch/arm/vdso/Makefile b/arch/arm/vdso/Makefile
index 01067a2bc43b74cc3a4c071b4a0fbeb0933e9ff7..8a306bbec4a0c4d4b6580fe88187faf9f5422eed 100644
--- a/arch/arm/vdso/Makefile
+++ b/arch/arm/vdso/Makefile
@@ -5,7 +5,7 @@ include $(srctree)/lib/vdso/Makefile
hostprogs := vdsomunge
-obj-vdso := vgettimeofday.o datapage.o note.o
+obj-vdso := vgettimeofday.o note.o
# Build rules
targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.so.raw vdso.lds
diff --git a/arch/arm/vdso/datapage.S b/arch/arm/vdso/datapage.S
deleted file mode 100644
index 9cd73b725d9fb89c2b9bb1d1178cce705baff38b..0000000000000000000000000000000000000000
--- a/arch/arm/vdso/datapage.S
+++ /dev/null
@@ -1,16 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#include <linux/linkage.h>
-#include <asm/asm-offsets.h>
-
- .align 2
-.L_vdso_data_ptr:
- .long _start - . - VDSO_DATA_SIZE
-
-ENTRY(__get_datapage)
- .fnstart
- adr r0, .L_vdso_data_ptr
- ldr r1, [r0]
- add r0, r0, r1
- bx lr
- .fnend
-ENDPROC(__get_datapage)
diff --git a/arch/arm/vdso/vdso.lds.S b/arch/arm/vdso/vdso.lds.S
index 165d1d2eb76b3cea9b054ffa8906afdffa0eae57..9bfa0f52923c851b6b9e96d4dbb51eb3d5d0960a 100644
--- a/arch/arm/vdso/vdso.lds.S
+++ b/arch/arm/vdso/vdso.lds.S
@@ -11,6 +11,7 @@
*/
#include <linux/const.h>
+#include <asm/asm-offsets.h>
#include <asm/page.h>
#include <asm/vdso.h>
@@ -19,7 +20,7 @@ OUTPUT_ARCH(arm)
SECTIONS
{
- PROVIDE(_start = .);
+ PROVIDE(_vdso_data = . - VDSO_DATA_SIZE);
. = SIZEOF_HEADERS;
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 08/28] LoongArch: vDSO: Use vdso/datapage.h to access vDSO data
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (6 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 07/28] arm: vdso: Remove assembly for datapage access Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 09/28] MIPS: vdso: Avoid name conflict around "vdso_data" Thomas Weißschuh
` (21 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
vdso/datapage.h provides symbols and functions to ease the access to
shared vDSO data from both the kernel and the vDSO.
Make use of it to simplify the current code and also prepare for further
changes unifying the vDSO data storage between architectures.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
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 +-
6 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/arch/loongarch/include/asm/vdso/getrandom.h b/arch/loongarch/include/asm/vdso/getrandom.h
index 02f36772541b7deb89aa294f13e4d539d6e6626d..e80f3c4ac7481ba7f9f5d9210fefa78c3293243b 100644
--- a/arch/loongarch/include/asm/vdso/getrandom.h
+++ b/arch/loongarch/include/asm/vdso/getrandom.h
@@ -30,8 +30,7 @@ static __always_inline ssize_t getrandom_syscall(void *_buffer, size_t _len, uns
static __always_inline const struct vdso_rng_data *__arch_get_vdso_rng_data(void)
{
- return (const struct vdso_rng_data *)(get_vdso_data() + VVAR_LOONGARCH_PAGES_START *
- PAGE_SIZE + offsetof(struct loongarch_vdso_data, rng_data));
+ return &_loongarch_data.rng_data;
}
#endif /* !__ASSEMBLY__ */
diff --git a/arch/loongarch/include/asm/vdso/gettimeofday.h b/arch/loongarch/include/asm/vdso/gettimeofday.h
index 89e6b222c2f2d1ce240198f2fbc14553d0d6b94d..7eb3f041af764d141b005f821593a358096874ba 100644
--- a/arch/loongarch/include/asm/vdso/gettimeofday.h
+++ b/arch/loongarch/include/asm/vdso/gettimeofday.h
@@ -91,14 +91,14 @@ static inline bool loongarch_vdso_hres_capable(void)
static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
{
- return (const struct vdso_data *)get_vdso_data();
+ return _vdso_data;
}
#ifdef CONFIG_TIME_NS
static __always_inline
const struct vdso_data *__arch_get_timens_vdso_data(const struct vdso_data *vd)
{
- return (const struct vdso_data *)(get_vdso_data() + VVAR_TIMENS_PAGE_OFFSET * PAGE_SIZE);
+ return _timens_data;
}
#endif
#endif /* !__ASSEMBLY__ */
diff --git a/arch/loongarch/include/asm/vdso/vdso.h b/arch/loongarch/include/asm/vdso/vdso.h
index e31ac7474513c737fcc0071d6f2554dc4d447101..1c183a9b2115a29a997ec8db0e788d87fb191dce 100644
--- a/arch/loongarch/include/asm/vdso/vdso.h
+++ b/arch/loongarch/include/asm/vdso/vdso.h
@@ -48,23 +48,7 @@ enum vvar_pages {
#define VVAR_SIZE (VVAR_NR_PAGES << PAGE_SHIFT)
-static inline unsigned long get_vdso_base(void)
-{
- unsigned long addr;
-
- __asm__(
- " la.pcrel %0, _start\n"
- : "=r" (addr)
- :
- :);
-
- return addr;
-}
-
-static inline unsigned long get_vdso_data(void)
-{
- return get_vdso_base() - VVAR_SIZE;
-}
+extern struct loongarch_vdso_data _loongarch_data __attribute__((visibility("hidden")));
#endif /* __ASSEMBLY__ */
diff --git a/arch/loongarch/kernel/asm-offsets.c b/arch/loongarch/kernel/asm-offsets.c
index bee9f7a3108f0e6f6d8251651d12df677529bda7..049c5c3e370cbb00fdaf6730f7777847c7325fb4 100644
--- a/arch/loongarch/kernel/asm-offsets.c
+++ b/arch/loongarch/kernel/asm-offsets.c
@@ -14,6 +14,7 @@
#include <asm/ptrace.h>
#include <asm/processor.h>
#include <asm/ftrace.h>
+#include <vdso/datapage.h>
static void __used output_ptreg_defines(void)
{
@@ -321,3 +322,11 @@ static void __used output_kvm_defines(void)
OFFSET(KVM_GPGD, kvm, arch.pgd);
BLANK();
}
+
+static void __used output_vdso_defines(void)
+{
+ COMMENT("LoongArch vDSO offsets.");
+
+ DEFINE(__VVAR_PAGES, VVAR_NR_PAGES);
+ BLANK();
+}
diff --git a/arch/loongarch/vdso/vdso.lds.S b/arch/loongarch/vdso/vdso.lds.S
index 6b441bde4026ea8acda969e7c3205a9350a76cd7..160cfaef2de45b1243502c7356f8a913658548fe 100644
--- a/arch/loongarch/vdso/vdso.lds.S
+++ b/arch/loongarch/vdso/vdso.lds.S
@@ -3,6 +3,8 @@
* Author: Huacai Chen <chenhuacai@loongson.cn>
* Copyright (C) 2020-2022 Loongson Technology Corporation Limited
*/
+#include <asm/page.h>
+#include <generated/asm-offsets.h>
OUTPUT_FORMAT("elf64-loongarch", "elf64-loongarch", "elf64-loongarch")
@@ -10,7 +12,11 @@ OUTPUT_ARCH(loongarch)
SECTIONS
{
- PROVIDE(_start = .);
+ PROVIDE(_vdso_data = . - __VVAR_PAGES * PAGE_SIZE);
+#ifdef CONFIG_TIME_NS
+ PROVIDE(_timens_data = _vdso_data + PAGE_SIZE);
+#endif
+ PROVIDE(_loongarch_data = _vdso_data + 2 * PAGE_SIZE);
. = SIZEOF_HEADERS;
.hash : { *(.hash) } :text
diff --git a/arch/loongarch/vdso/vgetcpu.c b/arch/loongarch/vdso/vgetcpu.c
index 9e445be39763aebc75e9e97d77b40e14a018deea..0db51258b2a7ca7e44d2eb68ea514face48393f7 100644
--- a/arch/loongarch/vdso/vgetcpu.c
+++ b/arch/loongarch/vdso/vgetcpu.c
@@ -21,7 +21,7 @@ static __always_inline int read_cpu_id(void)
static __always_inline const struct vdso_pcpu_data *get_pcpu_data(void)
{
- return (struct vdso_pcpu_data *)(get_vdso_data() + VVAR_LOONGARCH_PAGES_START * PAGE_SIZE);
+ return _loongarch_data.pdata;
}
extern
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 09/28] MIPS: vdso: Avoid name conflict around "vdso_data"
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (7 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 08/28] LoongArch: vDSO: Use vdso/datapage.h to access vDSO data Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 10/28] x86/mm/mmap: Remove arch_vma_name() Thomas Weißschuh
` (20 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The generic vdso/datapage.h declares a symbol named "vdso_data".
Avoid a conflict by renaming the identically named variable in genvdso.c.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/mips/vdso/genvdso.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/mips/vdso/genvdso.c b/arch/mips/vdso/genvdso.c
index 09e30eb4be8605581f9ea40b757dd4e576ed0c2a..d47412ea6e6736b8714f7db7e4cfe7c18bf12c04 100644
--- a/arch/mips/vdso/genvdso.c
+++ b/arch/mips/vdso/genvdso.c
@@ -270,7 +270,7 @@ int main(int argc, char **argv)
/* Write out the stripped VDSO data. */
fprintf(out_file,
- "static unsigned char vdso_data[PAGE_ALIGN(%zu)] __page_aligned_data = {\n\t",
+ "static unsigned char vdso_image_data[PAGE_ALIGN(%zu)] __page_aligned_data = {\n\t",
vdso_size);
for (i = 0; i < vdso_size; i++) {
if (!(i % 10))
@@ -286,7 +286,7 @@ int main(int argc, char **argv)
fprintf(out_file, "struct mips_vdso_image vdso_image%s%s = {\n",
(vdso_name[0]) ? "_" : "", vdso_name);
- fprintf(out_file, "\t.data = vdso_data,\n");
+ fprintf(out_file, "\t.data = vdso_image_data,\n");
fprintf(out_file, "\t.size = PAGE_ALIGN(%zu),\n", vdso_size);
fprintf(out_file, "\t.mapping = {\n");
fprintf(out_file, "\t\t.name = \"[vdso]\",\n");
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 10/28] x86/mm/mmap: Remove arch_vma_name()
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (8 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 09/28] MIPS: vdso: Avoid name conflict around "vdso_data" Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 11/28] x86: vdso: Use __arch_get_vdso_data() to access vdso data Thomas Weißschuh
` (19 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
This function does not contain any logic, delete it so the equivalent
weak definition from kernel/signal.c is used instead.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/mm/mmap.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
index a2cabb1c81e1aec2fc82339c1092bf8b8167908a..b8a6ffffb4519cd77f6a540562ef6d3efa4e7b0f 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -163,11 +163,6 @@ unsigned long get_mmap_base(int is_legacy)
return is_legacy ? mm->mmap_legacy_base : mm->mmap_base;
}
-const char *arch_vma_name(struct vm_area_struct *vma)
-{
- return NULL;
-}
-
/**
* mmap_address_hint_valid - Validate the address hint of mmap
* @addr: Address hint
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 11/28] x86: vdso: Use __arch_get_vdso_data() to access vdso data
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (9 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 10/28] x86/mm/mmap: Remove arch_vma_name() Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 12/28] x86: vdso: Place vdso_data at beginning of vvar page Thomas Weißschuh
` (18 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The implementation details of the vdso_data access will change.
Prepare for that by using the existing helper function.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/include/asm/vdso/getrandom.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/vdso/getrandom.h b/arch/x86/include/asm/vdso/getrandom.h
index ff5334ad32a0f56b2d4265fd38d9c287de3dfaa1..ecdcdbcd3392533e5619d7f09403d60a9810ceab 100644
--- a/arch/x86/include/asm/vdso/getrandom.h
+++ b/arch/x86/include/asm/vdso/getrandom.h
@@ -32,8 +32,8 @@ static __always_inline ssize_t getrandom_syscall(void *buffer, size_t len, unsig
static __always_inline const struct vdso_rng_data *__arch_get_vdso_rng_data(void)
{
- if (IS_ENABLED(CONFIG_TIME_NS) && __vdso_data->clock_mode == VDSO_CLOCKMODE_TIMENS)
- return (void *)&__vdso_rng_data + ((void *)&__timens_vdso_data - (void *)&__vdso_data);
+ if (IS_ENABLED(CONFIG_TIME_NS) && __arch_get_vdso_data()->clock_mode == VDSO_CLOCKMODE_TIMENS)
+ return (void *)&__vdso_rng_data + ((void *)&__timens_vdso_data - (void *)__arch_get_vdso_data());
return &__vdso_rng_data;
}
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 12/28] x86: vdso: Place vdso_data at beginning of vvar page
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (10 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 11/28] x86: vdso: Use __arch_get_vdso_data() to access vdso data Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 13/28] x86: vdso: Access rng data from kernel without vvar Thomas Weißschuh
` (17 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The offset of the vdso_data only has historic reasons, as back then
other vvars also existed and offset 0 was already used.
(See commit 8c49d9a74bac ("x86-64: Clean up vdso/kernel shared variables"))
Over time most other vvars got removed and offset 0 is free again.
Moving vdso_data to the beginning of the vvar page aligns x86 with other
architectures and opens up the way for the removal of the custom x86
vvar machinery.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/include/asm/vvar.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/vvar.h b/arch/x86/include/asm/vvar.h
index 9d9af37f7cab9e3e6159c0b758e500ddcfc6b3e8..01e60e0f671e9625669dc8fdacf3cdddf8cbf4fb 100644
--- a/arch/x86/include/asm/vvar.h
+++ b/arch/x86/include/asm/vvar.h
@@ -58,7 +58,7 @@ extern char __vvar_page;
/* DECLARE_VVAR(offset, type, name) */
-DECLARE_VVAR(128, struct vdso_data, _vdso_data)
+DECLARE_VVAR(0, struct vdso_data, _vdso_data)
#if !defined(_SINGLE_DATA)
#define _SINGLE_DATA
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 13/28] x86: vdso: Access rng data from kernel without vvar
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (11 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 12/28] x86: vdso: Place vdso_data at beginning of vvar page Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 14/28] x86: vdso: Allocate vvar page from C code Thomas Weißschuh
` (16 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
Remove the usage of the vvar _vdso_rng_data from the kernel-space code,
as the x86 vvar machinery is about to be removed.
The definition of the structure is unnecessary, as the data lives in a
page pre-allocated by the linker anyways.
The vdso user-space access to the rng data will be switched soon.
DEFINE_VVAR_SINGLE() is now unused. It will be removed later togehter
with the rest of vvar.h.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/entry/vdso/vma.c | 1 -
arch/x86/include/asm/vdso/vsyscall.h | 2 +-
arch/x86/include/asm/vvar.h | 4 +++-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index b8fed8b8b9ccdb2cdd9912d5ec4cfd6366a6012e..8437906fd4b353ad0fe208d811817a1b6f8f8dcb 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -39,7 +39,6 @@ struct vdso_data *arch_get_vdso_data(void *vvar_page)
#undef EMIT_VVAR
DEFINE_VVAR(struct vdso_data, _vdso_data);
-DEFINE_VVAR_SINGLE(struct vdso_rng_data, _vdso_rng_data);
unsigned int vclocks_used __read_mostly;
diff --git a/arch/x86/include/asm/vdso/vsyscall.h b/arch/x86/include/asm/vdso/vsyscall.h
index 67fedf1698b5e2b710e0504686318949c738bf29..2cbb32a8a45e2f5c7bc02172af0fa09173f33924 100644
--- a/arch/x86/include/asm/vdso/vsyscall.h
+++ b/arch/x86/include/asm/vdso/vsyscall.h
@@ -22,7 +22,7 @@ struct vdso_data *__x86_get_k_vdso_data(void)
static __always_inline
struct vdso_rng_data *__x86_get_k_vdso_rng_data(void)
{
- return &_vdso_rng_data;
+ return (void *)&__vvar_page + __VDSO_RND_DATA_OFFSET;
}
#define __arch_get_k_vdso_rng_data __x86_get_k_vdso_rng_data
diff --git a/arch/x86/include/asm/vvar.h b/arch/x86/include/asm/vvar.h
index 01e60e0f671e9625669dc8fdacf3cdddf8cbf4fb..fe3434d3b5b1eef806e8328b86650e001b177de2 100644
--- a/arch/x86/include/asm/vvar.h
+++ b/arch/x86/include/asm/vvar.h
@@ -19,6 +19,8 @@
#ifndef _ASM_X86_VVAR_H
#define _ASM_X86_VVAR_H
+#define __VDSO_RND_DATA_OFFSET 640
+
#ifdef EMIT_VVAR
/*
* EMIT_VVAR() is used by the kernel linker script to put vvars in the
@@ -62,7 +64,7 @@ DECLARE_VVAR(0, struct vdso_data, _vdso_data)
#if !defined(_SINGLE_DATA)
#define _SINGLE_DATA
-DECLARE_VVAR_SINGLE(640, struct vdso_rng_data, _vdso_rng_data)
+DECLARE_VVAR_SINGLE(__VDSO_RND_DATA_OFFSET, struct vdso_rng_data, _vdso_rng_data)
#endif
#undef DECLARE_VVAR
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 14/28] x86: vdso: Allocate vvar page from C code
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (12 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 13/28] x86: vdso: Access rng data from kernel without vvar Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 15/28] x86: vdso: Access timens vdso data without vvar.h Thomas Weißschuh
` (15 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
Allocate the vvar page through the standard union vdso_data_store
and remove the custom linker script logic.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/entry/vdso/vma.c | 16 +++++-----------
arch/x86/include/asm/vdso/vsyscall.h | 6 ++++--
arch/x86/kernel/vmlinux.lds.S | 23 -----------------------
arch/x86/tools/relocs.c | 1 -
4 files changed, 9 insertions(+), 37 deletions(-)
diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index 8437906fd4b353ad0fe208d811817a1b6f8f8dcb..5731dc35d1d2c0b81c37adf133fc6fa35c41cba1 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -20,25 +20,19 @@
#include <asm/vgtod.h>
#include <asm/proto.h>
#include <asm/vdso.h>
-#include <asm/vvar.h>
#include <asm/tlb.h>
#include <asm/page.h>
#include <asm/desc.h>
#include <asm/cpufeature.h>
#include <clocksource/hyperv_timer.h>
-#undef _ASM_X86_VVAR_H
-#define EMIT_VVAR(name, offset) \
- const size_t name ## _offset = offset;
-#include <asm/vvar.h>
-
struct vdso_data *arch_get_vdso_data(void *vvar_page)
{
- return (struct vdso_data *)(vvar_page + _vdso_data_offset);
+ return (struct vdso_data *)vvar_page;
}
-#undef EMIT_VVAR
-DEFINE_VVAR(struct vdso_data, _vdso_data);
+static union vdso_data_store vdso_data_store __page_aligned_data;
+struct vdso_data *vdso_data = vdso_data_store.data;
unsigned int vclocks_used __read_mostly;
@@ -153,7 +147,7 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm,
if (sym_offset == image->sym_vvar_page) {
struct page *timens_page = find_timens_vvar_page(vma);
- pfn = __pa_symbol(&__vvar_page) >> PAGE_SHIFT;
+ pfn = __pa_symbol(vdso_data) >> PAGE_SHIFT;
/*
* If a task belongs to a time namespace then a namespace
@@ -200,7 +194,7 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm,
if (!timens_page)
return VM_FAULT_SIGBUS;
- pfn = __pa_symbol(&__vvar_page) >> PAGE_SHIFT;
+ pfn = __pa_symbol(vdso_data) >> PAGE_SHIFT;
return vmf_insert_pfn(vma, vmf->address, pfn);
}
diff --git a/arch/x86/include/asm/vdso/vsyscall.h b/arch/x86/include/asm/vdso/vsyscall.h
index 2cbb32a8a45e2f5c7bc02172af0fa09173f33924..5d6760746d15b0e12c7bf0eb727241e7576ca9c7 100644
--- a/arch/x86/include/asm/vdso/vsyscall.h
+++ b/arch/x86/include/asm/vdso/vsyscall.h
@@ -9,20 +9,22 @@
#include <asm/vgtod.h>
#include <asm/vvar.h>
+extern struct vdso_data *vdso_data;
+
/*
* Update the vDSO data page to keep in sync with kernel timekeeping.
*/
static __always_inline
struct vdso_data *__x86_get_k_vdso_data(void)
{
- return _vdso_data;
+ return vdso_data;
}
#define __arch_get_k_vdso_data __x86_get_k_vdso_data
static __always_inline
struct vdso_rng_data *__x86_get_k_vdso_rng_data(void)
{
- return (void *)&__vvar_page + __VDSO_RND_DATA_OFFSET;
+ return (void *)vdso_data + __VDSO_RND_DATA_OFFSET;
}
#define __arch_get_k_vdso_rng_data __x86_get_k_vdso_rng_data
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index 6726be89b7a663a1554f8f4b297bba65b4ebdf61..e7e19842736a774191142b6ce43bf5567540cb80 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -193,29 +193,6 @@ SECTIONS
ORC_UNWIND_TABLE
- . = ALIGN(PAGE_SIZE);
- __vvar_page = .;
-
- .vvar : AT(ADDR(.vvar) - LOAD_OFFSET) {
- /* work around gold bug 13023 */
- __vvar_beginning_hack = .;
-
- /* Place all vvars at the offsets in asm/vvar.h. */
-#define EMIT_VVAR(name, offset) \
- . = __vvar_beginning_hack + offset; \
- *(.vvar_ ## name)
-#include <asm/vvar.h>
-#undef EMIT_VVAR
-
- /*
- * Pad the rest of the page with zeros. Otherwise the loader
- * can leave garbage here.
- */
- . = __vvar_beginning_hack + PAGE_SIZE;
- } :data
-
- . = ALIGN(__vvar_page + PAGE_SIZE, PAGE_SIZE);
-
/* Init code and data - will be freed after init */
. = ALIGN(PAGE_SIZE);
.init.begin : AT(ADDR(.init.begin) - LOAD_OFFSET) {
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
index c101bed6194000004bd84e1679259cce9977d290..6afe2e5e9102873634c6ad9a3a0b9c66bba5da50 100644
--- a/arch/x86/tools/relocs.c
+++ b/arch/x86/tools/relocs.c
@@ -89,7 +89,6 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
"init_per_cpu__.*|"
"__end_rodata_hpage_align|"
#endif
- "__vvar_page|"
"_end)$"
};
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 15/28] x86: vdso: Access timens vdso data without vvar.h
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (13 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 14/28] x86: vdso: Allocate vvar page from C code Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 16/28] x86: vdso: Access rng " Thomas Weißschuh
` (14 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The vdso_data is at the start of the timens page.
Make use of this invariant to remove the usage of vvar.h.
This also matches the logic for the pvclock and hvclock pages.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/entry/vdso/vdso-layout.lds.S | 6 ------
arch/x86/include/asm/vdso/getrandom.h | 2 +-
arch/x86/include/asm/vdso/gettimeofday.h | 6 ++++--
3 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/arch/x86/entry/vdso/vdso-layout.lds.S b/arch/x86/entry/vdso/vdso-layout.lds.S
index bafa73f09e9285fbf29cf3f73e13b6d92df2f376..51c0cc0119748dda0f29d577197c520f272fd02f 100644
--- a/arch/x86/entry/vdso/vdso-layout.lds.S
+++ b/arch/x86/entry/vdso/vdso-layout.lds.S
@@ -28,12 +28,6 @@ SECTIONS
hvclock_page = vvar_start + 2 * PAGE_SIZE;
timens_page = vvar_start + 3 * PAGE_SIZE;
-#undef _ASM_X86_VVAR_H
- /* Place all vvars in timens too at the offsets in asm/vvar.h. */
-#define EMIT_VVAR(name, offset) timens_ ## name = timens_page + offset;
-#include <asm/vvar.h>
-#undef EMIT_VVAR
-
. = SIZEOF_HEADERS;
.hash : { *(.hash) } :text
diff --git a/arch/x86/include/asm/vdso/getrandom.h b/arch/x86/include/asm/vdso/getrandom.h
index ecdcdbcd3392533e5619d7f09403d60a9810ceab..d0713c829254cc8172c5903a1fdba168b52ff1ea 100644
--- a/arch/x86/include/asm/vdso/getrandom.h
+++ b/arch/x86/include/asm/vdso/getrandom.h
@@ -33,7 +33,7 @@ static __always_inline ssize_t getrandom_syscall(void *buffer, size_t len, unsig
static __always_inline const struct vdso_rng_data *__arch_get_vdso_rng_data(void)
{
if (IS_ENABLED(CONFIG_TIME_NS) && __arch_get_vdso_data()->clock_mode == VDSO_CLOCKMODE_TIMENS)
- return (void *)&__vdso_rng_data + ((void *)&__timens_vdso_data - (void *)__arch_get_vdso_data());
+ return (void *)&__vdso_rng_data + ((void *)&timens_page - (void *)__arch_get_vdso_data());
return &__vdso_rng_data;
}
diff --git a/arch/x86/include/asm/vdso/gettimeofday.h b/arch/x86/include/asm/vdso/gettimeofday.h
index b2d2df026f6e707b8164d8842c33edea9a658466..1e6116172a65cd07ef29092dba6241d719f07448 100644
--- a/arch/x86/include/asm/vdso/gettimeofday.h
+++ b/arch/x86/include/asm/vdso/gettimeofday.h
@@ -21,7 +21,9 @@
#include <clocksource/hyperv_timer.h>
#define __vdso_data (VVAR(_vdso_data))
-#define __timens_vdso_data (TIMENS(_vdso_data))
+
+extern struct vdso_data timens_page
+ __attribute__((visibility("hidden")));
#define VDSO_HAS_TIME 1
@@ -61,7 +63,7 @@ extern struct ms_hyperv_tsc_page hvclock_page
static __always_inline
const struct vdso_data *__arch_get_timens_vdso_data(const struct vdso_data *vd)
{
- return __timens_vdso_data;
+ return &timens_page;
}
#endif
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 16/28] x86: vdso: Access rng vdso data without vvar.h
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (14 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 15/28] x86: vdso: Access timens vdso data without vvar.h Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 17/28] x86: vdso: Move the rng offset to vsyscall.h Thomas Weißschuh
` (13 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The vdso_rng_data is at a well-known offset in the vvar page.
Make use of this invariant to remove the usage of vvar.h.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/entry/vdso/vdso-layout.lds.S | 2 ++
arch/x86/include/asm/vdso/getrandom.h | 8 ++++----
arch/x86/include/asm/vvar.h | 5 -----
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/arch/x86/entry/vdso/vdso-layout.lds.S b/arch/x86/entry/vdso/vdso-layout.lds.S
index 51c0cc0119748dda0f29d577197c520f272fd02f..acce60732e541f49dfc21d75e1b525c8a74f2341 100644
--- a/arch/x86/entry/vdso/vdso-layout.lds.S
+++ b/arch/x86/entry/vdso/vdso-layout.lds.S
@@ -24,6 +24,8 @@ SECTIONS
#include <asm/vvar.h>
#undef EMIT_VVAR
+ vdso_rng_data = vvar_page + __VDSO_RND_DATA_OFFSET;
+
pvclock_page = vvar_start + PAGE_SIZE;
hvclock_page = vvar_start + 2 * PAGE_SIZE;
timens_page = vvar_start + 3 * PAGE_SIZE;
diff --git a/arch/x86/include/asm/vdso/getrandom.h b/arch/x86/include/asm/vdso/getrandom.h
index d0713c829254cc8172c5903a1fdba168b52ff1ea..2bf9c0e970c3e7d2a2ddfcb1d007cb73da200494 100644
--- a/arch/x86/include/asm/vdso/getrandom.h
+++ b/arch/x86/include/asm/vdso/getrandom.h
@@ -8,7 +8,6 @@
#ifndef __ASSEMBLY__
#include <asm/unistd.h>
-#include <asm/vvar.h>
/**
* getrandom_syscall - Invoke the getrandom() syscall.
@@ -28,13 +27,14 @@ static __always_inline ssize_t getrandom_syscall(void *buffer, size_t len, unsig
return ret;
}
-#define __vdso_rng_data (VVAR(_vdso_rng_data))
+extern struct vdso_rng_data vdso_rng_data
+ __attribute__((visibility("hidden")));
static __always_inline const struct vdso_rng_data *__arch_get_vdso_rng_data(void)
{
if (IS_ENABLED(CONFIG_TIME_NS) && __arch_get_vdso_data()->clock_mode == VDSO_CLOCKMODE_TIMENS)
- return (void *)&__vdso_rng_data + ((void *)&timens_page - (void *)__arch_get_vdso_data());
- return &__vdso_rng_data;
+ return (void *)&vdso_rng_data + ((void *)&timens_page - (void *)__arch_get_vdso_data());
+ return &vdso_rng_data;
}
#endif /* !__ASSEMBLY__ */
diff --git a/arch/x86/include/asm/vvar.h b/arch/x86/include/asm/vvar.h
index fe3434d3b5b1eef806e8328b86650e001b177de2..b605914f4d4347c16344e5b5e063697538d4895e 100644
--- a/arch/x86/include/asm/vvar.h
+++ b/arch/x86/include/asm/vvar.h
@@ -62,11 +62,6 @@ extern char __vvar_page;
DECLARE_VVAR(0, struct vdso_data, _vdso_data)
-#if !defined(_SINGLE_DATA)
-#define _SINGLE_DATA
-DECLARE_VVAR_SINGLE(__VDSO_RND_DATA_OFFSET, struct vdso_rng_data, _vdso_rng_data)
-#endif
-
#undef DECLARE_VVAR
#undef DECLARE_VVAR_SINGLE
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 17/28] x86: vdso: Move the rng offset to vsyscall.h
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (15 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 16/28] x86: vdso: Access rng " Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 18/28] x86: vdso: Access vdso data without vvar.h Thomas Weißschuh
` (12 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
vvar.h will go away, so move the last useful bit into vsyscall.h.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/entry/vdso/vdso-layout.lds.S | 1 +
arch/x86/include/asm/vdso/vsyscall.h | 3 ++-
arch/x86/include/asm/vvar.h | 2 --
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/entry/vdso/vdso-layout.lds.S b/arch/x86/entry/vdso/vdso-layout.lds.S
index acce60732e541f49dfc21d75e1b525c8a74f2341..c7e194b6e47def3bfa681b3ec5d45cfffbe839d2 100644
--- a/arch/x86/entry/vdso/vdso-layout.lds.S
+++ b/arch/x86/entry/vdso/vdso-layout.lds.S
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 */
#include <asm/vdso.h>
+#include <asm/vdso/vsyscall.h>
/*
* Linker script for vDSO. This is an ELF shared object prelinked to
diff --git a/arch/x86/include/asm/vdso/vsyscall.h b/arch/x86/include/asm/vdso/vsyscall.h
index 5d6760746d15b0e12c7bf0eb727241e7576ca9c7..6e210e05f9f323e3e9ceca8a04d5f21fb6d04781 100644
--- a/arch/x86/include/asm/vdso/vsyscall.h
+++ b/arch/x86/include/asm/vdso/vsyscall.h
@@ -2,12 +2,13 @@
#ifndef __ASM_VDSO_VSYSCALL_H
#define __ASM_VDSO_VSYSCALL_H
+#define __VDSO_RND_DATA_OFFSET 640
+
#ifndef __ASSEMBLY__
#include <linux/timekeeper_internal.h>
#include <vdso/datapage.h>
#include <asm/vgtod.h>
-#include <asm/vvar.h>
extern struct vdso_data *vdso_data;
diff --git a/arch/x86/include/asm/vvar.h b/arch/x86/include/asm/vvar.h
index b605914f4d4347c16344e5b5e063697538d4895e..d95cf92296ef6acf66089a734465eda4cba9154c 100644
--- a/arch/x86/include/asm/vvar.h
+++ b/arch/x86/include/asm/vvar.h
@@ -19,8 +19,6 @@
#ifndef _ASM_X86_VVAR_H
#define _ASM_X86_VVAR_H
-#define __VDSO_RND_DATA_OFFSET 640
-
#ifdef EMIT_VVAR
/*
* EMIT_VVAR() is used by the kernel linker script to put vvars in the
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 18/28] x86: vdso: Access vdso data without vvar.h
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (16 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 17/28] x86: vdso: Move the rng offset to vsyscall.h Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 19/28] x86: vdso: Delete vvar.h Thomas Weißschuh
` (11 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The vdso_data is at the start of the vvar page.
Make use of this invariant to remove the usage of vvar.h.
This also matches the logic for the timens data.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/entry/vdso/vdso-layout.lds.S | 5 -----
arch/x86/include/asm/vdso/gettimeofday.h | 6 +++---
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/arch/x86/entry/vdso/vdso-layout.lds.S b/arch/x86/entry/vdso/vdso-layout.lds.S
index c7e194b6e47def3bfa681b3ec5d45cfffbe839d2..9e602c0615243f8667498ac245c2aaf1b35dcd16 100644
--- a/arch/x86/entry/vdso/vdso-layout.lds.S
+++ b/arch/x86/entry/vdso/vdso-layout.lds.S
@@ -20,11 +20,6 @@ SECTIONS
vvar_start = . - 4 * PAGE_SIZE;
vvar_page = vvar_start;
- /* Place all vvars at the offsets in asm/vvar.h. */
-#define EMIT_VVAR(name, offset) vvar_ ## name = vvar_page + offset;
-#include <asm/vvar.h>
-#undef EMIT_VVAR
-
vdso_rng_data = vvar_page + __VDSO_RND_DATA_OFFSET;
pvclock_page = vvar_start + PAGE_SIZE;
diff --git a/arch/x86/include/asm/vdso/gettimeofday.h b/arch/x86/include/asm/vdso/gettimeofday.h
index 1e6116172a65cd07ef29092dba6241d719f07448..375a34b0f365792ec108381d7c7229f8351448f7 100644
--- a/arch/x86/include/asm/vdso/gettimeofday.h
+++ b/arch/x86/include/asm/vdso/gettimeofday.h
@@ -14,13 +14,13 @@
#include <uapi/linux/time.h>
#include <asm/vgtod.h>
-#include <asm/vvar.h>
#include <asm/unistd.h>
#include <asm/msr.h>
#include <asm/pvclock.h>
#include <clocksource/hyperv_timer.h>
-#define __vdso_data (VVAR(_vdso_data))
+extern struct vdso_data vvar_page
+ __attribute__((visibility("hidden")));
extern struct vdso_data timens_page
__attribute__((visibility("hidden")));
@@ -277,7 +277,7 @@ static inline u64 __arch_get_hw_counter(s32 clock_mode,
static __always_inline const struct vdso_data *__arch_get_vdso_data(void)
{
- return __vdso_data;
+ return &vvar_page;
}
static inline bool arch_vdso_clocksource_ok(const struct vdso_data *vd)
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 19/28] x86: vdso: Delete vvar.h
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (17 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 18/28] x86: vdso: Access vdso data without vvar.h Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 20/28] x86: vdso: Split virtual clock pages into dedicated mapping Thomas Weißschuh
` (10 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
All users have been removed.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/include/asm/vvar.h | 66 ---------------------------------------------
1 file changed, 66 deletions(-)
diff --git a/arch/x86/include/asm/vvar.h b/arch/x86/include/asm/vvar.h
deleted file mode 100644
index d95cf92296ef6acf66089a734465eda4cba9154c..0000000000000000000000000000000000000000
--- a/arch/x86/include/asm/vvar.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * vvar.h: Shared vDSO/kernel variable declarations
- * Copyright (c) 2011 Andy Lutomirski
- *
- * A handful of variables are accessible (read-only) from userspace
- * code in the vsyscall page and the vdso. They are declared here.
- * Some other file must define them with DEFINE_VVAR.
- *
- * In normal kernel code, they are used like any other variable.
- * In user code, they are accessed through the VVAR macro.
- *
- * These variables live in a page of kernel data that has an extra RO
- * mapping for userspace. Each variable needs a unique offset within
- * that page; specify that offset with the DECLARE_VVAR macro. (If
- * you mess up, the linker will catch it.)
- */
-
-#ifndef _ASM_X86_VVAR_H
-#define _ASM_X86_VVAR_H
-
-#ifdef EMIT_VVAR
-/*
- * EMIT_VVAR() is used by the kernel linker script to put vvars in the
- * right place. Also, it's used by kernel code to import offsets values.
- */
-#define DECLARE_VVAR(offset, type, name) \
- EMIT_VVAR(name, offset)
-#define DECLARE_VVAR_SINGLE(offset, type, name) \
- EMIT_VVAR(name, offset)
-
-#else
-
-extern char __vvar_page;
-
-#define DECLARE_VVAR(offset, type, name) \
- extern type vvar_ ## name[CS_BASES] \
- __attribute__((visibility("hidden"))); \
- extern type timens_ ## name[CS_BASES] \
- __attribute__((visibility("hidden"))); \
-
-#define DECLARE_VVAR_SINGLE(offset, type, name) \
- extern type vvar_ ## name \
- __attribute__((visibility("hidden"))); \
-
-#define VVAR(name) (vvar_ ## name)
-#define TIMENS(name) (timens_ ## name)
-
-#define DEFINE_VVAR(type, name) \
- type name[CS_BASES] \
- __attribute__((section(".vvar_" #name), aligned(16))) __visible
-
-#define DEFINE_VVAR_SINGLE(type, name) \
- type name \
- __attribute__((section(".vvar_" #name), aligned(16))) __visible
-
-#endif
-
-/* DECLARE_VVAR(offset, type, name) */
-
-DECLARE_VVAR(0, struct vdso_data, _vdso_data)
-
-#undef DECLARE_VVAR
-#undef DECLARE_VVAR_SINGLE
-
-#endif
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 20/28] x86: vdso: Split virtual clock pages into dedicated mapping
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (18 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 19/28] x86: vdso: Delete vvar.h Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 21/28] powerpc: vdso: Remove offset comment from 32bit vdso_arch_data Thomas Weißschuh
` (9 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The generic vdso data storage can not handle the special pvclock and
hvclock pages. Split them into their own mapping, so the other vdso
storage can be migrated to the generic code.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/x86/entry/vdso/vdso-layout.lds.S | 10 +++--
arch/x86/entry/vdso/vma.c | 70 ++++++++++++++++++++++++++---------
arch/x86/include/asm/vdso/vsyscall.h | 5 +++
3 files changed, 64 insertions(+), 21 deletions(-)
diff --git a/arch/x86/entry/vdso/vdso-layout.lds.S b/arch/x86/entry/vdso/vdso-layout.lds.S
index 9e602c0615243f8667498ac245c2aaf1b35dcd16..872947c1004c35c006f7508eac7dff251c286aeb 100644
--- a/arch/x86/entry/vdso/vdso-layout.lds.S
+++ b/arch/x86/entry/vdso/vdso-layout.lds.S
@@ -17,14 +17,16 @@ SECTIONS
* segment.
*/
- vvar_start = . - 4 * PAGE_SIZE;
+ vvar_start = . - __VVAR_PAGES * PAGE_SIZE;
vvar_page = vvar_start;
vdso_rng_data = vvar_page + __VDSO_RND_DATA_OFFSET;
- pvclock_page = vvar_start + PAGE_SIZE;
- hvclock_page = vvar_start + 2 * PAGE_SIZE;
- timens_page = vvar_start + 3 * PAGE_SIZE;
+ timens_page = vvar_start + PAGE_SIZE;
+
+ vclock_pages = vvar_start + VDSO_NR_VCLOCK_PAGES * PAGE_SIZE;
+ pvclock_page = vclock_pages + VDSO_PAGE_PVCLOCK_OFFSET * PAGE_SIZE;
+ hvclock_page = vclock_pages + VDSO_PAGE_HVCLOCK_OFFSET * PAGE_SIZE;
. = SIZEOF_HEADERS;
diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c
index 5731dc35d1d2c0b81c37adf133fc6fa35c41cba1..7e5921adeed0004cba04d59caff280c082ab392e 100644
--- a/arch/x86/entry/vdso/vma.c
+++ b/arch/x86/entry/vdso/vma.c
@@ -24,6 +24,7 @@
#include <asm/page.h>
#include <asm/desc.h>
#include <asm/cpufeature.h>
+#include <asm/vdso/vsyscall.h>
#include <clocksource/hyperv_timer.h>
struct vdso_data *arch_get_vdso_data(void *vvar_page)
@@ -175,19 +176,7 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm,
}
return vmf_insert_pfn(vma, vmf->address, pfn);
- } else if (sym_offset == image->sym_pvclock_page) {
- struct pvclock_vsyscall_time_info *pvti =
- pvclock_get_pvti_cpu0_va();
- if (pvti && vclock_was_used(VDSO_CLOCKMODE_PVCLOCK)) {
- return vmf_insert_pfn_prot(vma, vmf->address,
- __pa(pvti) >> PAGE_SHIFT,
- pgprot_decrypted(vma->vm_page_prot));
- }
- } else if (sym_offset == image->sym_hvclock_page) {
- pfn = hv_get_tsc_pfn();
- if (pfn && vclock_was_used(VDSO_CLOCKMODE_HVCLOCK))
- return vmf_insert_pfn(vma, vmf->address, pfn);
} else if (sym_offset == image->sym_timens_page) {
struct page *timens_page = find_timens_vvar_page(vma);
@@ -201,6 +190,33 @@ static vm_fault_t vvar_fault(const struct vm_special_mapping *sm,
return VM_FAULT_SIGBUS;
}
+static vm_fault_t vvar_vclock_fault(const struct vm_special_mapping *sm,
+ struct vm_area_struct *vma, struct vm_fault *vmf)
+{
+ switch (vmf->pgoff) {
+#ifdef CONFIG_PARAVIRT_CLOCK
+ case VDSO_PAGE_PVCLOCK_OFFSET:
+ struct pvclock_vsyscall_time_info *pvti =
+ pvclock_get_pvti_cpu0_va();
+ if (pvti && vclock_was_used(VDSO_CLOCKMODE_PVCLOCK))
+ return vmf_insert_pfn_prot(vma, vmf->address,
+ __pa(pvti) >> PAGE_SHIFT,
+ pgprot_decrypted(vma->vm_page_prot));
+ break;
+#endif /* CONFIG_PARAVIRT_CLOCK */
+#ifdef CONFIG_HYPERV_TIMER
+ case VDSO_PAGE_HVCLOCK_OFFSET:
+ unsigned long pfn = hv_get_tsc_pfn();
+
+ if (pfn && vclock_was_used(VDSO_CLOCKMODE_HVCLOCK))
+ return vmf_insert_pfn(vma, vmf->address, pfn);
+ break;
+#endif /* CONFIG_HYPERV_TIMER */
+ }
+
+ return VM_FAULT_SIGBUS;
+}
+
static const struct vm_special_mapping vdso_mapping = {
.name = "[vdso]",
.fault = vdso_fault,
@@ -210,6 +226,10 @@ static const struct vm_special_mapping vvar_mapping = {
.name = "[vvar]",
.fault = vvar_fault,
};
+static const struct vm_special_mapping vvar_vclock_mapping = {
+ .name = "[vvar_vclock]",
+ .fault = vvar_vclock_fault,
+};
/*
* Add vdso and vvar mappings to current process.
@@ -252,7 +272,7 @@ static int map_vdso(const struct vdso_image *image, unsigned long addr)
vma = _install_special_mapping(mm,
addr,
- -image->sym_vvar_start,
+ (__VVAR_PAGES - VDSO_NR_VCLOCK_PAGES) * PAGE_SIZE,
VM_READ|VM_MAYREAD|VM_IO|VM_DONTDUMP|
VM_PFNMAP,
&vvar_mapping);
@@ -260,11 +280,26 @@ static int map_vdso(const struct vdso_image *image, unsigned long addr)
if (IS_ERR(vma)) {
ret = PTR_ERR(vma);
do_munmap(mm, text_start, image->size, NULL);
- } else {
- current->mm->context.vdso = (void __user *)text_start;
- current->mm->context.vdso_image = image;
+ goto up_fail;
}
+ vma = _install_special_mapping(mm,
+ addr + (__VVAR_PAGES - VDSO_NR_VCLOCK_PAGES) * PAGE_SIZE,
+ VDSO_NR_VCLOCK_PAGES * PAGE_SIZE,
+ VM_READ|VM_MAYREAD|VM_IO|VM_DONTDUMP|
+ VM_PFNMAP,
+ &vvar_vclock_mapping);
+
+ if (IS_ERR(vma)) {
+ ret = PTR_ERR(vma);
+ do_munmap(mm, text_start, image->size, NULL);
+ do_munmap(mm, addr, image->size, NULL);
+ goto up_fail;
+ }
+
+ current->mm->context.vdso = (void __user *)text_start;
+ current->mm->context.vdso_image = image;
+
up_fail:
mmap_write_unlock(mm);
return ret;
@@ -286,7 +321,8 @@ int map_vdso_once(const struct vdso_image *image, unsigned long addr)
*/
for_each_vma(vmi, vma) {
if (vma_is_special_mapping(vma, &vdso_mapping) ||
- vma_is_special_mapping(vma, &vvar_mapping)) {
+ vma_is_special_mapping(vma, &vvar_mapping) ||
+ vma_is_special_mapping(vma, &vvar_vclock_mapping)) {
mmap_write_unlock(mm);
return -EEXIST;
}
diff --git a/arch/x86/include/asm/vdso/vsyscall.h b/arch/x86/include/asm/vdso/vsyscall.h
index 6e210e05f9f323e3e9ceca8a04d5f21fb6d04781..0fcaaa421c5ae87939b040d9f325327cc3e5ceea 100644
--- a/arch/x86/include/asm/vdso/vsyscall.h
+++ b/arch/x86/include/asm/vdso/vsyscall.h
@@ -3,6 +3,11 @@
#define __ASM_VDSO_VSYSCALL_H
#define __VDSO_RND_DATA_OFFSET 640
+#define __VVAR_PAGES 4
+
+#define VDSO_NR_VCLOCK_PAGES 2
+#define VDSO_PAGE_PVCLOCK_OFFSET 0
+#define VDSO_PAGE_HVCLOCK_OFFSET 1
#ifndef __ASSEMBLY__
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 21/28] powerpc: vdso: Remove offset comment from 32bit vdso_arch_data
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (19 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 20/28] x86: vdso: Split virtual clock pages into dedicated mapping Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 22/28] powerpc: procfs: Propagate error of remap_pfn_range() Thomas Weißschuh
` (8 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
This offset was copy-pasted from the systemcfg structure.
It has no meaning for the 32bit VDSO.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/powerpc/include/asm/vdso_datapage.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/vdso_datapage.h b/arch/powerpc/include/asm/vdso_datapage.h
index 248dee138f7bf5dc11a9490a97f4a3917bc46e92..3d5862d4c4e1618a27840d9136e890870e78a761 100644
--- a/arch/powerpc/include/asm/vdso_datapage.h
+++ b/arch/powerpc/include/asm/vdso_datapage.h
@@ -92,7 +92,7 @@ struct vdso_arch_data {
* And here is the simpler 32 bits version
*/
struct vdso_arch_data {
- __u64 tb_ticks_per_sec; /* Timebase tics / sec 0x38 */
+ __u64 tb_ticks_per_sec; /* Timebase tics / sec */
__u32 syscall_map[SYSCALL_MAP_SIZE]; /* Map of syscalls */
__u32 compat_syscall_map[0]; /* No compat syscalls on PPC32 */
struct vdso_data data[CS_BASES];
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 22/28] powerpc: procfs: Propagate error of remap_pfn_range()
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (20 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 21/28] powerpc: vdso: Remove offset comment from 32bit vdso_arch_data Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 23/28] powerpc/pseries/lparcfg: Fix printing of system_active_processors Thomas Weißschuh
` (7 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
If the operation fails and userspace is unaware it will access unmapped
memory, crashing the process.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/powerpc/kernel/proc_powerpc.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_powerpc.c
index b109cd7b5d01fbe6870b60e60965effa86ecf3b6..910d2082e05fd86bd1146815d4b67633a6f2b459 100644
--- a/arch/powerpc/kernel/proc_powerpc.c
+++ b/arch/powerpc/kernel/proc_powerpc.c
@@ -33,10 +33,9 @@ static int page_map_mmap( struct file *file, struct vm_area_struct *vma )
if ((vma->vm_end - vma->vm_start) > PAGE_SIZE)
return -EINVAL;
- remap_pfn_range(vma, vma->vm_start,
- __pa(pde_data(file_inode(file))) >> PAGE_SHIFT,
- PAGE_SIZE, vma->vm_page_prot);
- return 0;
+ return remap_pfn_range(vma, vma->vm_start,
+ __pa(pde_data(file_inode(file))) >> PAGE_SHIFT,
+ PAGE_SIZE, vma->vm_page_prot);
}
static const struct proc_ops page_map_proc_ops = {
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 23/28] powerpc/pseries/lparcfg: Fix printing of system_active_processors
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (21 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 22/28] powerpc: procfs: Propagate error of remap_pfn_range() Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 24/28] powerpc/pseries/lparcfg: Use num_possible_cpus() for potential processors Thomas Weißschuh
` (6 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
When printing the information "system_active_processors", the variable
partition_potential_processors is used instead of
partition_active_processors. The wrong value is displayed.
Use partition_active_processors instead.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/powerpc/platforms/pseries/lparcfg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c
index 62da20f9700a974200c05a9d5de908746f2f151d..acc640fccca17b54c42eca1a242b37ad4299f685 100644
--- a/arch/powerpc/platforms/pseries/lparcfg.c
+++ b/arch/powerpc/platforms/pseries/lparcfg.c
@@ -553,7 +553,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
} else { /* non SPLPAR case */
seq_printf(m, "system_active_processors=%d\n",
- partition_potential_processors);
+ partition_active_processors);
seq_printf(m, "system_potential_processors=%d\n",
partition_potential_processors);
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 24/28] powerpc/pseries/lparcfg: Use num_possible_cpus() for potential processors
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (22 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 23/28] powerpc/pseries/lparcfg: Fix printing of system_active_processors Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 25/28] powerpc: Add kconfig option for the systemcfg page Thomas Weißschuh
` (5 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The systemcfg processorCount variable tracks currently online variables,
not possible ones, so the stored value is wrong.
The code preferably tries to use the ibm,lrdr-capacity field 4 which
"represents the maximum number of processors that the guest can have."
Switch from processorCount to the better matching num_possible_cpus().
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/powerpc/platforms/pseries/lparcfg.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c
index acc640fccca17b54c42eca1a242b37ad4299f685..cc22924f159f50416130f2dcd8f9d0ba0dc0973f 100644
--- a/arch/powerpc/platforms/pseries/lparcfg.c
+++ b/arch/powerpc/platforms/pseries/lparcfg.c
@@ -29,7 +29,6 @@
#include <asm/firmware.h>
#include <asm/rtas.h>
#include <asm/time.h>
-#include <asm/vdso_datapage.h>
#include <asm/vio.h>
#include <asm/mmu.h>
#include <asm/machdep.h>
@@ -530,7 +529,7 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
lrdrp = of_get_property(rtas_node, "ibm,lrdr-capacity", NULL);
if (lrdrp == NULL) {
- partition_potential_processors = vdso_data->processorCount;
+ partition_potential_processors = num_possible_cpus();
} else {
partition_potential_processors = be32_to_cpup(lrdrp + 4);
}
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 25/28] powerpc: Add kconfig option for the systemcfg page
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (23 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 24/28] powerpc/pseries/lparcfg: Use num_possible_cpus() for potential processors Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 26/28] powerpc: Split systemcfg data out of vdso data page Thomas Weißschuh
` (4 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The systemcfg page through procfs is only a backwards-compatible
interface for very old applications.
Make it possible to be disabled.
This also creates a convenient config #define to guard any accesses to
the systemcfg page.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/powerpc/Kconfig | 8 ++++++++
arch/powerpc/kernel/proc_powerpc.c | 4 ++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 8094a01974cca1d27002720e706f66bec2a2d035..5d348e1f09d730002eee9894a0b2847e1dac15d5 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -1298,6 +1298,14 @@ config MODULES_SIZE
endmenu
+config PPC64_PROC_SYSTEMCFG
+ def_bool y
+ depends on PPC64 && PROC_FS
+ help
+ This option enables the presence of /proc/ppc64/systemcfg through
+ which the systemcfg page can be accessed.
+ This interface only exists for backwards-compatibility.
+
if PPC64
# This value must have zeroes in the bottom 60 bits otherwise lots will break
config PAGE_OFFSET
diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_powerpc.c
index 910d2082e05fd86bd1146815d4b67633a6f2b459..3bda365843e44357538651c6c24c11a41de2eb06 100644
--- a/arch/powerpc/kernel/proc_powerpc.c
+++ b/arch/powerpc/kernel/proc_powerpc.c
@@ -14,7 +14,7 @@
#include <asm/rtas.h>
#include <linux/uaccess.h>
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
static loff_t page_map_seek(struct file *file, loff_t off, int whence)
{
@@ -59,7 +59,7 @@ static int __init proc_ppc64_init(void)
}
__initcall(proc_ppc64_init);
-#endif /* CONFIG_PPC64 */
+#endif /* CONFIG_PPC64_PROC_SYSTEMCFG */
/*
* Create the ppc64 and ppc64/rtas directories early. This allows us to
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 26/28] powerpc: Split systemcfg data out of vdso data page
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (24 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 25/28] powerpc: Add kconfig option for the systemcfg page Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 27/28] powerpc: Split systemcfg struct definitions out from vdso Thomas Weißschuh
` (3 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The systemcfg data only has minimal overlap with the vdso data.
Splitting the two avoids mapping the implementation-defined vdso data
into /proc/ppc64/systemcfg.
It is also a preparation for the standardization of vdso data storage.
The only field actually used by both systemcfg and vdso is
tb_ticks_per_sec and it is only changed once during time_init().
Initialize it in both structures there.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/powerpc/include/asm/vdso_datapage.h | 32 ++++++----------------------
arch/powerpc/kernel/proc_powerpc.c | 25 +++++++++++++++++++++-
arch/powerpc/kernel/setup-common.c | 4 +++-
arch/powerpc/kernel/smp.c | 10 +++++----
arch/powerpc/kernel/time.c | 3 +++
arch/powerpc/kernel/vdso.c | 20 -----------------
arch/powerpc/platforms/powernv/smp.c | 4 +++-
arch/powerpc/platforms/pseries/hotplug-cpu.c | 4 +++-
8 files changed, 48 insertions(+), 54 deletions(-)
diff --git a/arch/powerpc/include/asm/vdso_datapage.h b/arch/powerpc/include/asm/vdso_datapage.h
index 3d5862d4c4e1618a27840d9136e890870e78a761..8b91b1d34ff639a0efb80b9cdd7274f785643153 100644
--- a/arch/powerpc/include/asm/vdso_datapage.h
+++ b/arch/powerpc/include/asm/vdso_datapage.h
@@ -10,21 +10,6 @@
*/
-/*
- * Note about this structure:
- *
- * This structure was historically called systemcfg and exposed to
- * userland via /proc/ppc64/systemcfg. Unfortunately, this became an
- * ABI issue as some proprietary software started relying on being able
- * to mmap() it, thus we have to keep the base layout at least for a
- * few kernel versions.
- *
- * However, since ppc32 doesn't suffer from this backward handicap,
- * a simpler version of the data structure is used there with only the
- * fields actually used by the vDSO.
- *
- */
-
/*
* If the major version changes we are incompatible.
* Minor version changes are a hint.
@@ -40,13 +25,9 @@
#define SYSCALL_MAP_SIZE ((NR_syscalls + 31) / 32)
-/*
- * So here is the ppc64 backward compatible version
- */
-
#ifdef CONFIG_PPC64
-struct vdso_arch_data {
+struct systemcfg {
__u8 eye_catcher[16]; /* Eyecatcher: SYSTEMCFG:PPC64 0x00 */
struct { /* Systemcfg version numbers */
__u32 major; /* Major number 0x10 */
@@ -71,10 +52,12 @@ struct vdso_arch_data {
__u32 dcache_line_size; /* L1 d-cache line size 0x64 */
__u32 icache_size; /* L1 i-cache size 0x68 */
__u32 icache_line_size; /* L1 i-cache line size 0x6C */
+};
- /* those additional ones don't have to be located anywhere
- * special as they were not part of the original systemcfg
- */
+extern struct systemcfg *systemcfg;
+
+struct vdso_arch_data {
+ __u64 tb_ticks_per_sec; /* Timebase tics / sec */
__u32 dcache_block_size; /* L1 d-cache block size */
__u32 icache_block_size; /* L1 i-cache block size */
__u32 dcache_log_block_size; /* L1 d-cache log block size */
@@ -88,9 +71,6 @@ struct vdso_arch_data {
#else /* CONFIG_PPC64 */
-/*
- * And here is the simpler 32 bits version
- */
struct vdso_arch_data {
__u64 tb_ticks_per_sec; /* Timebase tics / sec */
__u32 syscall_map[SYSCALL_MAP_SIZE]; /* Map of syscalls */
diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_powerpc.c
index 3bda365843e44357538651c6c24c11a41de2eb06..e8083e05a1d03f74d9f24bac99e3ab526368c8e2 100644
--- a/arch/powerpc/kernel/proc_powerpc.c
+++ b/arch/powerpc/kernel/proc_powerpc.c
@@ -4,6 +4,7 @@
*/
#include <linux/init.h>
+#include <linux/memblock.h>
#include <linux/mm.h>
#include <linux/proc_fs.h>
#include <linux/kernel.h>
@@ -44,13 +45,35 @@ static const struct proc_ops page_map_proc_ops = {
.proc_mmap = page_map_mmap,
};
+static union {
+ struct systemcfg data;
+ u8 page[PAGE_SIZE];
+} systemcfg_data_store __page_aligned_data;
+struct systemcfg *systemcfg = &systemcfg_data_store.data;
static int __init proc_ppc64_init(void)
{
struct proc_dir_entry *pde;
+ strcpy((char *)systemcfg->eye_catcher, "SYSTEMCFG:PPC64");
+ systemcfg->version.major = SYSTEMCFG_MAJOR;
+ systemcfg->version.minor = SYSTEMCFG_MINOR;
+ systemcfg->processor = mfspr(SPRN_PVR);
+ /*
+ * Fake the old platform number for pSeries and add
+ * in LPAR bit if necessary
+ */
+ systemcfg->platform = 0x100;
+ if (firmware_has_feature(FW_FEATURE_LPAR))
+ systemcfg->platform |= 1;
+ systemcfg->physicalMemorySize = memblock_phys_mem_size();
+ systemcfg->dcache_size = ppc64_caches.l1d.size;
+ systemcfg->dcache_line_size = ppc64_caches.l1d.line_size;
+ systemcfg->icache_size = ppc64_caches.l1i.size;
+ systemcfg->icache_line_size = ppc64_caches.l1i.line_size;
+
pde = proc_create_data("powerpc/systemcfg", S_IFREG | 0444, NULL,
- &page_map_proc_ops, vdso_data);
+ &page_map_proc_ops, systemcfg);
if (!pde)
return 1;
proc_set_size(pde, PAGE_SIZE);
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 943430077375a4e3c95f4ee9c8d38270081d557e..d0b32ff2bc8dedc5aa7afce17f07a5c7c255387c 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -560,7 +560,9 @@ void __init smp_setup_cpu_maps(void)
out:
of_node_put(dn);
}
- vdso_data->processorCount = num_present_cpus();
+#endif
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
+ systemcfg->processorCount = num_present_cpus();
#endif /* CONFIG_PPC64 */
/* Initialize CPU <=> thread mapping/
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 4ab9b8cee77a1a775b22ed041d62ca43c9e1f61d..87ae45bf1045d8974e3eed09e284bc582310f3e2 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -1186,8 +1186,8 @@ int generic_cpu_disable(void)
return -EBUSY;
set_cpu_online(cpu, false);
-#ifdef CONFIG_PPC64
- vdso_data->processorCount--;
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
+ systemcfg->processorCount--;
#endif
/* Update affinity of all IRQs previously aimed at this CPU */
irq_migrate_all_off_this_cpu();
@@ -1642,10 +1642,12 @@ void start_secondary(void *unused)
secondary_cpu_time_init();
-#ifdef CONFIG_PPC64
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
if (system_state == SYSTEM_RUNNING)
- vdso_data->processorCount++;
+ systemcfg->processorCount++;
+#endif
+#ifdef CONFIG_PPC64
vdso_getcpu_init();
#endif
set_numa_node(numa_cpu_lookup_table[cpu]);
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 0ff9f038e800db6dbc910ce581550b457ee5f2db..6c53a0153c0d1c7cd74017a4dadb09ba149e456f 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -951,6 +951,9 @@ void __init time_init(void)
}
vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
+ systemcfg->tb_ticks_per_sec = tb_ticks_per_sec;
+#endif
/* initialise and enable the large decrementer (if we have one) */
set_decrementer_max();
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index ee4b9d676cff546caced78f6dd76923239697a3c..924f7f4fa597ef4b78f3e8a11ea1c22909c9f0c2 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -16,7 +16,6 @@
#include <linux/user.h>
#include <linux/elf.h>
#include <linux/security.h>
-#include <linux/memblock.h>
#include <linux/syscalls.h>
#include <linux/time_namespace.h>
#include <vdso/datapage.h>
@@ -349,25 +348,6 @@ static struct page ** __init vdso_setup_pages(void *start, void *end)
static int __init vdso_init(void)
{
#ifdef CONFIG_PPC64
- /*
- * Fill up the "systemcfg" stuff for backward compatibility
- */
- strcpy((char *)vdso_data->eye_catcher, "SYSTEMCFG:PPC64");
- vdso_data->version.major = SYSTEMCFG_MAJOR;
- vdso_data->version.minor = SYSTEMCFG_MINOR;
- vdso_data->processor = mfspr(SPRN_PVR);
- /*
- * Fake the old platform number for pSeries and add
- * in LPAR bit if necessary
- */
- vdso_data->platform = 0x100;
- if (firmware_has_feature(FW_FEATURE_LPAR))
- vdso_data->platform |= 1;
- vdso_data->physicalMemorySize = memblock_phys_mem_size();
- vdso_data->dcache_size = ppc64_caches.l1d.size;
- vdso_data->dcache_line_size = ppc64_caches.l1d.line_size;
- vdso_data->icache_size = ppc64_caches.l1i.size;
- vdso_data->icache_line_size = ppc64_caches.l1i.line_size;
vdso_data->dcache_block_size = ppc64_caches.l1d.block_size;
vdso_data->icache_block_size = ppc64_caches.l1i.block_size;
vdso_data->dcache_log_block_size = ppc64_caches.l1d.log_block_size;
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index 8f14f0581a21b131411eedcccec5c6775a0353fe..672209428b98459ef0a5595c0ec7128a5c5f17a2 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -136,7 +136,9 @@ static int pnv_smp_cpu_disable(void)
* the generic fixup_irqs. --BenH.
*/
set_cpu_online(cpu, false);
- vdso_data->processorCount--;
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
+ systemcfg->processorCount--;
+#endif
if (cpu == boot_cpuid)
boot_cpuid = cpumask_any(cpu_online_mask);
if (xive_enabled())
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 6838a0fcda296b1b03fbe7d1bfdcee138343b862..7b80d35d045dc9d947c0b512a58a82ef7398150d 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -83,7 +83,9 @@ static int pseries_cpu_disable(void)
int cpu = smp_processor_id();
set_cpu_online(cpu, false);
- vdso_data->processorCount--;
+#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
+ systemcfg->processorCount--;
+#endif
/*fix boot_cpuid here*/
if (cpu == boot_cpuid)
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 27/28] powerpc: Split systemcfg struct definitions out from vdso
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (25 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 26/28] powerpc: Split systemcfg data out of vdso data page Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 28/28] vdso: Rename struct arch_vdso_data to arch_vdso_time_data Thomas Weißschuh
` (2 subsequent siblings)
29 siblings, 0 replies; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh
The systemcfg data has nothing to do anymore with the vdso.
Split it into a dedicated header file.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
arch/powerpc/include/asm/systemcfg.h | 52 ++++++++++++++++++++++++++++
arch/powerpc/include/asm/vdso_datapage.h | 37 --------------------
arch/powerpc/kernel/proc_powerpc.c | 1 +
arch/powerpc/kernel/setup-common.c | 1 +
arch/powerpc/kernel/smp.c | 1 +
arch/powerpc/kernel/time.c | 1 +
arch/powerpc/platforms/powernv/smp.c | 1 +
arch/powerpc/platforms/pseries/hotplug-cpu.c | 1 +
8 files changed, 58 insertions(+), 37 deletions(-)
diff --git a/arch/powerpc/include/asm/systemcfg.h b/arch/powerpc/include/asm/systemcfg.h
new file mode 100644
index 0000000000000000000000000000000000000000..2f9b1d6a5c98d10469f8533fe6781be437712eff
--- /dev/null
+++ b/arch/powerpc/include/asm/systemcfg.h
@@ -0,0 +1,52 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#ifndef _SYSTEMCFG_H
+#define _SYSTEMCFG_H
+
+/*
+ * Copyright (C) 2002 Peter Bergner <bergner@vnet.ibm.com>, IBM
+ * Copyright (C) 2005 Benjamin Herrenschmidy <benh@kernel.crashing.org>,
+ * IBM Corp.
+ */
+
+#ifdef CONFIG_PPC64
+
+/*
+ * If the major version changes we are incompatible.
+ * Minor version changes are a hint.
+ */
+#define SYSTEMCFG_MAJOR 1
+#define SYSTEMCFG_MINOR 1
+
+#include <linux/types.h>
+
+struct systemcfg {
+ __u8 eye_catcher[16]; /* Eyecatcher: SYSTEMCFG:PPC64 0x00 */
+ struct { /* Systemcfg version numbers */
+ __u32 major; /* Major number 0x10 */
+ __u32 minor; /* Minor number 0x14 */
+ } version;
+
+ /* Note about the platform flags: it now only contains the lpar
+ * bit. The actual platform number is dead and buried
+ */
+ __u32 platform; /* Platform flags 0x18 */
+ __u32 processor; /* Processor type 0x1C */
+ __u64 processorCount; /* # of physical processors 0x20 */
+ __u64 physicalMemorySize; /* Size of real memory(B) 0x28 */
+ __u64 tb_orig_stamp; /* (NU) Timebase at boot 0x30 */
+ __u64 tb_ticks_per_sec; /* Timebase tics / sec 0x38 */
+ __u64 tb_to_xs; /* (NU) Inverse of TB to 2^20 0x40 */
+ __u64 stamp_xsec; /* (NU) 0x48 */
+ __u64 tb_update_count; /* (NU) Timebase atomicity ctr 0x50 */
+ __u32 tz_minuteswest; /* (NU) Min. west of Greenwich 0x58 */
+ __u32 tz_dsttime; /* (NU) Type of dst correction 0x5C */
+ __u32 dcache_size; /* L1 d-cache size 0x60 */
+ __u32 dcache_line_size; /* L1 d-cache line size 0x64 */
+ __u32 icache_size; /* L1 i-cache size 0x68 */
+ __u32 icache_line_size; /* L1 i-cache line size 0x6C */
+};
+
+extern struct systemcfg *systemcfg;
+
+#endif /* CONFIG_PPC64 */
+#endif /* _SYSTEMCFG_H */
diff --git a/arch/powerpc/include/asm/vdso_datapage.h b/arch/powerpc/include/asm/vdso_datapage.h
index 8b91b1d34ff639a0efb80b9cdd7274f785643153..a9686310be2cb8c8229d67fed31f332d04919557 100644
--- a/arch/powerpc/include/asm/vdso_datapage.h
+++ b/arch/powerpc/include/asm/vdso_datapage.h
@@ -9,14 +9,6 @@
* IBM Corp.
*/
-
-/*
- * If the major version changes we are incompatible.
- * Minor version changes are a hint.
- */
-#define SYSTEMCFG_MAJOR 1
-#define SYSTEMCFG_MINOR 1
-
#ifndef __ASSEMBLY__
#include <linux/unistd.h>
@@ -27,35 +19,6 @@
#ifdef CONFIG_PPC64
-struct systemcfg {
- __u8 eye_catcher[16]; /* Eyecatcher: SYSTEMCFG:PPC64 0x00 */
- struct { /* Systemcfg version numbers */
- __u32 major; /* Major number 0x10 */
- __u32 minor; /* Minor number 0x14 */
- } version;
-
- /* Note about the platform flags: it now only contains the lpar
- * bit. The actual platform number is dead and buried
- */
- __u32 platform; /* Platform flags 0x18 */
- __u32 processor; /* Processor type 0x1C */
- __u64 processorCount; /* # of physical processors 0x20 */
- __u64 physicalMemorySize; /* Size of real memory(B) 0x28 */
- __u64 tb_orig_stamp; /* (NU) Timebase at boot 0x30 */
- __u64 tb_ticks_per_sec; /* Timebase tics / sec 0x38 */
- __u64 tb_to_xs; /* (NU) Inverse of TB to 2^20 0x40 */
- __u64 stamp_xsec; /* (NU) 0x48 */
- __u64 tb_update_count; /* (NU) Timebase atomicity ctr 0x50 */
- __u32 tz_minuteswest; /* (NU) Min. west of Greenwich 0x58 */
- __u32 tz_dsttime; /* (NU) Type of dst correction 0x5C */
- __u32 dcache_size; /* L1 d-cache size 0x60 */
- __u32 dcache_line_size; /* L1 d-cache line size 0x64 */
- __u32 icache_size; /* L1 i-cache size 0x68 */
- __u32 icache_line_size; /* L1 i-cache line size 0x6C */
-};
-
-extern struct systemcfg *systemcfg;
-
struct vdso_arch_data {
__u64 tb_ticks_per_sec; /* Timebase tics / sec */
__u32 dcache_block_size; /* L1 d-cache block size */
diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_powerpc.c
index e8083e05a1d03f74d9f24bac99e3ab526368c8e2..3816a2bf2b844ff49f6fd22cc42e733d5ef72b36 100644
--- a/arch/powerpc/kernel/proc_powerpc.c
+++ b/arch/powerpc/kernel/proc_powerpc.c
@@ -13,6 +13,7 @@
#include <asm/machdep.h>
#include <asm/vdso_datapage.h>
#include <asm/rtas.h>
+#include <asm/systemcfg.h>
#include <linux/uaccess.h>
#ifdef CONFIG_PPC64_PROC_SYSTEMCFG
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index d0b32ff2bc8dedc5aa7afce17f07a5c7c255387c..0b732d3b283b199b19e078d45ffe4cb0325b7e63 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -67,6 +67,7 @@
#include <asm/cpu_has_feature.h>
#include <asm/kasan.h>
#include <asm/mce.h>
+#include <asm/systemcfg.h>
#include "setup.h"
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 87ae45bf1045d8974e3eed09e284bc582310f3e2..5ac7084eebc0b8c5ab16d96c89cadde953003431 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -61,6 +61,7 @@
#include <asm/ftrace.h>
#include <asm/kup.h>
#include <asm/fadump.h>
+#include <asm/systemcfg.h>
#include <trace/events/ipi.h>
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 6c53a0153c0d1c7cd74017a4dadb09ba149e456f..f959f4bdde2f5cd886bf7db1f9f65366775f94c7 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -71,6 +71,7 @@
#include <asm/vdso_datapage.h>
#include <asm/firmware.h>
#include <asm/mce.h>
+#include <asm/systemcfg.h>
/* powerpc clocksource/clockevent code */
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c
index 672209428b98459ef0a5595c0ec7128a5c5f17a2..2e9da58195f51ccfc13b5e0b95d2626937186a3e 100644
--- a/arch/powerpc/platforms/powernv/smp.c
+++ b/arch/powerpc/platforms/powernv/smp.c
@@ -36,6 +36,7 @@
#include <asm/kexec.h>
#include <asm/reg.h>
#include <asm/powernv.h>
+#include <asm/systemcfg.h>
#include "powernv.h"
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 7b80d35d045dc9d947c0b512a58a82ef7398150d..bc6926dbf14890881eacf4eb8df010d2f465c79f 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -33,6 +33,7 @@
#include <asm/xive.h>
#include <asm/plpar_wrappers.h>
#include <asm/topology.h>
+#include <asm/systemcfg.h>
#include "pseries.h"
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 28/28] vdso: Rename struct arch_vdso_data to arch_vdso_time_data
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (26 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 27/28] powerpc: Split systemcfg struct definitions out from vdso Thomas Weißschuh
@ 2024-10-10 7:01 ` Thomas Weißschuh
2024-10-10 7:55 ` Heiko Carstens
2024-10-30 11:39 ` [PATCH 00/28] vdso: Preparations for generic data storage Thomas Gleixner
2024-12-11 22:33 ` patchwork-bot+linux-riscv
29 siblings, 1 reply; 37+ messages in thread
From: Thomas Weißschuh @ 2024-10-10 7:01 UTC (permalink / raw)
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, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh, Nam Cao
From: Nam Cao <namcao@linutronix.de>
The struct arch_vdso_data is only about vdso time data. So rename it to
arch_vdso_time_data to make it obvious.
Non time-related data will be migrated out of these structs soon.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
arch/Kconfig | 2 +-
arch/riscv/Kconfig | 2 +-
arch/riscv/include/asm/vdso/{data.h => time_data.h} | 8 ++++----
arch/riscv/kernel/sys_hwprobe.c | 2 +-
arch/riscv/kernel/vdso/hwprobe.c | 4 ++--
arch/s390/Kconfig | 2 +-
arch/s390/include/asm/vdso/data.h | 12 ------------
arch/s390/include/asm/vdso/time_data.h | 12 ++++++++++++
include/vdso/datapage.h | 8 ++++----
9 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/arch/Kconfig b/arch/Kconfig
index 8af374ea1adc245b3aa341314a1dcb51865d03d1..7f1ec327b587c90f02e63edea19ce65c56505b9b 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1530,7 +1530,7 @@ config HAVE_SPARSE_SYSCALL_NR
entries at 4000, 5000 and 6000 locations. This option turns on syscall
related optimizations for a given architecture.
-config ARCH_HAS_VDSO_DATA
+config ARCH_HAS_VDSO_TIME_DATA
bool
config HAVE_STATIC_CALL
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 62545946ecf432df5b41e235ba66438cd3743c06..c278280c134f78d5a1f89199bdb85ad362aa5436 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -50,7 +50,7 @@ config RISCV
select ARCH_HAS_SYSCALL_WRAPPER
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
select ARCH_HAS_UBSAN
- select ARCH_HAS_VDSO_DATA
+ select ARCH_HAS_VDSO_TIME_DATA
select ARCH_KEEP_MEMBLOCK if ACPI
select ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE if 64BIT && MMU
select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX
diff --git a/arch/riscv/include/asm/vdso/data.h b/arch/riscv/include/asm/vdso/time_data.h
similarity index 71%
rename from arch/riscv/include/asm/vdso/data.h
rename to arch/riscv/include/asm/vdso/time_data.h
index dc2f76f58b7632f0392af6aaf475076203f1a54a..dfa65228999bed41dfd6c5e36cb678e1e055eec8 100644
--- a/arch/riscv/include/asm/vdso/data.h
+++ b/arch/riscv/include/asm/vdso/time_data.h
@@ -1,12 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __RISCV_ASM_VDSO_DATA_H
-#define __RISCV_ASM_VDSO_DATA_H
+#ifndef __RISCV_ASM_VDSO_TIME_DATA_H
+#define __RISCV_ASM_VDSO_TIME_DATA_H
#include <linux/types.h>
#include <vdso/datapage.h>
#include <asm/hwprobe.h>
-struct arch_vdso_data {
+struct arch_vdso_time_data {
/* Stash static answers to the hwprobe queries when all CPUs are selected. */
__u64 all_cpu_hwprobe_values[RISCV_HWPROBE_MAX_KEY + 1];
@@ -14,4 +14,4 @@ struct arch_vdso_data {
__u8 homogeneous_cpus;
};
-#endif /* __RISCV_ASM_VDSO_DATA_H */
+#endif /* __RISCV_ASM_VDSO_TIME_DATA_H */
diff --git a/arch/riscv/kernel/sys_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c
index cea0ca2bf2a25ecc671e31b141e84c6d1977da25..711a31f27c3d051476dd46afa51e6d33cd2fdffa 100644
--- a/arch/riscv/kernel/sys_hwprobe.c
+++ b/arch/riscv/kernel/sys_hwprobe.c
@@ -402,7 +402,7 @@ static int do_riscv_hwprobe(struct riscv_hwprobe __user *pairs,
static int __init init_hwprobe_vdso_data(void)
{
struct vdso_data *vd = __arch_get_k_vdso_data();
- struct arch_vdso_data *avd = &vd->arch_data;
+ struct arch_vdso_time_data *avd = &vd->arch_data;
u64 id_bitsmash = 0;
struct riscv_hwprobe pair;
int key;
diff --git a/arch/riscv/kernel/vdso/hwprobe.c b/arch/riscv/kernel/vdso/hwprobe.c
index 1e926e4b5881b6b2c44ec8438870809539f773c5..a158c029344f60c022e7565757ff44df7e3d89e5 100644
--- a/arch/riscv/kernel/vdso/hwprobe.c
+++ b/arch/riscv/kernel/vdso/hwprobe.c
@@ -17,7 +17,7 @@ static int riscv_vdso_get_values(struct riscv_hwprobe *pairs, size_t pair_count,
unsigned int flags)
{
const struct vdso_data *vd = __arch_get_vdso_data();
- const struct arch_vdso_data *avd = &vd->arch_data;
+ const struct arch_vdso_time_data *avd = &vd->arch_data;
bool all_cpus = !cpusetsize && !cpus;
struct riscv_hwprobe *p = pairs;
struct riscv_hwprobe *end = pairs + pair_count;
@@ -52,7 +52,7 @@ static int riscv_vdso_get_cpus(struct riscv_hwprobe *pairs, size_t pair_count,
unsigned int flags)
{
const struct vdso_data *vd = __arch_get_vdso_data();
- const struct arch_vdso_data *avd = &vd->arch_data;
+ const struct arch_vdso_time_data *avd = &vd->arch_data;
struct riscv_hwprobe *p = pairs;
struct riscv_hwprobe *end = pairs + pair_count;
unsigned char *c = (unsigned char *)cpus;
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index d339fe4fdedf881fd9224020381a1c7f62998d59..8cdd8359e00c3e383aaf5116f557203b59b065c3 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -88,7 +88,7 @@ config S390
select ARCH_HAS_STRICT_MODULE_RWX
select ARCH_HAS_SYSCALL_WRAPPER
select ARCH_HAS_UBSAN
- select ARCH_HAS_VDSO_DATA
+ select ARCH_HAS_VDSO_TIME_DATA
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select ARCH_INLINE_READ_LOCK
select ARCH_INLINE_READ_LOCK_BH
diff --git a/arch/s390/include/asm/vdso/data.h b/arch/s390/include/asm/vdso/data.h
deleted file mode 100644
index 0e2b40ef69b049c5e79ab2e31811e1e6e6ef2475..0000000000000000000000000000000000000000
--- a/arch/s390/include/asm/vdso/data.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __S390_ASM_VDSO_DATA_H
-#define __S390_ASM_VDSO_DATA_H
-
-#include <linux/types.h>
-
-struct arch_vdso_data {
- __s64 tod_steering_delta;
- __u64 tod_steering_end;
-};
-
-#endif /* __S390_ASM_VDSO_DATA_H */
diff --git a/arch/s390/include/asm/vdso/time_data.h b/arch/s390/include/asm/vdso/time_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..8a08752422e609d925c87ba5aafd1bbb6fef57e7
--- /dev/null
+++ b/arch/s390/include/asm/vdso/time_data.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __S390_ASM_VDSO_TIME_DATA_H
+#define __S390_ASM_VDSO_TIME_DATA_H
+
+#include <linux/types.h>
+
+struct arch_vdso_time_data {
+ __s64 tod_steering_delta;
+ __u64 tod_steering_end;
+};
+
+#endif /* __S390_ASM_VDSO_TIME_DATA_H */
diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h
index b85f24cac3f564d8b3c25c6ce86d2527af0e1e0b..d967baa0cd0c65784e38dc4fcd7b9e8273923947 100644
--- a/include/vdso/datapage.h
+++ b/include/vdso/datapage.h
@@ -19,10 +19,10 @@
#include <vdso/time32.h>
#include <vdso/time64.h>
-#ifdef CONFIG_ARCH_HAS_VDSO_DATA
-#include <asm/vdso/data.h>
+#ifdef CONFIG_ARCH_HAS_VDSO_TIME_DATA
+#include <asm/vdso/time_data.h>
#else
-struct arch_vdso_data {};
+struct arch_vdso_time_data {};
#endif
#define VDSO_BASES (CLOCK_TAI + 1)
@@ -114,7 +114,7 @@ struct vdso_data {
u32 hrtimer_res;
u32 __unused;
- struct arch_vdso_data arch_data;
+ struct arch_vdso_time_data arch_data;
};
/**
--
2.47.0
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH 03/28] s390/vdso: Drop LBASE_VDSO
2024-10-10 7:01 ` [PATCH 03/28] s390/vdso: Drop LBASE_VDSO Thomas Weißschuh
@ 2024-10-10 7:54 ` Heiko Carstens
0 siblings, 0 replies; 37+ messages in thread
From: Heiko Carstens @ 2024-10-10 7:54 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Guo Ren, 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, H. Peter Anvin,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino, linux-csky, linux-kernel,
linux-s390, linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev
On Thu, Oct 10, 2024 at 09:01:05AM +0200, Thomas Weißschuh wrote:
> This constant is always "0", providing no value and making the logic
> harder to understand.
> Also prepare for a consolidation of the vdso linkerscript logic by
> aligning it with other architectures.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> arch/s390/include/asm/vdso.h | 3 ---
> arch/s390/kernel/vdso32/vdso32.lds.S | 2 +-
> arch/s390/kernel/vdso64/vdso64.lds.S | 2 +-
> 3 files changed, 2 insertions(+), 5 deletions(-)
Acked-by: Heiko Carstens <hca@linux.ibm.com>
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 28/28] vdso: Rename struct arch_vdso_data to arch_vdso_time_data
2024-10-10 7:01 ` [PATCH 28/28] vdso: Rename struct arch_vdso_data to arch_vdso_time_data Thomas Weißschuh
@ 2024-10-10 7:55 ` Heiko Carstens
0 siblings, 0 replies; 37+ messages in thread
From: Heiko Carstens @ 2024-10-10 7:55 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Guo Ren, 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, H. Peter Anvin,
Michael Ellerman, Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino, linux-csky, linux-kernel,
linux-s390, linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Nam Cao
On Thu, Oct 10, 2024 at 09:01:30AM +0200, Thomas Weißschuh wrote:
> From: Nam Cao <namcao@linutronix.de>
>
> The struct arch_vdso_data is only about vdso time data. So rename it to
> arch_vdso_time_data to make it obvious.
> Non time-related data will be migrated out of these structs soon.
>
> Signed-off-by: Nam Cao <namcao@linutronix.de>
> ---
> arch/Kconfig | 2 +-
> arch/riscv/Kconfig | 2 +-
> arch/riscv/include/asm/vdso/{data.h => time_data.h} | 8 ++++----
> arch/riscv/kernel/sys_hwprobe.c | 2 +-
> arch/riscv/kernel/vdso/hwprobe.c | 4 ++--
> arch/s390/Kconfig | 2 +-
> arch/s390/include/asm/vdso/data.h | 12 ------------
> arch/s390/include/asm/vdso/time_data.h | 12 ++++++++++++
> include/vdso/datapage.h | 8 ++++----
> 9 files changed, 26 insertions(+), 26 deletions(-)
Acked-by: Heiko Carstens <hca@linux.ibm.com> # s390
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 04/28] arm64: vdso: Drop LBASE_VDSO
2024-10-10 7:01 ` [PATCH 04/28] arm64: vdso: " Thomas Weißschuh
@ 2024-10-28 18:01 ` Will Deacon
0 siblings, 0 replies; 37+ messages in thread
From: Will Deacon @ 2024-10-28 18:01 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Guo Ren, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Catalin Marinas,
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,
H. Peter Anvin, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan,
Vincenzo Frascino, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev
On Thu, Oct 10, 2024 at 09:01:06AM +0200, Thomas Weißschuh wrote:
> This constant is always "0", providing no value and making the logic
> harder to understand.
> Also prepare for a consolidation of the vdso linkerscript logic by
> aligning it with other architectures.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> arch/arm64/include/asm/vdso.h | 9 +--------
> arch/arm64/kernel/vdso/vdso.lds.S | 2 +-
> arch/arm64/kernel/vdso32/vdso.lds.S | 2 +-
> 3 files changed, 3 insertions(+), 10 deletions(-)
Acked-by: Will Deacon <will@kernel.org>
Will
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 05/28] arm64: vdso: Use only one single vvar mapping
2024-10-10 7:01 ` [PATCH 05/28] arm64: vdso: Use only one single vvar mapping Thomas Weißschuh
@ 2024-10-28 18:39 ` Will Deacon
0 siblings, 0 replies; 37+ messages in thread
From: Will Deacon @ 2024-10-28 18:39 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: Guo Ren, Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Sven Schnelle, Catalin Marinas,
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,
H. Peter Anvin, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Naveen N Rao, Madhavan Srinivasan,
Vincenzo Frascino, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev
On Thu, Oct 10, 2024 at 09:01:07AM +0200, Thomas Weißschuh wrote:
> The vvar mapping is the same for all processes. Use a single mapping to
> simplify the logic and align it with the other architectures.
>
> In addition this will enable the move of the vvar handling into generic code.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> arch/arm64/kernel/vdso.c | 43 +++++++++++++------------------------------
> 1 file changed, 13 insertions(+), 30 deletions(-)
I took this for a spin in qemu to double-check that compat and native
tasks can peacefully co-exist while using the vDSO. It all seems ok, so:
Acked-by: Will Deacon <will@kernel.org>
Tested-by: Will Deacon <will@kernel.org>
Will
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 00/28] vdso: Preparations for generic data storage
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (27 preceding siblings ...)
2024-10-10 7:01 ` [PATCH 28/28] vdso: Rename struct arch_vdso_data to arch_vdso_time_data Thomas Weißschuh
@ 2024-10-30 11:39 ` Thomas Gleixner
2024-11-05 14:04 ` Christophe Leroy
2024-12-11 22:33 ` patchwork-bot+linux-riscv
29 siblings, 1 reply; 37+ messages in thread
From: Thomas Gleixner @ 2024-10-30 11:39 UTC (permalink / raw)
To: Thomas Weißschuh, 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, Ingo Molnar,
Borislav Petkov, x86, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Christophe Leroy, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: Christophe Leroy, linux-csky, linux-kernel, linux-s390,
linux-arm-kernel, linux-riscv, loongarch, linux-mips,
linuxppc-dev, Thomas Weißschuh, Nam Cao
Folks!
On Thu, Oct 10 2024 at 09:01, Thomas Weißschuh wrote:
> 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.
As this has been sitting for two weeks now without major comments, I'm
planning to merge that through the tip tree tomorrow.
Thanks,
tglx
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 00/28] vdso: Preparations for generic data storage
2024-10-30 11:39 ` [PATCH 00/28] vdso: Preparations for generic data storage Thomas Gleixner
@ 2024-11-05 14:04 ` Christophe Leroy
2024-11-06 7:06 ` Michael Ellerman
0 siblings, 1 reply; 37+ messages in thread
From: Christophe Leroy @ 2024-11-05 14:04 UTC (permalink / raw)
To: Thomas Gleixner, Thomas Weißschuh, 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, Ingo Molnar,
Borislav Petkov, x86, H. Peter Anvin, Michael Ellerman,
Nicholas Piggin, Naveen N Rao, Madhavan Srinivasan,
Vincenzo Frascino
Cc: linux-csky, linux-kernel, linux-s390, linux-arm-kernel,
linux-riscv, loongarch, linux-mips, linuxppc-dev, Nam Cao
Le 30/10/2024 à 12:39, Thomas Gleixner a écrit :
> Folks!
>
> On Thu, Oct 10 2024 at 09:01, Thomas Weißschuh wrote:
>> 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.
>
> As this has been sitting for two weeks now without major comments, I'm
> planning to merge that through the tip tree tomorrow.
To avoid any future conflicts with powerpc tree, I suggest you merge
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
topic/vdso into your tree before applying this series.
Christophe
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 00/28] vdso: Preparations for generic data storage
2024-11-05 14:04 ` Christophe Leroy
@ 2024-11-06 7:06 ` Michael Ellerman
0 siblings, 0 replies; 37+ messages in thread
From: Michael Ellerman @ 2024-11-06 7:06 UTC (permalink / raw)
To: Christophe Leroy, Thomas Gleixner, Thomas Weißschuh, 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, Ingo Molnar, Borislav Petkov,
x86, H. Peter Anvin, Nicholas Piggin, Naveen N Rao,
Madhavan Srinivasan, Vincenzo Frascino
Cc: linux-csky, linux-kernel, linux-s390, linux-arm-kernel,
linux-riscv, loongarch, linux-mips, linuxppc-dev, Nam Cao
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Le 30/10/2024 à 12:39, Thomas Gleixner a écrit :
>> Folks!
>>
>> On Thu, Oct 10 2024 at 09:01, Thomas Weißschuh wrote:
>>> 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.
>>
>> As this has been sitting for two weeks now without major comments, I'm
>> planning to merge that through the tip tree tomorrow.
>
> To avoid any future conflicts with powerpc tree, I suggest you merge
> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
> topic/vdso into your tree before applying this series.
I thought the same, but there actually isn't any conflict at the moment
between the two trees.
Some of Thomas W's later changes to convert arches to generic VDSO
storage do conflict, but they look to be destined for the next merge
window.
cheers
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 00/28] vdso: Preparations for generic data storage
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
` (28 preceding siblings ...)
2024-10-30 11:39 ` [PATCH 00/28] vdso: Preparations for generic data storage Thomas Gleixner
@ 2024-12-11 22:33 ` patchwork-bot+linux-riscv
29 siblings, 0 replies; 37+ messages in thread
From: patchwork-bot+linux-riscv @ 2024-12-11 22:33 UTC (permalink / raw)
To: =?utf-8?q?Thomas_Wei=C3=9Fschuh_=3Cthomas=2Eweissschuh=40linutronix=2Ede=3E?=
Cc: linux-riscv, guoren, hca, gor, agordeev, borntraeger, svens,
catalin.marinas, will, paul.walmsley, palmer, aou, linux,
chenhuacai, kernel, tytso, Jason, tsbogend, dave.hansen, luto,
peterz, tglx, mingo, bp, x86, hpa, mpe, npiggin, christophe.leroy,
naveen, maddy, vincenzo.frascino, linux-csky, linux-kernel,
linux-s390, linux-arm-kernel, loongarch, linux-mips, linuxppc-dev,
namcao
Hello:
This series was applied to riscv/linux.git (fixes)
by Thomas Gleixner <tglx@linutronix.de>:
On Thu, 10 Oct 2024 09:01:02 +0200 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [01/28] csky/vdso: Remove gettimeofday() and friends from VDSO
(no matching commit)
- [02/28] csky/vdso: Remove arch_vma_name()
(no matching commit)
- [03/28] s390/vdso: Drop LBASE_VDSO
(no matching commit)
- [04/28] arm64: vdso: Drop LBASE_VDSO
(no matching commit)
- [05/28] arm64: vdso: Use only one single vvar mapping
(no matching commit)
- [06/28] riscv: vdso: Use only one single vvar mapping
https://git.kernel.org/riscv/c/d34b60752fcb
- [07/28] arm: vdso: Remove assembly for datapage access
(no matching commit)
- [08/28] LoongArch: vDSO: Use vdso/datapage.h to access vDSO data
(no matching commit)
- [09/28] MIPS: vdso: Avoid name conflict around "vdso_data"
(no matching commit)
- [10/28] x86/mm/mmap: Remove arch_vma_name()
(no matching commit)
- [11/28] x86: vdso: Use __arch_get_vdso_data() to access vdso data
(no matching commit)
- [12/28] x86: vdso: Place vdso_data at beginning of vvar page
(no matching commit)
- [13/28] x86: vdso: Access rng data from kernel without vvar
(no matching commit)
- [14/28] x86: vdso: Allocate vvar page from C code
(no matching commit)
- [15/28] x86: vdso: Access timens vdso data without vvar.h
(no matching commit)
- [16/28] x86: vdso: Access rng vdso data without vvar.h
(no matching commit)
- [17/28] x86: vdso: Move the rng offset to vsyscall.h
(no matching commit)
- [18/28] x86: vdso: Access vdso data without vvar.h
(no matching commit)
- [19/28] x86: vdso: Delete vvar.h
(no matching commit)
- [20/28] x86: vdso: Split virtual clock pages into dedicated mapping
(no matching commit)
- [21/28] powerpc: vdso: Remove offset comment from 32bit vdso_arch_data
(no matching commit)
- [22/28] powerpc: procfs: Propagate error of remap_pfn_range()
(no matching commit)
- [23/28] powerpc/pseries/lparcfg: Fix printing of system_active_processors
(no matching commit)
- [24/28] powerpc/pseries/lparcfg: Use num_possible_cpus() for potential processors
(no matching commit)
- [25/28] powerpc: Add kconfig option for the systemcfg page
(no matching commit)
- [26/28] powerpc: Split systemcfg data out of vdso data page
(no matching commit)
- [27/28] powerpc: Split systemcfg struct definitions out from vdso
(no matching commit)
- [28/28] vdso: Rename struct arch_vdso_data to arch_vdso_time_data
(no matching commit)
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 37+ messages in thread
end of thread, other threads:[~2024-12-11 22:32 UTC | newest]
Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-10 7:01 [PATCH 00/28] vdso: Preparations for generic data storage Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 01/28] csky/vdso: Remove gettimeofday() and friends from VDSO Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 02/28] csky/vdso: Remove arch_vma_name() Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 03/28] s390/vdso: Drop LBASE_VDSO Thomas Weißschuh
2024-10-10 7:54 ` Heiko Carstens
2024-10-10 7:01 ` [PATCH 04/28] arm64: vdso: " Thomas Weißschuh
2024-10-28 18:01 ` Will Deacon
2024-10-10 7:01 ` [PATCH 05/28] arm64: vdso: Use only one single vvar mapping Thomas Weißschuh
2024-10-28 18:39 ` Will Deacon
2024-10-10 7:01 ` [PATCH 06/28] riscv: " Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 07/28] arm: vdso: Remove assembly for datapage access Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 08/28] LoongArch: vDSO: Use vdso/datapage.h to access vDSO data Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 09/28] MIPS: vdso: Avoid name conflict around "vdso_data" Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 10/28] x86/mm/mmap: Remove arch_vma_name() Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 11/28] x86: vdso: Use __arch_get_vdso_data() to access vdso data Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 12/28] x86: vdso: Place vdso_data at beginning of vvar page Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 13/28] x86: vdso: Access rng data from kernel without vvar Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 14/28] x86: vdso: Allocate vvar page from C code Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 15/28] x86: vdso: Access timens vdso data without vvar.h Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 16/28] x86: vdso: Access rng " Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 17/28] x86: vdso: Move the rng offset to vsyscall.h Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 18/28] x86: vdso: Access vdso data without vvar.h Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 19/28] x86: vdso: Delete vvar.h Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 20/28] x86: vdso: Split virtual clock pages into dedicated mapping Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 21/28] powerpc: vdso: Remove offset comment from 32bit vdso_arch_data Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 22/28] powerpc: procfs: Propagate error of remap_pfn_range() Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 23/28] powerpc/pseries/lparcfg: Fix printing of system_active_processors Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 24/28] powerpc/pseries/lparcfg: Use num_possible_cpus() for potential processors Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 25/28] powerpc: Add kconfig option for the systemcfg page Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 26/28] powerpc: Split systemcfg data out of vdso data page Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 27/28] powerpc: Split systemcfg struct definitions out from vdso Thomas Weißschuh
2024-10-10 7:01 ` [PATCH 28/28] vdso: Rename struct arch_vdso_data to arch_vdso_time_data Thomas Weißschuh
2024-10-10 7:55 ` Heiko Carstens
2024-10-30 11:39 ` [PATCH 00/28] vdso: Preparations for generic data storage Thomas Gleixner
2024-11-05 14:04 ` Christophe Leroy
2024-11-06 7:06 ` Michael Ellerman
2024-12-11 22:33 ` patchwork-bot+linux-riscv
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).