Test-environment prerequisite (part 1 of 2): QEMU upstream hw/nvme does not emulate NVMe Boot Partitions, so the SRE boot and capsule-update flows cannot be exercised end-to-end in QEMU today. This issue tracks the read + firmware-update half on a local QEMU fork. The write-protection (BPWPS) half is tracked separately in the follow-up issue. Upstreaming both is deferred to a later issue.
Starting point: Gollu Appalanaidu's 2021 series "[PATCH v2 1/2] hw/nvme: add support for boot partitions" (https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg00138.html), which stalled after review feedback.
Scope (Iter 5):
- Rebase the 2021 v2 patch against current QEMU master (
hw/nvme/ctrl.c, hw/nvme/nvme.h, include/block/nvme.h, hw/nvme/trace-events).
- Replace the
g_malloc BP buffer with a BlockBackend backed by the bootpart= device property so BP contents persist across VM restart.
- BP read path: BPINFO / BPRSEL / BPMBL MMIO handling,
CAP.BPS = 1.
- Admin commands: Firmware Download (0x11) and Firmware Commit actions 0x6 (replace) / 0x7 (activate) targeting the boot partition.
- Fold in Stefan Hajnoczi's read-path review fixes from the 2021 thread:
- Bound memory allocation in the DMA read path.
- Check
BPINFO.BRS on BPMBL writes; ignore writes while a read is active (NVMe Base Spec §8.13).
- Save BP
aiocb on the controller struct; cancel on reset / unplug.
- Smoke-test manually:
qemu-img the BP backing file, boot a guest, dump BPRSEL contents.
Out of scope (tracked in follow-up):
- Set Features FID 0x11 (BPWPS) — the write-protection / lock semantic.
- VMState / live migration entries.
- Formal qtest coverage in
tests/qtest/nvme-test.c.
- Doc update in
docs/system/devices/nvme.rst.
- Upstreaming.
Unblocks #51, #52 (read path for WIM-to-RAM boot, FW Commit for capsule apply).
Does NOT unblock #49, #53 — those need BPWPS, in the follow-up.
Test-environment prerequisite (part 1 of 2): QEMU upstream
hw/nvmedoes not emulate NVMe Boot Partitions, so the SRE boot and capsule-update flows cannot be exercised end-to-end in QEMU today. This issue tracks the read + firmware-update half on a local QEMU fork. The write-protection (BPWPS) half is tracked separately in the follow-up issue. Upstreaming both is deferred to a later issue.Starting point: Gollu Appalanaidu's 2021 series "[PATCH v2 1/2] hw/nvme: add support for boot partitions" (https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg00138.html), which stalled after review feedback.
Scope (Iter 5):
hw/nvme/ctrl.c,hw/nvme/nvme.h,include/block/nvme.h,hw/nvme/trace-events).g_mallocBP buffer with aBlockBackendbacked by thebootpart=device property so BP contents persist across VM restart.CAP.BPS = 1.BPINFO.BRSonBPMBLwrites; ignore writes while a read is active (NVMe Base Spec §8.13).aiocbon the controller struct; cancel on reset / unplug.qemu-imgthe BP backing file, boot a guest, dump BPRSEL contents.Out of scope (tracked in follow-up):
tests/qtest/nvme-test.c.docs/system/devices/nvme.rst.Unblocks #51, #52 (read path for WIM-to-RAM boot, FW Commit for capsule apply).
Does NOT unblock #49, #53 — those need BPWPS, in the follow-up.