Page MenuHomeFreeBSD

cpu_auxmsr: assert caller is preventing CPU migration
ClosedPublic

Authored by adam_fenn.io on Aug 23 2020, 9:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 29, 11:26 AM
Unknown Object (File)
Mar 7 2024, 8:43 PM
Unknown Object (File)
Feb 25 2024, 12:18 PM
Unknown Object (File)
Feb 9 2024, 6:14 PM
Unknown Object (File)
Feb 9 2024, 6:14 PM
Unknown Object (File)
Dec 29 2023, 7:43 PM
Unknown Object (File)
Dec 23 2023, 3:55 AM
Unknown Object (File)
Dec 22 2023, 3:53 PM
Subscribers

Details

Test Plan

Peformed the following sanity-checks:

  • i386
    • Confirmed assertion is not triggered during boot of a 4-CPU system (a bhyve VM).
  • amd64
    • Confirmed assertion is not triggered during boot of a 4-CPU system (a VMWare VM).
    • Confirmed assertion is not triggered in the VM entry/exit code path (used an invocation of dtrace -f fbt:kernel:cpu_auxmsr to confirm this routine was, as expected, being called while a bhyve VM was running).

The resume codepaths were not sanity-checked, but, by inspection, these appear equally clear as contexts with interrupts disabled as the cases that were sanity-checked.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33127
Build 30489: arc lint + arc unit

Event Timeline

adam_fenn.io held this revision as a draft.
sys/amd64/amd64/initcpu.c
224

I suggest to trim this sentence to just

Caller should prevent CPU migration.
234

I am not sure the comment is useful. If somebody is using this in context that only prevents scheduling, e.g. in critical section, he should be qualified enough to change assert to accommodate new situation. Comment above the function gives enough clue, if needed.

236

Indent of contig lines should be +4 spaces, no alignment to opening braces. Also I believe the message could be made much shorter without loosing the information.

adam_fenn.io marked an inline comment as done.

Incorporate @kib's review feedback.

sys/amd64/amd64/initcpu.c
229

I suggest to write the message Context switch possible instead of interrupts enabled which just repeats the assert code. It is more to the point IMO.

230

Remove blank line.

This revision is now accepted and ready to land.Aug 23 2020, 11:44 PM

Thanks kib@, I can commit this.