Page MenuHomeFreeBSD

bhyve nvme: Add Temperature Threshold support
ClosedPublic

Authored by chuck on Dec 19 2021, 4:17 PM.
Tags
None
Referenced Files
F110770959: D33572.id102095.diff
Sat, Feb 22, 10:11 PM
Unknown Object (File)
Sat, Feb 15, 10:22 PM
Unknown Object (File)
Jan 23 2025, 9:18 PM
Unknown Object (File)
Jan 20 2025, 7:59 AM
Unknown Object (File)
Jan 6 2025, 10:42 PM
Unknown Object (File)
Nov 23 2024, 3:14 PM
Unknown Object (File)
Nov 20 2024, 12:51 PM
Unknown Object (File)
Oct 20 2024, 6:53 PM

Details

Summary

This adds the ability for a guest OS to send Set / Get Feature,
Temperature Threshold commands. The implementation assumes a constant
temperature and will generate an Asynchronous Event Notification if the
specified threshold is above/below this value. Although the
specification allows 9 temperature values, this implementation only
implements the Composite Temperature.

While in the neighborhood, move the clear of the CSTS register in the
reset function after all other cleanup. This avoids a race with the
guest thinking the reset is complete (i.e. CSTS.RDY = 0) before the NVMe
emulation is actually complete with the reset.

Fixes UNH IOL 16.0 Test 1.7, cases 1, 2, and 4.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43485
Build 40373: arc lint + arc unit

Event Timeline

chuck requested review of this revision.Dec 19 2021, 4:17 PM

Do we need to keep the first temperature warning timestamp? Later we can calculate the following warning time in the healthy log.
Warning Temp Composite Time:
Error Temp Composite Time:

usr.sbin/bhyve/pci_nvme.c
1694

uint8_t for tmpsel is enough.

1706

how about ((thsel != NVME_TEMP_THRESH_OVER) && (thsel != NVME_TEMP_THRESH_UNDER)) for easy understanding?

allanjude added inline comments.
usr.sbin/bhyve/pci_nvme.c
685

This changes the value from 310 to 296, is that intentional?

I like wanpengqian_gmail.com's suggestions as well.
310 vs 296 isn't a meaningful change. 37C vs 23C
Personally, I'd report 303 since that's 30C, but the actual number really doesn't matter.

usr.sbin/bhyve/pci_nvme.c
549

how are these numbers computed?

1068

seems unrelated, but good.

chuck added inline comments.
usr.sbin/bhyve/pci_nvme.c
549

NVMe 2.0, Figure 275 includes in the description for WCTEMP

It is recommended that implementations report a value of 0157h in this field.

685

Yes, the change was intentional. Both values are arbitrary, but 296 is room temperature, which I liked better.

usr.sbin/bhyve/pci_nvme.c
1706

No, because unsupported TMPSEL values need to return an error.

usr.sbin/bhyve/pci_nvme.c
1706

sorry, I mean this part ' (thsel > NVME_TEMP_THRESH_UNDER)'
first time I read it I have to check specification to find out what it means. Its fine, I understand now.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 29 2022, 11:18 PM
This revision was automatically updated to reflect the committed changes.