On Sat, 26 Oct 2024 00:22:48 +0900, Johannes Berg wrote: > > 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?
thanks, I'll try with this approach. > > > > +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? agreed. I'll update that part. -- Hajime