pvmfw: Check addr alignment of memory and swiotlb

Ensure that those are also properly aligned to the constraint, currently
defined as the guest page size but about to be extended to also align to
the hypervisor page size.

Bug: 393095315
Test: m pvmfw
Change-Id: I2b98fdc1ab004fcd1d0f5f0c3c37d0c7ec3e8702
diff --git a/guest/pvmfw/src/fdt.rs b/guest/pvmfw/src/fdt.rs
index e5bc60b..4867225 100644
--- a/guest/pvmfw/src/fdt.rs
+++ b/guest/pvmfw/src/fdt.rs
@@ -182,6 +182,11 @@
         );
     }
     let base = range.start;
+    if base % alignment != 0 {
+        error!("Memory base address {:#x} is not aligned to {:#x}", base, alignment);
+        return Err(RebootReason::InvalidFdt);
+    }
+    // For simplicity, force a hardcoded memory base, for now.
     if base != MEM_START {
         error!("Memory base address {:#x} is not {:#x}", base, MEM_START);
         return Err(RebootReason::InvalidFdt);
@@ -891,6 +896,10 @@
             error!("Invalid swiotlb range: addr:{addr:#x} size:{size:#x}");
             return Err(RebootReason::InvalidFdt);
         }
+        if (addr % alignment) != 0 {
+            error!("Swiotlb address {:#x} not aligned to {:#x}", addr, alignment);
+            return Err(RebootReason::InvalidFdt);
+        }
     }
     if let Some(range) = swiotlb_info.fixed_range() {
         if !range.is_within(memory) {