arch: acpi: Set the upper device range based on RAM levels

After the 32-bit gap the memory is shared between the devices and the
RAM. Ensure that the ACPI tables correctly indicate where the RAM ends
and the device area starts by patching the precompiled tables. We get
the following valid output now from the PCI bus probing (8GiB guest)

[    0.317757] pci_bus 0000:00: resource 4 [io  0x0000-0x0cf7 window]
[    0.319035] pci_bus 0000:00: resource 5 [io  0x0d00-0xffff window]
[    0.320215] pci_bus 0000:00: resource 6 [mem 0x000a0000-0x000bffff window]
[    0.321431] pci_bus 0000:00: resource 7 [mem 0xc0000000-0xfebfffff window]
[    0.322613] pci_bus 0000:00: resource 8 [mem 0x240000000-0xfffffffff window]

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-09-18 15:11:56 +01:00
parent f9b0875a60
commit f0360c92d9
3 changed files with 71 additions and 9 deletions

View File

@@ -787,7 +787,7 @@ impl<'a> Vm<'a> {
.map_err(|_| Error::CmdLine)?;
let vcpu_count = u8::from(&self.config.cpus);
let end_of_range = GuestAddress((1 << 36) - 1);
match entry_addr.setup_header {
Some(hdr) => {
arch::configure_system(
@@ -797,6 +797,7 @@ impl<'a> Vm<'a> {
vcpu_count,
Some(hdr),
self.config.serial.mode != ConsoleOutputMode::Off,
end_of_range,
)
.map_err(|_| Error::CmdLine)?;
@@ -816,6 +817,7 @@ impl<'a> Vm<'a> {
vcpu_count,
None,
self.config.serial.mode != ConsoleOutputMode::Off,
end_of_range,
)
.map_err(|_| Error::CmdLine)?;