ne_donated_cpu(9)
π ne_donated_cpu(9) β a Kernel API Manual moment
Okay bestie, so this whole page is about ne_donated_cpu(9) β yes, that's the manual section 9, kernel API vibes only β and it's literally just one little function that answers a very specific question: is this CPU already being used by the enclave or not? That's it. That's the whole gig. And honestly? Iconic. π
πΈ NAME πΈ
ne_donated_cpu β check if the provided CPU is already used by the enclave.
Like, it's a vibe check for CPUs. Is this core taken? Yes or no. Go. β¨
π¦ SYNOPSIS π¦
bool ne_donated_cpu (struct ne_enclave *ne_enclave , unsigned int cpu );
No cap, that's the whole signature. It returns a bool and takes two things. We'll get into them right now. π
π ARGUMENTS π
ne_enclaveβ the private data associated with the current enclave. Basically the enclave's little personal diary of state, and you're handing over the pointer to it. π«Άcpuβ the CPU you want to check, i.e. the one you're asking "hey, are you already used?" about.
β¨ CONTEXT β¨
Process context, bestie. And listen β this function is called with the ne_enclave mutex held. So like, don't go calling it wherever, the mutex has to already be in your hands. That's the whole rule. π
π₯ RETURN π₯
Trueif the provided CPU is already used by the enclave.Falseotherwise.
Two outcomes. Binary. Main character energy. β β
π SEE ALSO π
Buckle up, because this list is long and we're keeping every single one, no skipping, fr fr. π
- Kernel file
./drivers/virt/nitro_enclaves/ne_misc_dev.cEnclave lifetime management driver for Nitro Enclaves (NE).(9) NE_CPUS_SIZE(9)NE_EIF_LOAD_OFFSET(9)NE_MIN_ENCLAVE_MEM_SIZE(9)NE_MIN_MEM_REGION_SIZE(9)NE_PARENT_VM_CID(9)struct ne_cpu_pool(9)struct ne_phys_contig_mem_regions(9)ne_check_enclaves_created(9)ne_setup_cpu_pool(9)ne_teardown_cpu_pool(9)ne_set_kernel_param(9)ne_get_unused_core_from_cpu_pool(9)ne_set_enclave_threads_per_core(9)ne_get_cpu_from_cpu_pool(9)ne_get_vcpu_core_from_cpu_pool(9)ne_check_cpu_in_cpu_pool(9)ne_add_vcpu_ioctl(9)ne_sanity_check_user_mem_region(9)ne_sanity_check_user_mem_region_page(9)ne_sanity_check_phys_mem_region(9)ne_merge_phys_contig_memory_regions(9)ne_set_user_memory_region_ioctl(9)ne_start_enclave_ioctl(9)ne_enclave_ioctl(9)ne_enclave_remove_all_mem_region_entries(9)ne_enclave_remove_all_vcpu_id_entries(9)ne_pci_dev_remove_enclave_entry(9)ne_enclave_release(9)ne_enclave_poll(9)ne_create_vm_ioctl(9)ne_ioctl(9)
Okay so real talk: this function is only meaningful in process context and while holding the ne_enclave mutex. Not optional, bestie. Don't come for me if you skip that. π
And that's the page! π§ This little love letter lives over at ./drivers/virt/nitro_enclaves, dated October 2026 β go check the source if you want the full lore, iykyk. Byeee ππ¦
π¦ 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