Addr addr;
// locking hw context
- const int contextId;
+ const ContextID contextId;
static Addr mask(Addr paddr) { return (paddr & ~Addr_Mask); }
uint8_t* pmemAddr;
// Enable specific memories to be reported to the configuration table
- bool confTableReported;
+ const bool confTableReported;
// Should the memory appear in the global address map
- bool inAddrMap;
+ const bool inAddrMap;
+
+ // Should KVM map this memory for the guest
+ const bool kvmMap;
std::list<LockedAddr> lockedAddrList;
AbstractMemory(const Params* p);
virtual ~AbstractMemory() {}
+ /**
+ * Initialise this memory.
+ */
+ void init() override;
+
/**
* See if this is a null memory that should never store data and
* always return zero.
*/
bool isNull() const { return params()->null; }
- /**
- * See if this memory should be initialized to zero or not.
- *
- * @return true if zero
- */
- bool initToZero() const { return params()->zero; }
-
/**
* Set the host memory backing store to be used by this memory
* controller.
*
* @return the start address of the memory
*/
- Addr start() const { return range.start; }
+ Addr start() const { return range.start(); }
/**
* Should this memory be passed to the kernel and part of the OS
*/
bool isInAddrMap() const { return inAddrMap; }
+ /**
+ * When shadow memories are in use, KVM may want to make one or the other,
+ * but cannot map both into the guest address space.
+ *
+ * @return if this memory should be mapped into the KVM guest address space
+ */
+ bool isKvmMap() const { return kvmMap; }
+
/**
* Perform an untimed memory access and update all the state
* (e.g. locked addresses) and statistics accordingly. The packet
/**
* Register Statistics
*/
- virtual void regStats();
+ void regStats() override;
};