Page MenuHomeFreeBSD

bhyve nvme: Add Temperature Threshold support
ClosedPublic

Authored by chuck on Dec 19 2021, 4:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 20, 6:53 PM
Unknown Object (File)
Oct 3 2024, 11:34 PM
Unknown Object (File)
Oct 3 2024, 11:34 AM
Unknown Object (File)
Oct 3 2024, 8:46 AM
Unknown Object (File)
Oct 3 2024, 7:20 AM
Unknown Object (File)
Oct 3 2024, 6:05 AM
Unknown Object (File)
Sep 28 2024, 7:32 AM
Unknown Object (File)
Sep 19 2024, 8:10 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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
1707

uint8_t for tmpsel is enough.

1719

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
669

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
533

how are these numbers computed?

1047

seems unrelated, but good.

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

NVMe 2.0, Figure 275 includes in the description for WCTEMP

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

669

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

usr.sbin/bhyve/pci_nvme.c
1719

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

usr.sbin/bhyve/pci_nvme.c
1719

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.