On Tuesday 17 January 2006 04:06, D. Bahi wrote:
> yes, blaise,

You've actually got the right meaning of my nick.... I named myself after 
Blaise Pascal :-) (referring to the Pascal language, indeed)!

> i read your comment from the november posting to the list in response to
> this problem reported then and tried it...

> #ifdef CONFIG_MODE_TT
> /* This is for use by the tracing thread in special situations (see
> below). */
> static int indirect_set_thread_area_tt(struct user_desc *info) {
>     BUG_ON(os_getpid() != tracing_pid);
>     return os_set_thread_area(info, current->thread.mode.tt.extern_pid);
> }
>
> #endif
>
> static inline int indirect_set_thread_area(struct user_desc *info) {
>     if (mode_tt)
>         return indirect_set_thread_area_tt(info);
>     else
>         return 0;
> }
>
> moving the #endif doesn't work because then we have the unresolved
> reference to the indirect_set_thread_area_tt() -- you have to have the
> CHOOSE_MODE or CHOOSE_MODE_PROC somewhere in there to macro the
> unused/undefined mode_tt away.

Yes, that's missing, it's the correct solution. However in the uploaded 
patchset I later removed indirect_* altogether. I'm still answering you below 
to answer your questions.

> so as to why my patch is bogus ... in load_TLS() you have this check
> early on
>

> looks like you blow up if this flag is set and we're not TT

Ok, but the opposite doesn't hold. Implications are not simmetric, and you're 
getting this wrong in this mail.

> so 
> i figured the check here could be removed - ah - but it could be
> not set it TT mode and you still want to do_set_thread_area....

Parse error + verbosity excess... 

>         ret = (flags & O_INDIRECT) ?
> indirect_set_thread_area(&curr->tls): do_set_thread_area(&curr->tls);
>
> so replacing the above with
>
>         ret = CHOOSE_MODE_PROC( indirect_set_thread_area,
> do_set_thread_area, &curr->tls );
>
> would always call indirect_set_thread_area for TT mode and you only want
> that if
Exactly, only if...
> it is the tracing_pid 

No, only when I set O_INDIRECT. Which currently never happens anyway.

Actually, O_INDIRECT was never used in the patches I published, I did it 
another way (instead of actually setting the TLS on the host with O_INDIRECT, 
that is deferred at context switch time; we only record the thing as 
unflushed); however, O_INDIRECT could be used only if in TT mode and only 
from the tracing thread, but even when both conditions are met, the caller is 
free to avoid O_INDIRECT,  like I said.

> else you want do_set_thread_area... oops... my bad.

> so you'd move the #endif and do/did this instead?

> static inline int indirect_set_thread_area(struct user_desc *info) {
>     CHOOSE_MODE(  return indirect_set_thread_area_tt(info), 0);
> }
>
> right?

Yes... that was my point.

 however in current code I replaced that "return 0" with "BUG" so it won't 
likely work directly.
> thanks for the eyes and the time.
>
> db
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

        

        
                
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to