refactor(mm): replace max level with root level

The name `mm_max_level()` is misleading, since it is not actually the
maximum value that the level can be (since the root level is the "max"
level plus 1).

The use of `mm_max_level()` in `mm.c` was also inconsistent: sometimes
they call `mm_max_level() + 1` to calculate the root level, sometimes
they just pass `mm_max_level()` to recursive subcalls to process the
next level down. This made it hard to know when a plus or minus one was
needed and so ended up introducing off-by-one errors. Now, you always
start at `mm_root_level()` and pass `root_level - 1` to recursive
subcalls.

Also add explanatory comments explaining the level-related arithmetic.

Change-Id: I7b701d6d2c908db03c2853a008565126890e7959
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/src/mm_test.cc b/src/mm_test.cc
index 5e4b31b..8b0ea75 100644
--- a/src/mm_test.cc
+++ b/src/mm_test.cc
@@ -37,7 +37,7 @@
 using ::mm_test::get_ptable;
 
 constexpr size_t TEST_HEAP_SIZE = PAGE_SIZE * 16;
-const mm_level_t TOP_LEVEL = arch_mm_stage2_max_level();
+const mm_level_t TOP_LEVEL = arch_mm_stage2_root_level() - 1;
 const paddr_t VM_MEM_END = pa_init(0x200'0000'0000);
 
 /**