Thread (29 messages) 29 messages, 5 authors, 2025-01-09

Re: [PATCH 03/17] vdso: Add generic time data storage

From: Thomas Weißschuh <hidden>
Date: 2024-12-18 10:25:46
Also in: linux-arch, linux-arm-kernel, linux-mips, linux-riscv, linux-s390, lkml, loongarch

Hi Christophe,

On Wed, Dec 18, 2024 at 08:32:14AM +0100, Christophe Leroy wrote:
Le 16/12/2024 à 15:09, Thomas Weißschuh a écrit :
quoted
Historically each architecture defined their own way to store the vDSO
data page. Add a generic mechanism to provide storage for that page.

Furthermore this generic storage will be extended to also provide
uniform storage for *non*-time-related data, like the random state or
architecture-specific data. These will have their own pages and data
structures, so rename 'vdso_data' into 'vdso_time_data' to make that
split clear from the name.

Also introduce a new consistent naming scheme for the symbols related to
the vDSO, which makes it clear if the symbol is accessible from
userspace or kernel space and the type of data behind the symbol.

The generic fault handler contains an optimization to prefault the vvar
page when the timens page is accessed. This was lifted from s390 and x86.

Co-developed-by: Nam Cao <redacted>
Signed-off-by: Nam Cao <redacted>
Signed-off-by: Thomas Weißschuh <redacted>
---
  MAINTAINERS                    |  1 +
  include/linux/time_namespace.h |  1 +
  include/linux/vdso_datastore.h | 10 +++++
  include/vdso/datapage.h        | 69 +++++++++++++++++++++++++----
  lib/Kconfig                    |  1 +
  lib/Makefile                   |  2 +
  lib/vdso_kernel/Kconfig        |  7 +++
  lib/vdso_kernel/Makefile       |  3 ++
  lib/vdso_kernel/datastore.c    | 99 ++++++++++++++++++++++++++++++++++++++++++
There is only one single file, namely datastore.c. You don't need a new
directory for that, I should go in lib/vdso/
lib/vdso/ currently only contains userspace code.
I don't have a strong opinion on that.
The lib/vdso_kernel location was suggested by tglx, maybe he has some
feedback. (Originally I put it into kernel/vdso_storage.c)

[..]
quoted
+enum vdso_pages {
+	VDSO_TIME_PAGE_OFFSET,
+	VDSO_TIMENS_PAGE_OFFSET,
+	VDSO_NR_PAGES
+};
Naming that VDSO_ is confusing. Most macros called VDSO_ are related to the
VDSO Code. VDSO data related macros should be prefixed with VVAR_
Also a request from tglx.

[..]


Thanks!
Thomas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help