Hello, Thanks for the detailed results and the test program. This reproduces the failure independently of rumpnet, and the 6 GiB guest satisfies every request below 2 GiB.
Could you try a single 8 KiB allocation as the first request after boot in the 2 GiB guest? That would tell us whether the two-page request also fails without the preceding 4 KiB allocation. Could you also share the GNU Mach build or package version used for these runs so we can trace the allocation path in the matching source? Best regards, Alperen Erkan On Tue, Nov 24, 2026 at 7:36 AM Tristan <[email protected]> wrote: > Hi Alperen, > > Thanks for looking into this. > > The boundaries are the same in both runs; they are hardcoded in > rumpcomp_pci_dmalloc() (Debian's vm_allocate_contiguous_align patch): > > size = 65536, pmin = 0, pmax = 0x100000000, palign = 0x1000 > > To test smaller sizes, I wrote a small program that calls > vm_allocate_contiguous() directly with the same boundaries and > alignment, increasing the size from 4 KiB to 64 KiB. Each allocation > is kept (not freed) before the next one. Run as root right after boot, > on a Guix System x86_64 image in QEMU (-M q35): > > 2 GiB guest: > > size= 4096 pmin=0 pmax=0x100000000 align=0x1000 -> kr=0 pa=0x66c7e000 > size= 8192 pmin=0 pmax=0x100000000 align=0x1000 -> kr=6 pa=0 > size= 16384 pmin=0 pmax=0x100000000 align=0x1000 -> kr=6 pa=0 > size= 32768 pmin=0 pmax=0x100000000 align=0x1000 -> kr=6 pa=0 > size= 65536 pmin=0 pmax=0x100000000 align=0x1000 -> kr=6 pa=0 > > 6 GiB guest: > > size= 4096 pmin=0 pmax=0x100000000 align=0x1000 -> kr=0 pa=0x7ffba000 > size= 8192 pmin=0 pmax=0x100000000 align=0x1000 -> kr=0 pa=0x7ffbc000 > size= 16384 pmin=0 pmax=0x100000000 align=0x1000 -> kr=0 pa=0x7ff00000 > size= 32768 pmin=0 pmax=0x100000000 align=0x1000 -> kr=0 pa=0x7ff08000 > size= 65536 pmin=0 pmax=0x100000000 align=0x1000 -> kr=0 pa=0x7ff10000 > > So in the 2 GiB guest a single page works, but even an 8 KiB (two > page) contiguous allocation fails, while about 1.4 GiB is free. In the > 6 GiB guest everything succeeds, and the blocks come from just below > 2 GiB, i.e. the same DMA32 range. > > In rumpnet, the 64 KiB allocation is the first one wm(4) makes. In the > 2 GiB guest it fails (kr=6) and nothing else is allocated. In the > 6 GiB guest (same boot, after running the test program) rumpnet made > two allocations, both successful: > > OK size=65536 pmin=0 pmax=0x100000000 align=0x1000 -> pa=0x7ff20000 > OK size=4096 pmin=0 pmax=0x100000000 align=0x1000 -> pa=0x7ff1f000 > > The test program: > > #include <stdio.h> > #include <hurd.h> > #include <mach.h> > #include <mach/gnumach.h> > > int > main (void) > { > mach_port_t host; > > if (get_privileged_ports (&host, NULL)) > { > perror ("get_privileged_ports"); > return 1; > } > > for (vm_size_t size = 4096; size <= 65536; size *= 2) > { > vm_address_t va = 0; > rpc_phys_addr_t pa = 0; > kern_return_t kr = vm_allocate_contiguous (host, mach_task_self (), > &va, &pa, size, > 0, 0x100000000ULL, > 0x1000); > printf ("size=%6lu pmin=0 pmax=0x100000000 align=0x1000 -> kr=%d > pa=%#llx\n", > (unsigned long) size, kr, (unsigned long long) pa); > } > return 0; > } > > I'm happy to run more tests. > > Thanks, > Tristan > > El lun, 23 nov 2026 a la(s) 8:13 a.m., Alperen Erkan > ([email protected]) escribió: > > > > Hello Tristan, > > > > Could you share the physical address boundaries passed to the > `vm_allocate_contiguous()` > > function in both runs, as well as the physical address returned in the 6 > GiB run? In the 2 GiB > > guest system, does a single 4 KiB page allocation succeed when using the > same boundaries > > and alignment values? > > > > Kind regards, > > Alperen Erkan > > > > On Sun, Nov 22, 2026 at 4:34 PM Tristan <[email protected]> wrote: > >> > >> Hello, > >> > >> I've been trying to get networking working with rumpnet on 64-bit > >> GNU/Hurd, both in QEMU and on a real laptop (ThinkPad T400), and found > >> that it fails whenever the machine has less than 4 GB of RAM. > >> > >> When I start rumpnet, it finds the network card but gives up right > >> away: > >> > >> wm0 at pci0 dev 2 function 0, 64-bit DMA: Intel i82540EM 1000BASE-T > >> Ethernet (rev. 0x03) > >> wm0: unable to allocate TX control data, error = 1 > >> wm0: cannot allocate queues 1 > >> > >> If I give the same virtual machine more memory, it works: the card is > >> set up correctly and I can ping out. > >> > >> What I tried: > >> > >> - Debian GNU/Hurd amd64 in QEMU, about 2 GB of RAM: fails > >> - Guix System 64-bit image in QEMU, 2 GB of RAM: fails > >> - Guix System 64-bit image in QEMU, 6 GB of RAM: works > >> - ThinkPad T400 (Intel 82567LF), 2 GB of RAM: fails > >> > >> How to reproduce it in QEMU: > >> > >> qemu-system-x86_64 -enable-kvm -M q35 -m 2048 \ > >> -device e1000,netdev=net0 -netdev user,id=net0 \ > >> -hda debian-hurd-amd64.img > >> > >> Then, as root inside the VM: > >> > >> settrans -cfga /dev/rumpnet /hurd/rumpnet > >> > >> The error appears right away. Running the same thing with -m 6144 > >> instead of -m 2048 works. > >> > >> I added some logging to find out where it fails: the memory request > >> that fails is a 64 KB contiguous allocation below 4 GB, and > >> vm_allocate_contiguous() returns KERN_RESOURCE_SHORTAGE, even though > >> the VM has plenty of free memory at that point. > >> > >> The log line was (align is in hex, i.e. 4096 bytes): > >> > >> vm_allocate_contiguous(size=65536, align=1000, host=16): 6 > >> > >> I'm happy to test patches, in QEMU or on the T400. > >> > >> Thanks, > >> Tristan > >> >
