pvr_device_a...ze_are_valid(9)
π pvr_device_a...ze_are_valid(9) π
Okay so bestie, welcome to the Kernel API Manual β this one's about pvr_device_addr_and_size_are_valid, and likeβ¦ the name literally spoils the whole plot but stay with me, it's actually a cute little corner-case baddie π
β¨ NAME β¨
pvr_device_addr_and_size_are_valid β it's the vibe-check function that tests whether a device-virtual address and its associated size are both valid. Two-for-one. A little duo. Periodt π
π¦ SYNOPSIS π¦
bool pvr_device_addr_and_size_are_valid (struct pvr_vm_context *vm_ctx ,
u64 device_addr , u64 size );
πΈ ARGUMENTS πΈ
vm_ctxβ the target VM context. Like, the whole scene this function is operating in, y'know? πdevice_addrβ the virtual device address you want to test, bestie.sizeβ the size of the range based atdevice_addrthat you're testing. It's giving "how much are we checking here" energy β¨
π§ DESCRIPTION π§
So here's the tea β β the obvious move is to call pvr_device_addr_is_valid twice: once on size, and again on device_addr + size. And honestly? It seems intuitive. Like, it lowkey looks correct. But it's NOT, because it produces a false-negative when the address range is right at the end of device-virtual address space ππ
This function catches that corner case β it's the main character that swoops in β and it also checks that size is non-zero. Two jobs. One icon π
π₯ RETURN π₯
trueifdevice_addris device page aligned; andsizeis device page aligned; and the range specified bydevice_addrandsizeis within the bounds of the device-virtual address space; andsizeis non-zero β like, all four, no skipping, okay? β orfalseotherwise π«Ά
π SEE ALSO π
Kernel file ./drivers/gpu/drm/imagination/pvr_vm.c β and honestly the whole friend group:
Memory context(9)struct pvr_vm_context(9)pvr_vm_get_page_table_root_addr(9)pvr_vm_get_dma_resv(9)Memory mappings(9)struct pvr_vm_gpuva(9)struct pvr_vm_bind_op(9)pvr_vm_bind_op_exec(9)pvr_vm_gpuva_map(9)pvr_vm_gpuva_unmap(9)pvr_vm_gpuva_remap(9)pvr_device_addr_is_valid(9)pvr_vm_create_context(9)pvr_vm_context_release(9)pvr_vm_context_lookup(9)pvr_vm_context_put(9)pvr_destroy_vm_contexts_for_file(9)pvr_vm_map(9)pvr_vm_unmap_obj_locked(9)pvr_vm_unmap_obj(9)pvr_vm_unmap(9)pvr_vm_unmap_all(9)pvr_heap_contains_range(9)pvr_find_heap_containing(9)pvr_vm_find_gem_object(9)pvr_vm_get_fw_mem_context(9)
Fr fr, that's the whole page. No cap. The address-range girly is valid or she isn't, and now you know exactly what "valid" means in this context π
And that's a wrap, bestie! π This gem came to you straight from ./drivers/gpu/drm/imagination and it's dated October 2026 β bookmark it, screenshot it, put it on your vision board π 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