On Sun, Feb 1, 2026 at 7:54 AM Alex Bennée <[email protected]> wrote:

> Warner Losh <[email protected]> writes:
>
> > OK. I've updated bsd-user fork from last year to yesterday. I had one
> question.
> >
> > I see that we've gone from tb_flush() to queue_tb_flush(). Why was that?
> And is it a drop in?
> > FreeBSD's fork has this in the thread creation:
> >
> >     /*
> >      * If this is our first additional thread, we need to ensure we
> >      * generate code for parallel execution and flush old translations.
> >      * Do this now so that the copy gets CF_PARALLEL too.
> >      */
> >     if (!(cpu->tcg_cflags & CF_PARALLEL)) {
> >         cpu->tcg_cflags |= CF_PARALLEL;
> >         tb_flush(cpu);
> >     }
> >
> > I think the right thing to do is to just change this to
> queue_tb_flush(cpu), and that compiles. I'd like to get some confirmation,
> though.
> > Did I parse the changes right?
>
> Yes, because ultimately we use safe work which:
>
>  * Schedules the function @func for execution on the vCPU @cpu
> asynchronously,
>  * while all other vCPUs are sleeping.
>

So I've done this in the latest blitz branch. I encountered one gotcha. I
replaced it in the one place, but that didn't work too well. I finally
tracked down the issue: I had implemented the change in only one place
instead of the three required locations. I also had to bring the
begin_parallel_context() function over from linux-user. I like
user-internal.h that's in linux user. What is your touchstone for deciding
where that code belongs in it? I'd like to do the same in bsd-user once my
upstream focus shift to refinement of blitz and maybe my next cool thing
there.

Warner

Reply via email to