ENUM NE_PCI_DEV_CMD_TYPE(9)
πΈ enum ne_pci_dev_cmd_type β a Kernel API Manual moment π
okay so bestie, we're looking at enum ne_pci_dev_cmd_type from the Kernel API Manual, and honestly? it's giving "backstage pass to how the Nitro Enclaves PCI device talks to the kernel." every single command type lives in here, so let's go through them one by one, no skips, no cap π
β¨ NAME β¨
enum ne_pci_dev_cmd_type β the device command types. that's it, that's the whole vibe. every command the device can receive is chillin' in this one enum like a little roster π
π¦ SYNOPSIS π¦
enum ne_pci_dev_cmd_type {
INVALID_CMD ,
ENCLAVE_START ,
ENCLAVE_GET_SLOT ,
ENCLAVE_STOP ,
SLOT_ALLOC ,
SLOT_FREE ,
SLOT_ADD_MEM ,
SLOT_ADD_VCPU ,
SLOT_COUNT ,
NEXT_SLOT ,
SLOT_INFO ,
SLOT_ADD_BULK_VCPUS ,
MAX_CMD
};
lowkey a whole lineup, right? okay, now the lore behind each one π
π Constants π
INVALID_CMDβ the invalid command. it's the "this is not a real thing" entry, the placeholder of the group chat πENCLAVE_STARTβ starts an enclave, after you've set its resources. resources first, then start β order matters, bestie, don't come for me πENCLAVE_GET_SLOTβ gets the slot uid of an enclave. it's giving "who's your slot bestie" πͺͺENCLAVE_STOPβ terminates an enclave. dramatic but necessary πSLOT_ALLOCβ allocates a slot for an enclave. securing the spot β¨SLOT_FREEβ frees the slot allocated for an enclave. closure, periodt π¦SLOT_ADD_MEMβ adds a memory region to an enclave slot. memory room service π§SLOT_ADD_VCPUβ adds a vCPU to an enclave slot. one (1) vCPU, hand-delivered πSLOT_COUNTβ gets the number of allocated slots. the headcount πNEXT_SLOTβ gets the next slot in the list of allocated slots. scrolling to the next one β‘οΈSLOT_INFOβ gets the info for a slot, e.g. slot uid, vCPUs count. the full profile, iykyk π₯SLOT_ADD_BULK_VCPUSβ adds a number of vCPUs, not providing CPU ids. bulk mode, no ids needed, iconic βMAX_CMDβ a gatekeeper for the max possible command type. it's literally just standing there holding the door π―
π«Ά SEE ALSO π«Ά
okay so the kernel file for all this is ./drivers/virt/nitro_enclaves/ne_pci_dev.h, and the whole extended friend group is here β go say hi:
- Nitro Enclaves (NE) PCI device(9)
PCI_DEVICE_ID_NE(9)PCI_BAR_NE(9)- Device registers in the NE PCI device MMIO BAR(9)
NE_ENABLE(9)NE_VERSION(9)NE_COMMAND(9)NE_EVTCNT(9)NE_SEND_DATA(9)NE_RECV_DATA(9)- Device MMIO buffer sizes(9)
NE_SEND_DATA_SIZE(9)NE_RECV_DATA_SIZE(9)- MSI-X interrupt vectors(9)
NE_VEC_REPLY(9)NE_VEC_EVENT(9)- Device commands - payload structure for requests and replies.(9)
struct enclave_start_req(9)struct enclave_get_slot_req(9)struct enclave_stop_req(9)struct slot_alloc_req(9)struct slot_free_req(9)struct slot_add_mem_req(9)struct slot_add_vcpu_req(9)struct slot_count_req(9)struct next_slot_req(9)struct slot_info_req(9)struct slot_add_bulk_vcpus_req(9)struct ne_pci_dev_cmd_reply(9)struct ne_pci_dev(9)ne_do_request(9)
ngl if you're messing with these, read the friends too β the req/reply structs match up with the commands above, and that's the whole point π§
that's the page, bestie!! it lives at ./drivers/virt/nitro_enclaves, and this lil slice of documentation is dated October 2026 β enum ne_pci_dev_cmd_type(9), slaying in a man page near you πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms