[RFC PATCH 07/13] um: nommu: configure fs register on host syscall invocation

Johannes Berg johannes at sipsolutions.net
Fri Oct 25 08:22:48 PDT 2024


On Fri, 2024-10-25 at 22:27 +0900, Hajime Tazaki wrote:
> 
> On Fri, 25 Oct 2024 18:28:01 +0900,
> Johannes Berg wrote:
> > 
> > On Thu, 2024-10-24 at 21:09 +0900, Hajime Tazaki wrote:
> > > 
> > > +static void sigill(int sig, siginfo_t *si, void *ctx_void)
> > > +{
> > > +	longjmp(jmpbuf, 1);
> > > +}
> > 
> > Should this code use sigsetjmp/siglongjmp?
> 
> the code is referred from tools/testing/selftests/x86/fsgsbase.c and
> the original code uses sigsetjmp/siglongjmp indeed.

:)

> I was struggling to pull the definition of sigsetjmp & co from host
> headers as it conflicts with UML definitions of jmp_buf, etc.
> 
> Will look into detail again but would be nice if you have an
> experience on this.

Hm. This is a userspace side so there shouldn't be much trouble with
that? Worst case put it into its own file in os-Linux/ and don't include
so many shared headers, I guess?

> > > +int os_has_fsgsbase(void)
> > > +{
> > > +	return has_fsgsbase;
> > > +}
> > 
> > Why should this be a function rather than just exposing the variable?
> 
> as it is referred in arch/x86/um code.

Yeah but you have to also declare the function somewhere in a header
file - could as well declare "extern int host_has_fsgsbase;" or so?

johannes



More information about the linux-um mailing list