Page MenuHomeFreeBSD

acpi_spmc(4): Gracefully support only the Microsoft DSM
ClosedPublic

Authored by olce on Mon, May 4, 8:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 28, 7:07 PM
Unknown Object (File)
Wed, May 27, 2:49 AM
Unknown Object (File)
Tue, May 26, 11:17 PM
Unknown Object (File)
Tue, May 26, 11:10 PM
Unknown Object (File)
Tue, May 26, 8:17 PM
Unknown Object (File)
Tue, May 26, 8:11 PM
Unknown Object (File)
Tue, May 26, 6:29 PM
Unknown Object (File)
Tue, May 26, 6:21 PM
Subscribers

Details

Summary

In acpi_spmc_get_constraints(), stop assuming that if there is no AMD
DSM, then the Intel one is present. Although this is likely to be the
overwhelming majority of cases on amd64, there is no technical reason
nor constraint in our code that really needs assuming that. On (so far
hypothetical) machines with only the Microsoft DSM, this assumption
would cause a cryptic and irrelevant error message (and, prior to the
previous commit, a panic on INVARIANTS).

Warn the user if both the Intel and AMD DSMs are present, and use the
constraints reported by the Intel one (see the comment for why).

Diff Detail

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

Event Timeline

olce requested review of this revision.Mon, May 4, 8:32 PM
This revision is now accepted and ready to land.Thu, May 7, 2:38 AM
olce edited the summary of this revision. (Show Details)
  • Tolerate the presence of both AMD and Intel DSMs by favoring Intel's (should never happen).
  • Mention that min_d_state is a single field for a piece of information provided by both, so we cannot store constraints from both (that's not the only reason though, and I might update the text again on commit).
This revision now requires review to proceed.Thu, May 7, 8:11 PM
obiwac added inline comments.
sys/dev/acpica/acpi_spmc.c
612–614

maybe a comment to tell the user to check if hell has frozen over ;)

618

in this situation, maybe we wanna have get_constraints_succeeded compile on non-INVARIANTS, and then just return early from acpi_spmc_check_constraints() if this is false? in case we just have the microsoft dsm

This revision is now accepted and ready to land.Mon, May 11, 8:59 AM
sys/dev/acpica/acpi_spmc.c
618

I know currently this will still work because sc->constraints_count == 0, but then since violation == false, it will print that the constraints are respected. We should probably just not print anything in that situation

olce marked 3 inline comments as done.Mon, May 11, 4:10 PM
olce added inline comments.
sys/dev/acpica/acpi_spmc.c
612–614

Ha ha

618

I see, but then it seems a bit more useful to just handle the sc->constraints_count == 0 instead, in case some firmware manufacturer does not report any constraints. Going to add an early bail out to the relevant commit.

olce marked 2 inline comments as done.Mon, May 11, 4:10 PM

Impacts of changes in earlier revisions, no real change.

This revision now requires review to proceed.Tue, May 12, 1:35 PM
This revision is now accepted and ready to land.Tue, May 12, 2:10 PM