[vmm] patch for nvidia pci passthru on releng/15
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 09 Dec 2025 19:49:18 UTC
Hello!
When I updated from 14.3 to 15.0, my nvidia 5090 passthru to an Ubuntu
guest broke (nvidia-smi on the guest returns "no devices"). Emitted to
the host's dmesg:
ivhd0: EVT INTR 0 Status:0x1a EVT Head:0x0 Tail:0x10]
[CMD Total 0x42] Tail:0x420, Head:0x420.
ivhd0: [Event0: Head:0x0 Tail:0x10]
[IO_PAGE_FAULT EVT: devId:0x100 DomId:0x1 Addr:0x1271c0000 0x0]
(The Ubuntu guest is configured with 32GB of RAM. I later noted that it
works correctly when the value is set less than VM_LOWMEM_LIMIT.)
git bisect indicated the first bad commit was 08c7dd2f
After some trial and error, I added printfs to vm_mmap_memseg to see if
there was any difference in the working/bad versions, and there was:
when splitting a segment mapping, the previous working version would
first map the higher, then the lower. The broken version swapped the
ordering:
## WORKING ##
vmm: mmap{gpa=4294967296, segid=0, segoff=4294967296, len=31138512896}
vmm: mmap{gpa=0, segid=0, segoff=0, len=3221225472}
vmm: mmap{gpa=4291313664, segid=8, segoff=13123584, len=3653632}
vmm: mmap{gpa=4278190080, segid=8, segoff=0, len=4096}
vmm: mmap{gpa=3288334336, segid=9, segoff=0, len=33554432}
## BROKEN ##
vmm: mmap{gpa=0, segid=0, segoff=0, len=3221225472}
vmm: mmap{gpa=4294967296, segid=0, segoff=3221225472, len=31138512896}
vmm: mmap{gpa=4291313664, segid=8, segoff=13123584, len=3653632}
vmm: mmap{gpa=4278190080, segid=8, segoff=0, len=4096}
vmm: mmap{gpa=3288334336, segid=9, segoff=0, len=33554432}
Putting the ordering back (patch attached) fixes the problem for me. I
don't know why.
I do note that the segoff is also different between working/broken, but
am trying not to think about it. I am a humble web programmer, lost and
afraid.
Thanks!