4 ms·
Intel's GPUs aren't exactly known for stellar performance, but I'm pretty sure that's old info even for Intel. Certainly this kind of parsing hasn't been requir
by atq2119 8y ago
Intel's GPUs aren't exactly known for stellar performance, but I'm pretty sure that's old info even for Intel. Certainly this kind of parsing hasn't been required on AMD and Nvidia GPUs' 3D engines for almost ten years now.
- pcwalton 8y agoThere's still a good bit of it necessary even for new GPUs like Radeon R600. See r600_packet0_check, r600_packet3_check: https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/radeon/r600_cs.c https://github.com/torvalds/linux/blob/master/drivers/gpu/dr...
- rayiner 8y agoThanks for the very interesting references and discussion. GPUs are hard, huh? AFAIK, this sort of validation isn't necessary for NICs. (Question: why is parsing necessary to ensure security, instead of say relying on the IO-MMU?)
- atq2119 8y agoThe IO-MMU only provides device-level isolation for accesses to RAM, but you really need process isolation, and not just for accesses to RAM but also for VRAM where the IO-MMU is not in play at all. NICs are an unfair comparison because the commands for NICs are all generated by the kernel, which is trusted. For GPUs, commands are generated by an untrusted user space driver that translates OpenGL or Vulkan commands into command packets for the GPU. Those command packets contain memory addresses, so in order to achieve isolation between different user space processes in the face of a potentially malicious user space driver, the kernel used to have to validate those addresses in the absence of GPU page tables. Anyway, this kind of validation really hasn't been necessary for a long time now, despite pcwalton's outdated information, because GPU page tables were phased in around 2010. (The first AMD chip to have them was Cayman in 2010. Since we're citing kernel drivers here, take a look at https://github.com/torvalds/linux/blob/44786880df196a4200c178945c4d41675faf9fb7/drivers/gpu/drm/radeon/radeon_cs.c#L454 https://github.com/torvalds/linux/blob/44786880df196a4200c17... and note how the function skips any parsing when virtual memory is used.)
- deleted 8y ago[deleted]
- atq2119 8y agoR600 is not a new GPU, don't know how you got that idea :) It was released in 2007.