pvmfw: Hack MMIO_GUARD_UNMAP to expect NOT_SUPPORTED

Until aosp/2240205, pKVM returned the wrong error code for the HVC (but
otherwise properly implemented it) so mask NOT_SUPPORTED in pvmfw until
all platforms it runs on have been patched.

Keep supporting SUCCESS to allow pvmfw to run on patched platforms.

Log the workaround, to help with debugging.

Note: this commit is intended to be reverted once the bug is fixed.

Bug: 251426790
Test: atest MicrodroidTestApp
Change-Id: I74c2d43dd855e0d7f89fe286dea02eceea3c92be
diff --git a/pvmfw/src/mmio_guard.rs b/pvmfw/src/mmio_guard.rs
index 2206052..ce74abb 100644
--- a/pvmfw/src/mmio_guard.rs
+++ b/pvmfw/src/mmio_guard.rs
@@ -17,6 +17,7 @@
 use crate::helpers;
 use crate::smccc;
 use core::{fmt, result};
+use log::info;
 
 #[derive(Debug, Clone)]
 pub enum Error {
@@ -90,5 +91,10 @@
     let mut args = [0u64; 17];
     args[0] = ipa;
 
-    smccc::checked_hvc64_expect_zero(VENDOR_HYP_KVM_MMIO_GUARD_UNMAP_FUNC_ID, args)
+    // TODO(b/251426790): pKVM currently returns NOT_SUPPORTED for SUCCESS.
+    info!("Expecting a bug making MMIO_GUARD_UNMAP return NOT_SUPPORTED on success");
+    match smccc::checked_hvc64_expect_zero(VENDOR_HYP_KVM_MMIO_GUARD_UNMAP_FUNC_ID, args) {
+        Err(smccc::Error::NotSupported) | Ok(_) => Ok(()),
+        x => x,
+    }
 }