mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-09 20:04:20 +00:00
x86_64: Remove the repeated read_pcie_cfg_mmio() call in build_vm()
pcie_cfg_mmio_range has been gotten at the beginning of build_vm, and its value won't be changed. So later it could be used directly instead of read_pcie_cfg_mmio() again. BUG=None TEST=tools/presubmit Change-Id: If52843634692bbd9cec7b3679856a3959b41f397 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3813134 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Reviewed-by: Victor Ding <victording@chromium.org> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org> Tested-by: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
01ad8e7fad
commit
728dcd2cdd
1 changed files with 3 additions and 4 deletions
|
@ -627,7 +627,7 @@ impl arch::LinuxArch for X8664arch {
|
|||
.map_err(Error::CreatePciRoot)?;
|
||||
|
||||
let pci = Arc::new(Mutex::new(pci));
|
||||
pci.lock().enable_pcie_cfg_mmio(read_pcie_cfg_mmio().start);
|
||||
pci.lock().enable_pcie_cfg_mmio(pcie_cfg_mmio_range.start);
|
||||
let pci_cfg = PciConfigIo::new(
|
||||
pci.clone(),
|
||||
vm_evt_wrtube.try_clone().map_err(Error::CloneTube)?,
|
||||
|
@ -636,7 +636,6 @@ impl arch::LinuxArch for X8664arch {
|
|||
io_bus.insert(pci_bus, 0xcf8, 0x8).unwrap();
|
||||
|
||||
let pcie_cfg_mmio = Arc::new(Mutex::new(PciConfigMmio::new(pci.clone(), 12)));
|
||||
let pcie_cfg_mmio_range = read_pcie_cfg_mmio();
|
||||
let pcie_cfg_mmio_len = pcie_cfg_mmio_range.len().unwrap();
|
||||
mmio_bus
|
||||
.insert(pcie_cfg_mmio, pcie_cfg_mmio_range.start, pcie_cfg_mmio_len)
|
||||
|
@ -700,7 +699,7 @@ impl arch::LinuxArch for X8664arch {
|
|||
let mut resume_notify_devices = Vec::new();
|
||||
|
||||
// each bus occupy 1MB mmio for pcie enhanced configuration
|
||||
let max_bus = ((read_pcie_cfg_mmio().len().unwrap() / 0x100000) - 1) as u8;
|
||||
let max_bus = (pcie_cfg_mmio_len / 0x100000 - 1) as u8;
|
||||
let (acpi_dev_resource, bat_control) = Self::setup_acpi_devices(
|
||||
&mem,
|
||||
&io_bus,
|
||||
|
@ -756,7 +755,7 @@ impl arch::LinuxArch for X8664arch {
|
|||
host_cpus,
|
||||
vcpu_ids,
|
||||
&pci_irqs,
|
||||
read_pcie_cfg_mmio().start,
|
||||
pcie_cfg_mmio_range.start,
|
||||
max_bus,
|
||||
components.force_s2idle,
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue