[PATCH v2 03/10] um: vdso: Implement __vdso_getcpu() via syscall

Johannes Berg johannes at sipsolutions.net
Mon Sep 22 08:14:18 PDT 2025


On Mon, 2025-09-22 at 16:01 +0200, Thomas Weißschuh wrote:
> Right now it does not provide any advantage over a regular syscall.
> Essentially it is just overhead. That said, if you do want to make a
> real vDSO out of it, I'd be happy to help in that.

I don't know if I'd say "just overhead" - depends on which path is more
optimised in a typical libc implementation? I'd basically think it's
identical, no? You either link to the vDSO, or a __weak same function in
the libc?

> > I mean ... on the one hand, sure, it doesn't really do much after this,
> > but OTOH it lets userspace actually use that path? So might be useful.
> 
> What advantage does userspace have from it?

Right now, none? But it's easier to play with if you have the
infrastructure, and I'm not convinced there's a _disadvantage_?

> > > Also the functionality to map the host vDSO and vsyscall page into UML
> > > userspace looks very weird and error-prone. Maybe it can also go away.
> > 
> > Surely host vDSO etc. is never mapped into UML userspace and never is,
> > not sure what you're thinking of, but clearly that's wrong as written.
> 
> This is how I understand the 32bit implementation using
> ARCH_REUSE_HOST_VSYSCALL_AREA and NEW_AUX_ENT(AT_SYSINFO_EHDR, vsyscall_ehdr)
> where vsyscall_ehdr comes from the hosts getauxval(AT_SYSINFO_EHDR).

Huh, hm, yeah I forgot about that ... 32-bit. Yeah, agree we should just
kill that. I'm not even sure it works with the host kernel trapping
there? Oh well.

johannes



More information about the linux-um mailing list