ensure_nib_shared(9)
π ensure_nib_shared(9) β the kernel API manual, bestie edition
okay so this whole page lives in the Kernel API Manual and it's literally all about ensure_nib_shared(9). buckle up π
β¨ NAME β¨
ensure_nib_shared β bestie, it makes sure the address of the NIB is secure and shared. that's the whole vibe check π₯
πΈ SYNOPSIS πΈ
int ensure_nib_shared (unsigned long addr );
π¦ ARGUMENTS π¦
addrβ the physical (absolute) address of the NIB. like, the actual literal address, not a vibe. π
π DESCRIPTION π
so this function checks whether the NIB page β which has been pinned with vfio_pin_pages β is a shared page belonging to a secure guest. π
it will call uv_pin_shared on it. and if the page was already pinned shared (i.e. if the NIB belongs to a secure guest and is shared), then 0 (success) is returned. slay. β¨
but if the NIB was not shared, then vfio_pin_pages had exported it and now it does not belong to the secure guest anymore π in that case, an error is returned. no cap, that's the sad path.
π«Ά CONTEXT π«Ά
the NIB (at physical address addr) has to be pinned with vfio_pin_pages before calling this function. like, do the pinning first, then come talk to me. π
fr fr bestie, pinned first or this whole thing is giving undefined chaos π
β RETURN β
0 in case of success, otherwise an error < 0. that's it, that's the whole report card. π
π SEE ALSO π
kernel file ./drivers/s390/crypto/vfio_ap_ops.c β go read the source, iykyk π
get_update_locks_for_kvm(9)release_update_locks_for_kvm(9)get_update_locks_for_mdev(9)release_update_locks_for_mdev(9)get_update_locks_by_apqn(9)get_update_locks_for_queue(9)vfio_ap_mdev_get_queue(9)vfio_ap_wait_for_irqclear(9)vfio_ap_free_aqic_resources(9)vfio_ap_irq_disable(9)vfio_ap_validate_nib(9)vfio_ap_irq_enable(9)vfio_ap_le_guid_to_be_uuid(9)handle_pqap(9)vfio_ap_mdev_verify_no_sharing(9)vfio_ap_mdev_validate_masks(9)assign_adapter_store(9)vfio_ap_mdev_unlink_adapter(9)unassign_adapter_store(9)assign_domain_store(9)unassign_domain_store(9)assign_control_domain_store(9)unassign_control_domain_store(9)vfio_ap_mdev_set_kvm(9)vfio_ap_mdev_unset_kvm(9)vfio_ap_mdev_resource_in_use(9)vfio_ap_mdev_hot_unplug_cfg(9)vfio_ap_mdev_cfg_remove(9)vfio_ap_mdev_on_cfg_remove(9)vfio_ap_filter_apid_by_qtype(9)vfio_ap_mdev_cfg_add(9)vfio_ap_mdev_on_cfg_add(9)vfio_ap_on_cfg_changed(9)
okay and for the cute sign-off π: this whole thing comes from the kernel file ./drivers/s390/crypto, dated October 2026, and it's filed under ensure_nib_shared(9). mwah, go pin some pages bestie ππ§
π¦ 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