All of lore.kernel.org
 help / color / mirror / Atom feed
* ucontext, kernel vs. userspace (glibc)
@ 2021-08-30 10:40 Benjamin Herrenschmidt
  2021-08-31 17:44 ` Catalin Marinas
  2021-09-02 12:42 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2021-08-30 10:40 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Catalin Marinas, Will Deacon, Dave Martin, benh

Hi Folks !

So I'm discovering arm64 intricacies and today, as I was looking at SVE
support (in the context of distro glibc backports.. don't ask), I
noticed that glibc has no provision for dealing with kernel generated
ucontext's in its {get,set,swap}_context functions...

(It says so explicitly in the code unless I misunderstood).

So one thing we did to "solve" this on ppc64 a while ago was to create
a swapcontext syscall which can operate as all 3 operations (you can
have NULL arguments), which also handles the sigprocmask (bonus:
atomically with the context get/set from a userspace perspective).

Would it make sense to do something similar on aarch64 ? (And have
glibc then exploit it).

The hard-to-solve thing is the case where the SVE context spills
outside of the ucontext itself, in the extra room on the stack, since
programs that "now" about ucontext will not have allocated space for
that, so that's more/less a lost cause already.

Cheers,
Ben.



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-03 12:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 10:40 ucontext, kernel vs. userspace (glibc) Benjamin Herrenschmidt
2021-08-31 17:44 ` Catalin Marinas
2021-09-02 12:42 ` Mark Brown
2021-09-03  7:14   ` Benjamin Herrenschmidt
2021-09-03 11:02     ` Szabolcs Nagy
2021-09-03 12:25     ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.