x86 isa: This patch attempts an implementation at mwait.

Mwait works as follows:
1. A cpu monitors an address of interest (monitor instruction)
2. A cpu calls mwait - this loads the cache line into that cpu's cache.
3. The cpu goes to sleep.
4. When another processor requests write permission for the line, it is
   evicted from the sleeping cpu's cache. This eviction is forwarded to the
   sleeping cpu, which then wakes up.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>
This commit is contained in:
Marc Orr
2014-11-06 05:42:22 -06:00
parent 3947f88d0f
commit bf80734b2c
26 changed files with 381 additions and 16 deletions

View File

@@ -47,6 +47,7 @@
#include "arch/registers.hh"
#include "base/types.hh"
#include "config/the_isa.hh"
#include "cpu/base.hh"
#include "cpu/static_inst_fwd.hh"
#include "cpu/translation.hh"
@@ -243,6 +244,10 @@ class ExecContext {
* Invalidate a page in the DTLB <i>and</i> ITLB.
*/
virtual void demapPage(Addr vaddr, uint64_t asn) = 0;
virtual void armMonitor(Addr address) = 0;
virtual bool mwait(PacketPtr pkt) = 0;
virtual void mwaitAtomic(ThreadContext *tc) = 0;
virtual AddressMonitor *getAddrMonitor() = 0;
/** @} */