Skip to content

Commit 9e7ae02

Browse files
committed
vmm: exclude legacy serial port I/O ranges from PCI Root Complex _CRS
The PCI Root Complex ACPI _CRS (Current Resource Settings) was claiming the entire legacy I/O range 0x000-0xCF7, which includes the COM1-COM4 serial port addresses. This causes a resource conflict on Windows guests where Windows Device Manager shows: ACPI\PNP0501\0 - COM1, Problem Code 12 (CM_PROB_NORMAL_CONFLICT) Windows refuses to load drivers for devices when their I/O resources overlap with another device's claimed range. The serial port driver fails to load because the PCI Root Complex already claims 0x3F8-0x3FF. This patch splits the I/O range to exclude the legacy COM port addresses: - 0x000-0x2E7 (before COM4) - 0x400-0xCF7 (after COM1) The excluded range 0x2E8-0x3FF covers all four standard COM ports: - COM1: 0x3F8-0x3FF - COM2: 0x2F8-0x2FF - COM3: 0x3E8-0x3EF - COM4: 0x2E8-0x2EF This has no impact on Linux guests (which don't enforce strict ACPI resource checking) or on modern PCI devices (which use MMIO BARs rather than legacy I/O ports). Signed-off-by: Taha Saifuddin <taha@blacksmith.sh>
1 parent e3fb425 commit 9e7ae02

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

vmm/src/pci_segment.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,15 @@ impl Aml for PciSegment {
403403
None,
404404
),
405405
#[cfg(target_arch = "x86_64")]
406-
&aml::AddressSpace::new_io(0u16, 0x0cf7u16, None),
406+
// Legacy I/O port ranges for PCI devices.
407+
// Excludes 0x2E8-0x3FF to avoid ACPI resource conflict with legacy serial
408+
// ports (COM1-COM4) on Windows. Windows refuses to load drivers for devices
409+
// when their I/O resources overlap with another device's claimed range.
410+
// COM ports: COM1=0x3F8, COM2=0x2F8, COM3=0x3E8, COM4=0x2E8 (each uses 8 bytes)
411+
#[cfg(target_arch = "x86_64")]
412+
&aml::AddressSpace::new_io(0x0000u16, 0x02e7u16, None),
413+
#[cfg(target_arch = "x86_64")]
414+
&aml::AddressSpace::new_io(0x0400u16, 0x0cf7u16, None),
407415
#[cfg(target_arch = "x86_64")]
408416
&aml::AddressSpace::new_io(0x0d00u16, 0xffffu16, None),
409417
]),

0 commit comments

Comments
 (0)