Page MenuHomeFreeBSD

smp_targeted_tlb_shootdown has to pin the CPU on i386
ClosedPublic

Authored by avg on Jan 21 2022, 7:36 AM.
Tags
None
Referenced Files
F103535163: D33980.diff
Tue, Nov 26, 5:23 AM
Unknown Object (File)
Tue, Oct 29, 6:39 PM
Unknown Object (File)
Oct 5 2024, 6:55 AM
Unknown Object (File)
Oct 5 2024, 6:54 AM
Unknown Object (File)
Oct 5 2024, 6:54 AM
Unknown Object (File)
Oct 5 2024, 6:34 AM
Unknown Object (File)
Sep 23 2024, 10:37 AM
Unknown Object (File)
Sep 22 2024, 8:01 PM
Subscribers

Details

Summary

This should fix a regression in 1820ca215461 which happened
because pmap -> shootdown contracts on amd64 and i386 diverged.
On amd64 the pmap code always pins the CPU before calling the shootdown
code and expects it to unpin on return.
On i386 the pmap code either has pins and unpinds around the shootdown
calls or does not pin at all.
This change should account for that difference.

In main and stable/13 the contracts are also different, but the
shootdown code is split into the i386 and amd64 variants and each
variant is tailored towards the platform's pmap.

PR: 261338
Reported by: Dmitry K. <thedix@yandex.ru>
Debugged by: Dmitry K. <thedix@yandex.ru>
Tested by: Dmitry K. <thedix@yandex.ru>
Fixes: 1820ca215461 MFC r368649 / 3fd989da by kib: amd64 pmap: fix PCID mode invalidations
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 44026
Build 40914: arc lint + arc unit

Event Timeline

avg requested review of this revision.Jan 21 2022, 7:36 AM
This revision is now accepted and ready to land.Jan 21 2022, 8:00 PM

Did you consider putting sched_pin() at the caller' side, same as on amd64?
I do not insist, just curios: IMO i386 on 12 ought to get as little efforts as possible.

In D33980#768547, @kib wrote:

Did you consider putting sched_pin() at the caller' side, same as on amd64?
I do not insist, just curios: IMO i386 on 12 ought to get as little efforts as possible.

As I commented in the bugzilla, many (most?) of i386 callers of the shootdown functions already pin and unpin around those calls.
But some do not.
I did not want to go combing for all cases, so I chose the most minimal change I could think of.

Maybe the change you suggest can be done a little bit later and in stable/12 only (no propagation to releng/12.*).