d60d7de3 | 04-Aug-2020 |
Sven Schnelle <svens@linux.ibm.com> |
lib/vdso: Allow to add architecture-specific vdso data
The initial assumption that all VDSO related data can be completely generic does not hold. S390 needs architecture specific storage to access t
lib/vdso: Allow to add architecture-specific vdso data
The initial assumption that all VDSO related data can be completely generic does not hold. S390 needs architecture specific storage to access the clock steering information.
Add struct arch_vdso_data to the vdso data struct. For architectures which do not need extra data this defaults to an empty struct. Architectures which require it, enable CONFIG_ARCH_HAS_VDSO_DATA and provide their specific struct in asm/vdso/data.h.
Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200804150124.41692-2-svens@linux.ibm.com
show more ...
|
ca214e2c | 23-Mar-2020 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
vdso: Fix clocksource.h macro detection
CONFIG_GENERIC_GETTIMEOFDAY is a sufficient condition to verify if an architecture implements asm/vdso/clocksource.h or not. The current implementation wrongl
vdso: Fix clocksource.h macro detection
CONFIG_GENERIC_GETTIMEOFDAY is a sufficient condition to verify if an architecture implements asm/vdso/clocksource.h or not. The current implementation wrongly assumes that the same is true for the config option CONFIG_ARCH_CLOCKSOURCE_DATA.
This results in a series of build errors on ia64/sparc/sparc64 like this:
In file included from ./include/linux/clocksource.h:31, from ./include/linux/clockchips.h:14, from ./include/linux/tick.h:8, from fs/proc/stat.c:15: ./include/vdso/clocksource.h:9:10: fatal error: asm/vdso/clocksource.h: No such file or directory 9 | #include <asm/vdso/clocksource.h> | ^~~~~~~~~~~~~~~~~~~~~~~~
Fix the issue removing the unneeded config condition.
Fixes: 14ee2ac618e4 ("linux/clocksource.h: Extract common header for vDSO") Reported-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20200323133920.46546-1-vincenzo.frascino@arm.com
show more ...
|
d8bb6993 | 20-Mar-2020 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
common: Introduce processor.h
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is nece
common: Introduce processor.h
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library.
Introduce processor.h to contain all the processor specific functions that are suitable for vDSO inclusion.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200320145351.32292-16-vincenzo.frascino@arm.com
show more ...
|
cc56f32f | 20-Mar-2020 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
linux/ktime.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this pos
linux/ktime.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library.
Split ktime.h into linux and common headers to make the latter suitable for inclusion in the vDSO library.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200320145351.32292-15-vincenzo.frascino@arm.com
show more ...
|
97b01d2e | 20-Mar-2020 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
linux/jiffies.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this p
linux/jiffies.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library.
Split jiffies.h into linux and common headers to make the latter suitable for inclusion in the vDSO library.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200320145351.32292-14-vincenzo.frascino@arm.com
show more ...
|
b72a9c5e | 20-Mar-2020 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
linux/time64.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this po
linux/time64.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library.
Split time64.h into linux and common headers to make the latter suitable for inclusion in the vDSO library.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200320145351.32292-13-vincenzo.frascino@arm.com
show more ...
|
9a416231 | 20-Mar-2020 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
linux/time32.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this po
linux/time32.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library.
Split time32.h into linux and common headers to make the latter suitable for inclusion in the vDSO library.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200320145351.32292-12-vincenzo.frascino@arm.com
show more ...
|
639fff1c | 20-Mar-2020 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
linux/time.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this poss
linux/time.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library.
Split time.h into linux and common headers to make the latter suitable for inclusion in the vDSO library.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200320145351.32292-11-vincenzo.frascino@arm.com
show more ...
|
b874b835 | 20-Mar-2020 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
linux/math64.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this po
linux/math64.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library.
Split math64.h into linux and common headers to make the latter suitable for inclusion in the vDSO library.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200320145351.32292-10-vincenzo.frascino@arm.com
show more ...
|
3e0e9f8c | 20-Mar-2020 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
linux/limits.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this po
linux/limits.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library.
Split limits.h into linux and common headers to make the latter suitable for inclusion in the vDSO library.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200320145351.32292-4-vincenzo.frascino@arm.com
show more ...
|
3945ff37 | 20-Mar-2020 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
linux/bits.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this poss
linux/bits.h: Extract common header for vDSO
The vDSO library should only include the necessary headers required for a userspace library (UAPI and a minimal set of kernel headers). To make this possible it is necessary to isolate from the kernel headers the common parts that are strictly necessary to build the library.
Split bits.h into linux and common headers to make the latter suitable for inclusion in the vDSO library.
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200320145351.32292-3-vincenzo.frascino@arm.com
show more ...
|
660fd04f | 11-Nov-2019 |
Thomas Gleixner <tglx@linutronix.de> |
lib/vdso: Prepare for time namespace support
To support time namespaces in the vdso with a minimal impact on regular non time namespace affected tasks, the namespace handling needs to be hidden in a
lib/vdso: Prepare for time namespace support
To support time namespaces in the vdso with a minimal impact on regular non time namespace affected tasks, the namespace handling needs to be hidden in a slow path.
The most obvious place is vdso_seq_begin(). If a task belongs to a time namespace then the VVAR page which contains the system wide vdso data is replaced with a namespace specific page which has the same layout as the VVAR page. That page has vdso_data->seq set to 1 to enforce the slow path and vdso_data->clock_mode set to VCLOCK_TIMENS to enforce the time namespace handling path.
The extra check in the case that vdso_data->seq is odd, e.g. a concurrent update of the vdso data is in progress, is not really affecting regular tasks which are not part of a time namespace as the task is spin waiting for the update to finish and vdso_data->seq to become even again.
If a time namespace task hits that code path, it invokes the corresponding time getter function which retrieves the real VVAR page, reads host time and then adds the offset for the requested clock which is stored in the special VVAR page.
If VDSO time namespace support is disabled the whole magic is compiled out.
Initial testing shows that the disabled case is almost identical to the host case which does not take the slow timens path. With the special timens page installed the performance hit is constant time and in the range of 5-7%.
For the vdso functions which are not using the sequence count an unconditional check for vdso_data->clock_mode is added which switches to the real vdso when the clock_mode is VCLOCK_TIMENS.
[avagin: Make do_hres_timens() work with raw clocks too: choose vdso_data pointer by CS_RAW offset.]
Suggested-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrei Vagin <avagin@gmail.com> Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20191112012724.250792-21-dima@arista.com
show more ...
|
44f57d78 | 21-Jun-2019 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
timekeeping: Provide a generic update_vsyscall() implementation
The new generic VDSO library allows to unify the update_vsyscall[_tz]() implementations.
Provide a generic implementation based on th
timekeeping: Provide a generic update_vsyscall() implementation
The new generic VDSO library allows to unify the update_vsyscall[_tz]() implementations.
Provide a generic implementation based on the x86 code and the bindings which need to be implemented in architecture specific code.
[ tglx: Moved it into kernel/time where it belongs. Removed the pointless line breaks in the stub functions. Massaged changelog ]
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Shijith Thotton <sthotton@marvell.com> Tested-by: Andre Przywara <andre.przywara@arm.com> Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mips@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Russell King <linux@armlinux.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@mips.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Mark Salyzyn <salyzyn@android.com> Cc: Peter Collingbourne <pcc@google.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Huw Davies <huw@codeweavers.com> Link: https://lkml.kernel.org/r/20190621095252.32307-4-vincenzo.frascino@arm.com
show more ...
|
00b26474 | 21-Jun-2019 |
Vincenzo Frascino <vincenzo.frascino@arm.com> |
lib/vdso: Provide generic VDSO implementation
In the last few years the kernel gained quite some architecture specific vdso implementations which contain very similar code.
Introduce a generic VDSO
lib/vdso: Provide generic VDSO implementation
In the last few years the kernel gained quite some architecture specific vdso implementations which contain very similar code.
Introduce a generic VDSO implementation of gettimeofday() which will be shareable between architectures once they are converted over.
The implementation is based on the current x86 VDSO code.
[ tglx: Massaged changelog and made the kernel doc tabular ]
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Shijith Thotton <sthotton@marvell.com> Tested-by: Andre Przywara <andre.przywara@arm.com> Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mips@vger.kernel.org Cc: linux-kselftest@vger.kernel.org Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Russell King <linux@armlinux.org.uk> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@mips.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Mark Salyzyn <salyzyn@android.com> Cc: Peter Collingbourne <pcc@google.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Dmitry Safonov <0x7f454c46@gmail.com> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Huw Davies <huw@codeweavers.com> Link: https://lkml.kernel.org/r/20190621095252.32307-3-vincenzo.frascino@arm.com
show more ...
|