Page MenuHomeFreeBSD

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

Authored by mjg on Jan 12 2021, 8:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 24, 8:39 AM
Unknown Object (File)
Dec 22 2023, 10:04 PM
Unknown Object (File)
Oct 30 2023, 12:20 AM
Unknown Object (File)
Sep 30 2023, 7:09 PM
Unknown Object (File)
Sep 21 2023, 10:13 PM
Unknown Object (File)
Sep 7 2023, 12:43 AM
Unknown Object (File)
May 23 2023, 7:02 AM
Unknown Object (File)
Jan 6 2023, 8:59 PM
Subscribers
None

Details

Summary

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

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mjg requested review of this revision.Jan 12 2021, 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. https://kib.kiev.ua/git/gitweb.cgi?p=deviant3.git;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.Jan 12 2021, 8:37 AM