Map PCI CAM MMIO region and register pages with the MMIO guard.

Crosvm uses a memory-mapped Configuration Access Mechanism for PCI,
which we can find in the device tree. We need to map this as device
memory and register it with the hypervisor MMIO guard before trying to
access any PCI devices.

Bug: 237249346
Test: Ran pVM firmware manually.
Change-Id: Ide892c307e0c77a968560ecc6cb64f336002edf2
diff --git a/pvmfw/src/main.rs b/pvmfw/src/main.rs
index d453e26..e6a158d 100644
--- a/pvmfw/src/main.rs
+++ b/pvmfw/src/main.rs
@@ -29,18 +29,25 @@
 mod memory;
 mod mmio_guard;
 mod mmu;
+mod pci;
 mod smccc;
 
-use crate::entry::RebootReason;
+use crate::{
+    entry::RebootReason,
+    memory::MemoryTracker,
+    pci::{map_cam, pci_node},
+};
 use avb::PUBLIC_KEY;
 use avb_nostd::verify_image;
+use libfdt::Fdt;
 use log::{debug, error, info};
 
 fn main(
-    fdt: &libfdt::Fdt,
+    fdt: &Fdt,
     signed_kernel: &[u8],
     ramdisk: Option<&[u8]>,
     bcc: &[u8],
+    memory: &mut MemoryTracker,
 ) -> Result<(), RebootReason> {
     info!("pVM firmware");
     debug!("FDT: {:?}", fdt as *const libfdt::Fdt);
@@ -51,6 +58,11 @@
         debug!("Ramdisk: None");
     }
     debug!("BCC: {:?} ({:#x} bytes)", bcc.as_ptr(), bcc.len());
+
+    // Set up PCI bus for VirtIO devices.
+    let pci_node = pci_node(fdt)?;
+    map_cam(&pci_node, memory)?;
+
     verify_image(signed_kernel, PUBLIC_KEY).map_err(|e| {
         error!("Failed to verify the payload: {e}");
         RebootReason::PayloadVerificationError