Hello

On June 11, 2025 3:07:02 PM GMT+02:00, Konrad Neuwirth <[email protected]> 
wrote:
>Any takers? 
>

I didnt want to answer since I am not completely confident in this area, but 
here we go:

I think that what you're trying to achieve is impossible. The hardware is still 
there, something needs to manage it through the drivers that support it. Linux 
libre doesn't contain nonfree firmware, thats the most problematic part. 
Something still needs to load it, doesn't matter whether you passthrough it or 
not. 

I see these conceptual cases (not saying all of them are supported by the sw) 
- base os manages the card, loads firmware etc. 
- qemu does it
- guest os does it

I dont think qemu supports that, but if it did, it would still need the unfree 
firmware that is not part of guix. 

Additionally I think that what you're doing is basically the third case here - 
passing through the hw completely to be managed by the gues os. That means the 
guest os would have to manage the hw completely, including load of the fw. 

Please anyone do feel free to correct me
Rutherther 

>Okay. I seem to be making progress, but I’m still a neophyte. 
>
>I have a Asus NUC that contains an Intel Wifi/Ethernet chip that linux-libre 
>refuses to configure. So that’s what I am aiming at exposing straight to a 
>QEMU virtual machine that can then do what it wants with that interface (run 
>it as a networking interface.) 
>
>I’ve added what I take to be the configuration for vfio-pci to immediately 
>grab the PCI device: 
>
>(kernel-arguments
>      (append '("vfio-pci.ids=0x8086.0x7e40" "iommu=pt" "intel_iommu=on" 
> "rd.driver.blacklist=iwlwifi")
>        %default-kernel-arguments))
>
>(initrd-modules (cons* "vfio_pci" "vfio" "vfio_iommu_type1"
>                     %base-initrd-modules))
>
>vfio-pci exists, but when I boot, the device is still controlled by iwlwfi: 
>
>00:14.3 Network controller [0280]: Intel Corporation Meteor Lake PCH CNVi WiFi 
>[8086:7e40] (rev 20)
>      DeviceName: Onboard - Ethernet
>      Subsystem: Intel Corporation Wi-Fi 6E AX211 160MHz [8086:0094]
>      Flags: fast devsel, IRQ 18, IOMMU group 12
>      Memory at 5020314000 (64-bit, non-prefetchable) [size=16K]
>      Capabilities: [c8] Power Management version 3
>      Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
>      Capabilities: [40] Express Root Complex Integrated Endpoint, MSI 00
>      Capabilities: [80] MSI-X: Enable- Count=16 Masked-
>      Capabilities: [100] Latency Tolerance Reporting
>      Capabilities: [164] Vendor Specific Information: ID=0010 Rev=0 Len=014 
> <?>
>      Kernel modules: iwlwifi
>
>But when I run dpdk-devbind.py --bind=vfio-pci 0000:00:14.3, it changes: 
>
>00:14.3 Network controller [0280]: Intel Corporation Meteor Lake PCH CNVi WiFi 
>[8086:7e40] (rev 20)
>      DeviceName: Onboard - Ethernet
>      Subsystem: Intel Corporation Wi-Fi 6E AX211 160MHz [8086:0094]
>      Flags: fast devsel, IRQ 18, IOMMU group 12
>      Memory at 5020314000 (64-bit, non-prefetchable) [size=16K]
>      Capabilities: [c8] Power Management version 3
>      Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
>      Capabilities: [40] Express Root Complex Integrated Endpoint, MSI 00
>      Capabilities: [80] MSI-X: Enable- Count=16 Masked-
>      Capabilities: [100] Latency Tolerance Reporting
>      Capabilities: [164] Vendor Specific Information: ID=0010 Rev=0 Len=014 
> <?>
>      Kernel driver in use: vfio-pci
>      Kernel modules: iwlwifi
>
>As I want this all to happen at boot time — qemu should also be starting at 
>boot time, this will be the next Fun Challenge — what am I missing? Why is the 
>device not being appropriately controlled by vfio-pci? 
>

For starting stuff at boot time, you can use shepherd services. You can just 
call qemu inside of it. You can also look up the childhurd services for 
inspiration. I dont think there are services in Guix for running arbitrary vms 
using Guile. 

For this specific case if you found out how to get the wifi working with a 
qemu, you would probably also want to make it a service called networking. Then 
other services could depend on it to get the network running prior to them 
starting. 

>I’d also take a solution that actually uses dpdk-devbind.py on boot, but I 
>can’t even get that to work on my own. 
>
>
>
>
>
>> Am 03.06.2025 um 10:18 schrieb Rutherther <[email protected]>:
>> 
>> Konrad Neuwirth <[email protected]> writes:
>> 
>>> The build log says: 
>>> 
>>> Backtrace:
>>>        8 (primitive-load "/gnu/store/g942gqcbxkmjm8536kg2j4sl7ay?")
>>> In ice-9/eval.scm:
>>> 619:8  7 (_ #f)
>>> 626:19  6 (_ #<directory (guile-user) 7ffff7812c80>)
>>> 293:34  5 (_ #(#<directory (guile-user) 7ffff7812c80> #<procedu?>))
>>> In srfi/srfi-1.scm:
>>> 586:29  4 (map1 _)
>>> 586:29  3 (map1 _)
>>> 586:29  2 (map1 _)
>>> 586:17  1 (map1 ("vfio_virqfd" "ahci" "usb-storage" "uas" "usb?" ?))
>>> In gnu/build/linux-modules.scm:
>>> 278:5  0 (_)
>>> 
>>> gnu/build/linux-modules.scm:278:5: kernel module not found "vfio_virqfd" 
>>> "/gnu/store/wi539xkgd3mj07as4hv4n3jsxzmpd3pl-linux-libre-6.14.8/lib/modules”
>> 
>> This is expected, vfio_virqfd has been added to vfio module starting
>> Linux 6.2.
>> 
>> Rutherther
>
>
>
>

Reply via email to