Commit 494d765
committed
Initialize vnet.ram unconditionally for device tree
When no network device is specified via -n option, the virtio-net device
was left uninitialized but still exposed to guest via device tree. This
caused segmentation fault when guest attempted to initialize the device.
Root cause analysis:
- WFI merge (e4ae87e) introduced conditional initialization:
if (netdev) { virtio_net_init(); vnet.ram = ram; }
- Previous code always set vnet.ram regardless of netdev
- Guest kernel initializes all devices in device tree
- Without vnet.ram pointer, QueueReady handler crashed accessing NULL1 parent 91a6d24 commit 494d765
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
777 | 781 | | |
778 | 782 | | |
779 | 783 | | |
780 | 784 | | |
781 | 785 | | |
782 | | - | |
783 | 786 | | |
784 | 787 | | |
785 | 788 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
362 | 366 | | |
363 | 367 | | |
364 | 368 | | |
| |||
0 commit comments