Convert logically unmapped modes to unmapping.

If an address range is invalid and unowned, it holds no extra
information so can be replaced with an absent entry.

The mapping functions are sometimes used to unmap addresses, for example
during memory sharing. This change means the resulting state of the page
table is the same as though an unmapping function had been used.

This has the side effect of canonicalizing the state for an unmapped
entry.

Change-Id: I1ff35d1dffb9720d5a18c00cd223879fa91c4b24
diff --git a/inc/hf/mm.h b/inc/hf/mm.h
index 613e6e5..ecd205f 100644
--- a/inc/hf/mm.h
+++ b/inc/hf/mm.h
@@ -60,8 +60,8 @@
  *  - !V  O  X : Owner of memory lent to a VM that has exclusive access.
  *
  *  - !V  O !X : Unused. Owner of shared memory always has access.
+ *  - !V !O  X : Unused. Next entry is used for invalid memory.
  *
- *  - !V !O  X : Invalid memory. Memory is unrelated to the VM.
  *  - !V !O !X : Invalid memory. Memory is unrelated to the VM.
  *
  *  Modes are selected so that owner of exclusive memory is the default.
@@ -70,6 +70,9 @@
 #define MM_MODE_UNOWNED UINT32_C(0x0020)
 #define MM_MODE_SHARED  UINT32_C(0x0040)
 
+/* The mask for a mode that is considered unmapped. */
+#define MM_MODE_UNMAPPED_MASK (MM_MODE_INVALID | MM_MODE_UNOWNED)
+
 #define MM_FLAG_COMMIT  0x01
 #define MM_FLAG_UNMAP   0x02
 #define MM_FLAG_STAGE1  0x04