Skip to content

Comments

nvme: add oxide-specific feature to expose read-only attribute for device#1060

Merged
luqmana merged 4 commits intomasterfrom
nvme-ro-feature
Feb 19, 2026
Merged

nvme: add oxide-specific feature to expose read-only attribute for device#1060
luqmana merged 4 commits intomasterfrom
nvme-ro-feature

Conversation

@luqmana
Copy link
Contributor

@luqmana luqmana commented Feb 13, 2026

Along with oxidecomputer/edk2#4 this fixes #1059.

)
}

cmds::FeatureIdent::OxideDeviceFeatures => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few notes on validation here that I think we want to check:

  • cdw11 is used by features to control behavior on a per-feature basis. I would like to see us constrain this to be zero and drop an error if not so we can add additional behavior over time.
  • I don't see any logic checking the value of the CDW10 feature selector. Is that somewhere I missed? It looks like that's being dropped in AdminCmd::parse. Doesn't have to be fixed in this change, but probably should be a follow up for us there.
  • I think it's okay that we're not checking the data pointer since the spec says it's ignored when the feature doesn't use it, which means it can have garbage.
  • I feel less confident in cdw14 with feature by uuid, but I think it's probably okay in spirit.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One other thing now that I looked more closely here, it looks like we're going to commit to returning the same data regardless of namespace id. I think I'm fine with that, but just want to confirm that intent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • cdw11 is used by features to control behavior on a per-feature basis. I would like to see us constrain this to be zero and drop an error if not so we can add additional behavior over time.

Added a check here specifically and opened #1061 to look at constraining the other features.

  • I don't see any logic checking the value of the CDW10 feature selector. Is that somewhere I missed? It looks like that's being dropped in AdminCmd::parse. Doesn't have to be fixed in this change, but probably should be a follow up for us there.

We're only advertising 1.0 support so that is there today.

One other thing now that I looked more closely here, it looks like we're going to commit to returning the same data regardless of namespace id. I think I'm fine with that, but just want to confirm that intent.

Yes, although now I'm wondering if it's worth constraining one way or the other in the same vein as rejecting non-zero cdw11. Not a huge difference either way since we only support a single namespace today anyways.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, although now I'm wondering if it's worth constraining one way or the other in the same vein as rejecting non-zero cdw11. Not a huge difference either way since we only support a single namespace today anyways.

Well, it's the distinction between using namespace id 0 being that it isn't valid or in the future using the broadcast namespace. I think I agree that we can change this in the future. I ultimately convinced myself it was probably fine last time I was looking at it. Ultimately we're the only consumer right now so it's okay to change htis if need be.

cmds::Completion::generic_err(STS_INVAL_FIELD)
} else {
cmds::Completion::success_val(
cmds::OxideDeviceFeatures(0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll defer to someone else on the change in construction from using .into() to the current construction. For my own edification, why did that change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to match other similar bitstruct-defined structures (like FeatTemperatureThreshold) and better mirrors the definition on the edk2 side as well.

commit = "8c60ff4c271b0442b9a506a5cf9eab04cd5554aa"
artifact = "OVMF_CODE.fd"
sha256 = "ff12d5cb021e34447b44301f70434e861b07d2779c16abe2f2efef49ff02fffb"
sha256 = "9ce2266aaefb671a1977ddabb5155f8235be134f797e6c831abeb6c97c705569"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this update is to pull in a bootrom with oxidecomputer/edk2#4? But when I looked at the SHAs for the buildomat jobs there they didn't match these. Am I looking in the wrong place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was waiting for the buildomat job to finish and forgot to push up the latest update referencing the merged PR. Should all match now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks! I'm eager to test this out :D

@luqmana luqmana merged commit 36f20be into master Feb 19, 2026
12 checks passed
@luqmana luqmana deleted the nvme-ro-feature branch February 19, 2026 15:27
luqmana added a commit to oxidecomputer/omicron that referenced this pull request Feb 19, 2026
Pulls in fix for booting from read-only disk:

- nvme: add oxide-specific feature to expose read-only attribute for device (oxidecomputer/propolis#1060).
luqmana added a commit to oxidecomputer/omicron that referenced this pull request Feb 20, 2026
Pulls in fix for booting from read-only disk:

- oxidecomputer/propolis#1060
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

instances with read-only boot disk fail to boot

3 participants