mem: Remove a check that the memory size is a multiple of the page size.

There are a few problems with this check.

1. Many ISAs support multiple page sizes.
2. Memories (particularly small ROMs) may not actually be in multiples
   of the page size.
3. In a heterogenous environment, there won't be a single page size even
   if each ISA picks a canonical page size.
4. Other than catching some egregious configuration mistakes, there's
   nothing functionally wrong/different about a memory that isn't evenly
   coverable in pages, especially in systems or configurations that
   don't even use paging.

Change-Id: I3cd241657318d2e3fd5a1226cb54fdebbf172788
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26423
Maintainer: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: Gem5 Cloud Project GCB service account <345032938727@cloudbuild.gserviceaccount.com>
diff --git a/src/mem/abstract_mem.cc b/src/mem/abstract_mem.cc
index 927fd02..b5412ba 100644
--- a/src/mem/abstract_mem.cc
+++ b/src/mem/abstract_mem.cc
@@ -61,15 +61,9 @@
     kvmMap(p->kvm_map), _system(NULL),
     stats(*this)
 {
-}
-
-void
-AbstractMemory::init()
-{
-    assert(system());
-
-    if (size() % _system->getPageBytes() != 0)
-        panic("Memory Size not divisible by page size\n");
+    panic_if(!range.valid() || !range.size(),
+             "Memory range %s must be valid with non-zero size.",
+             range.to_string());
 }
 
 void
diff --git a/src/mem/abstract_mem.hh b/src/mem/abstract_mem.hh
index c8aef70..b1d54fd 100644
--- a/src/mem/abstract_mem.hh
+++ b/src/mem/abstract_mem.hh
@@ -210,11 +210,6 @@
     virtual ~AbstractMemory() {}
 
     /**
-     * Initialise this memory.
-     */
-    void init() override;
-
-    /**
      * See if this is a null memory that should never store data and
      * always return zero.
      *