Page MenuHomeFreeBSD

amd64: fix tlb shootdown when all cpus are passed in the bitmap

Authored by mjg on Tue, Jan 12, 8:17 AM.



Right now the routine leaves the current CPU in the map, later tripping on an assert when filling in the scoreboard:
panic: IPI scoreboard is zero, initiator 1 target 1

Instead pre-check if all CPUs are present in the map and remember that outcome for later.

Fixes 7eaea04a5bb1dc ("amd64: compare TLB shootdown target to all_cpus")

As a side note this code looks weirdly inefficient. For example the initial scoreboard loop should have a form of FOREACH macro instead of ffsing from scratch every time. That goes beyond the scope of this change, I may get around to it later.

Diff Detail

R10 FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mjg requested review of this revision.Tue, Jan 12, 8:17 AM
mjg created this revision.
mjg edited the summary of this revision. (Show Details)

I like is_all introduction, but I believe that single-target or UP cases still should result in local_cb handling.

FWIW I have this staged and your review came just before I typed commit.;a=commitdiff;h=686232280ac30de567d178c1f77c4b63d6253e21

To my reading this is preserved -- if there is only one recipient and it is curcpu this goes to local_cb as previously due to the resulting mask being empty ; for any other case it still ends up executing curcpu_cb(pmap, addr1, addr2).

This revision is now accepted and ready to land.Tue, Jan 12, 8:37 AM