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)
Thu, Dec 5, 6:32 PM
Unknown Object (File)
Nov 14 2024, 12:34 AM
Unknown Object (File)
Oct 2 2024, 6:13 PM
Unknown Object (File)
Oct 2 2024, 8:03 AM
Unknown Object (File)
Oct 1 2024, 6:54 AM
Unknown Object (File)
Sep 26 2024, 3:56 PM
Unknown Object (File)
Sep 25 2024, 7:18 AM
Unknown Object (File)
Sep 25 2024, 5:16 AM
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