vmbase_example: Run most tests using dynamic PTs

Instead of enabling the dynamic page tables for a short duration and
switching back to idmap.S, enable them early and keep them (almost)
until main() returns.

Map the DT before it is accessed by the tests. As a result, the
assertion that the DT must be at a hard-coded location can be lifted and
we can remove the mapping from idmap.S. Note that the PT test was
previously using .map_rodata() for the DT but, given modify_fdt(), we
must actually use .map_data().

For the PCI BAR, avoid a BBM violation but detecting if the region is
already mapped. To do so, implement RangeExt for MemoryRegion.

Test: atest vmbase_example.integration_test
Change-Id: I1abbf1566c579282742f5a0936e0934e69c38797
diff --git a/libs/libvmbase/src/util.rs b/libs/libvmbase/src/util.rs
index 8c230a1..e52ac8e 100644
--- a/libs/libvmbase/src/util.rs
+++ b/libs/libvmbase/src/util.rs
@@ -14,6 +14,7 @@
 
 //! Utility functions.
 
+use aarch64_paging::paging::MemoryRegion;
 use core::ops::Range;
 
 /// Flatten [[T; N]] into &[T]
@@ -91,3 +92,13 @@
         self.start < other.end && other.start < self.end
     }
 }
+
+impl RangeExt for MemoryRegion {
+    fn is_within(&self, other: &Self) -> bool {
+        self.start() >= other.start() && self.end() <= other.end()
+    }
+
+    fn overlaps(&self, other: &Self) -> bool {
+        self.start() < other.end() && other.start() < self.end()
+    }
+}