From ba1e89139a6dec19d51f90f115b7c42e599175e9 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Thu, 27 Apr 2023 17:07:09 +0000 Subject: [PATCH] pci: aml: support up to 256 PCI segments Originally the AML only accepted one hex number for PCI segment numbering. Change it to accept two numbers. That makes it possible to add up to 256 PCI segments. Signed-off-by: Wei Liu --- vmm/src/device_manager.rs | 2 +- vmm/src/pci_segment.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index b5e0cb7d3..3611e9af0 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -4278,7 +4278,7 @@ impl Aml for DeviceManager { let mut pci_scan_methods = Vec::new(); for i in 0..self.pci_segments.len() { pci_scan_methods.push(aml::MethodCall::new( - format!("\\_SB_.PCI{i:X}.PCNT").as_str().into(), + format!("\\_SB_.PC{i:02X}.PCNT").as_str().into(), vec![], )); } diff --git a/vmm/src/pci_segment.rs b/vmm/src/pci_segment.rs index e0417469d..dd1b3f90a 100644 --- a/vmm/src/pci_segment.rs +++ b/vmm/src/pci_segment.rs @@ -418,7 +418,7 @@ impl Aml for PciSegment { pci_dsdt_inner_data.push(&prt); aml::Device::new( - format!("_SB_.PCI{:X}", self.id).as_str().into(), + format!("_SB_.PC{:02X}", self.id).as_str().into(), pci_dsdt_inner_data, ) .to_aml_bytes(sink)