vmbase_example: Clarify that PageTable is dropped

The code calls init_page_table() at some point and, based on the name of
the function and when it gets called (right before vmbase_example
accesses the PCI BARs), it seems to be to configure the page tables in
use. However, the PageTable struct is local to the function and gets
dropped when it returns. As a result, TTBR0_EL1 (which was reprogrammed
by page_table.activate()) reverts back to its previous value, which was
the hard-coded page tables in idmap.S!

The reason why the accesses to the PCI BAR or (right before) to the DT
don't result in page faults is because they respectively fall in the
DEVICE_REGION ([0; 1Gib[) and dtb_region, both of which are already
mapped in idmap.S.

Instead, keep the code unmodified but explicitly show that we're
dropping the page_table struct and mention it in a comment.

No functional change intended.

Test: atest vmbase_example.integration_test
Change-Id: Iaa2b21f42dc9afcebe2192fe7fdcfc4df80d01e8
diff --git a/guest/vmbase_example/src/main.rs b/guest/vmbase_example/src/main.rs
index 4d535cc..02c9429 100644
--- a/guest/vmbase_example/src/main.rs
+++ b/guest/vmbase_example/src/main.rs
@@ -25,10 +25,10 @@
 
 use crate::layout::{boot_stack_range, print_addresses, DEVICE_REGION};
 use crate::pci::{check_pci, get_bar_region};
-use aarch64_paging::paging::MemoryRegion;
 use aarch64_paging::paging::VirtualAddress;
 use aarch64_paging::MapError;
 use alloc::{vec, vec::Vec};
+use core::mem;
 use core::ptr::addr_of_mut;
 use cstr::cstr;
 use fdtpci::PciInfo;
@@ -52,16 +52,12 @@
 main!(main);
 configure_heap!(SIZE_64KB);
 
-fn init_page_table(dtb: &MemoryRegion, pci_bar_range: &MemoryRegion) -> Result<(), MapError> {
-    let mut page_table = PageTable::default();
-
+fn init_page_table(page_table: &mut PageTable) -> Result<(), MapError> {
     page_table.map_device(&DEVICE_REGION)?;
     page_table.map_code(&text_range().into())?;
     page_table.map_rodata(&rodata_range().into())?;
     page_table.map_data(&scratch_range().into())?;
     page_table.map_data(&boot_stack_range().into())?;
-    page_table.map_rodata(dtb)?;
-    page_table.map_device(pci_bar_range)?;
 
     info!("Activating IdMap...");
     // SAFETY: page_table duplicates the static mappings for everything that the Rust code is
@@ -102,7 +98,11 @@
 
     check_alloc();
 
-    init_page_table(&fdt_region, &get_bar_region(&pci_info)).unwrap();
+    let mut page_table = PageTable::default();
+    page_table.map_rodata(&fdt_region).unwrap();
+    page_table.map_device(&get_bar_region(&pci_info)).unwrap();
+    init_page_table(&mut page_table).unwrap();
+    mem::drop(page_table); // Release PageTable and switch back to idmap.S
 
     check_data();
     check_dice();