Chapter 13: Troubleshooting Guide
Chapter 13: Troubleshooting Guide
Operating multi-kernel bare-metal systems introduces complex failure modes spanning firmware handoffs, IOMMU translation failures, PCIe reset issues, and cross-kernel resource contention. This chapter provides an evidence-based diagnostic guide to resolve the most common and challenging failure scenarios.
Boot Failures and Recovery
Symptom: Secondary Kernel Freezes on Early Boot
- Diagnosis: The secondary kernel hangs immediately after decompression with no output on the console.
- Root Cause: Console output is directed to a virtual VGA or serial port that is unmapped in the VMM configuration, or ACPI power tables conflict with guest direct boot.
- Fix: Add
earlyprintk=serial,ttyS0,115200 console=ttyS0 keep_bootconto the guest kernel command line. Ensure QEMU includes-serial mon:stdio -nographic. If ACPI hangs, test withacpi=offto isolate ACPI table parsing bugs.
Symptom: Host Panics During Kernel Boot with isolcpus
- Diagnosis: Host kernel enters a panic or hangs during SMP bringup when
isolcpusornohz_fullis specified. - Root Cause: Core 0 (the primary bootstrap processor - BSP) was inadvertently included in the isolation mask.
- Fix: Core 0 must always remain a housekeeping core. Ensure isolation ranges begin at Core 1 or higher (e.g.,
isolcpus=domain,managed_irq,16-31).
Device Assignment and VFIO Issues
Symptom: Device is ineligible for IOMMU domain attach
- Diagnosis: QEMU fails to start with error:
Failed to assign device: Device is ineligible for IOMMU domain attach due to other devices in group. - Root Cause: The PCIe device belongs to an IOMMU group containing other devices (e.g., PCIe root ports or onboard audio) that are still bound to host drivers.
- Fix: Check
ls /sys/bus/pci/devices/<pci_id>/iommu_group/devices/. Either bind every device in that group tovfio-pci, install the device into an ACS-isolated PCIe slot directly connected to the CPU root complex, or enable PCIe ACS override patches (for lab/testing environments only).
Symptom: PCIe Device Fails Function-Level Reset (FLR)
- Diagnosis: Guest reboots fail with
Device failed to reset after FLR; device will be marked dead. - Root Cause: The physical PCIe controller does not implement standard PCIe FLR, or retains internal state across resets (common on certain AMD GPUs and RAID controllers).
- Fix: Use vendor-specific reset quirks (e.g.,
vendor-resetkernel module for AMD GPUs) or configure secondary bus reset (SBR) viasetpci.
Networking Problems
Symptom: Asymmetric Routing or Dropped Packets on Inter-Kernel Bridge
Diagnosis: Secondary kernel can ping host, but host cannot ping secondary kernel; or high packet drop rate under load.
Root Cause: Netfilter/iptables rules on the host are filtering bridge traffic via the
br_netfiltermodule, or MTU mismatches exist between tap interface and bridge.Fix:
# Disable bridge netfilter packet mangling sudo sysctl -w net.bridge.bridge-nf-call-iptables=0 sudo sysctl -w net.bridge.bridge-nf-call-ip6tables=0 # Ensure matching MTUs across bridge and tap sudo ip link set dev br-internal mtu 9000 sudo ip link set dev tap0 mtu 9000
Performance Degradation Diagnosis
Symptom: Unexplained High Latency Jitter (P99 Spikes)
- Diagnosis: Real-time tasks running in the secondary kernel experience 50µs+ latency spikes.
- Investigation Steps:
- Check for unexpected VM-exits using
perf kvm stat live. Look for excessiveCR3_LOAD(TLB flushes) orIO_INSTRUCTIONexits. - Verify that SMT sibling threads are not running unpinned host workloads.
- Verify that
irqbalanceis not sending physical interrupts to isolated cores. - Check for Intel Turbo Boost frequency throttling or CPU C-state sleep transitions. Force C-state limiting with
intel_idle.max_cstate=1 processor.max_cstate=1.
- Check for unexpected VM-exits using
Kernel Panics and Crashes
Symptom: Host Freezes During Secondary Kernel Shutdown
- Diagnosis: The entire physical server locks up when stopping a secondary kernel instance.
- Root Cause: A passed-through PCIe device issued a DMA transaction to an unmapped host physical address immediately after the guest tore down its memory tables.
- Fix: Update motherboard BIOS/firmware to resolve IOMMU DMAR bugs. Verify that the host kernel command line includes
iommu=ptto ensure physical translation bypass is enabled for host devices.
Resource Exhaustion
Symptom: Cannot allocate memory When Allocating Hugepages
- Diagnosis: Attempting to allocate static 1GB hugepages fails even though
free -mreports sufficient free RAM. - Root Cause: Memory fragmentation has broken contiguous physical memory blocks required for 1GB allocations.
- Fix: Pre-allocate hugepages at boot time via the kernel command line (
hugepagesz=1G default_hugepagesz=1G hugepages=64) before physical memory becomes fragmented.