pci_p2pmem_virt_to_bus(9)
π« pci_p2pmem_virt_to_bus(9) β the Kernel API Manual glow-up π«
Okay bestie, so this one lives in the Kernel API Manual (section 9, kernel-town energy π), and it's literally the little helper that hands you back a PCI bus address when all you've got is a virtual address. No cap.
β¨ NAME β¨
pci_p2pmem_virt_to_bus β returns the PCI bus address for a given virtual address that you got from pci_alloc_p2pmem(). That's it, that's the whole vibe π
π¦ SYNOPSIS π¦
pci_bus_addr_t pci_p2pmem_virt_to_bus (struct pci_dev *pdev , void *addr );
Look at her. Short, iconic, knows what she wants π€
πΈ ARGUMENTS πΈ
pdevβ the device the memory was allocated from. Like, the actual origin story of this memory, bestie πaddrβ address of the memory that was allocated. The virtual one. The one you're holding rn π
π«Ά SEE ALSO π«Ά
The whole friend group lives in the kernel file ./drivers/pci/p2pdma.c β go say hi to all of them:
pcim_p2pdma_init(9)pcim_p2pdma_provider(9)pci_p2pdma_add_resource(9)pci_p2pdma_distance_many(9)pci_has_p2pmem(9)pci_p2pmem_find_many(9)pci_alloc_p2pmem(9)pci_free_p2pmem(9)pci_p2pmem_alloc_sgl(9)pci_p2pmem_free_sgl(9)pci_p2pmem_publish(9)pci_p2pdma_map_type(9)pci_p2pdma_enable_store(9)pci_p2pdma_enable_show(9)
Fr fr: if you didn't get your virtual address from pci_alloc_p2pmem(), this function is not the moment. Read the NAME section again, iykyk π
And that's the page, diva π Straight outta ./drivers/pci, dated October 2026, served fresh from the Kernel API Manual β slay responsibly, and may all your bus addresses be correct the first time π§β
π¦ 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