summaryrefslogtreecommitdiff
path: root/util/m5/m5op_x86.S
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas@sandberg.pp.se>2013-09-30 12:20:53 +0200
committerAndreas Sandberg <andreas@sandberg.pp.se>2013-09-30 12:20:53 +0200
commitfec2dea5c35d830ab4f4dc5295e6dba0e152f18e (patch)
treed3304bcc3a5d3d7684df0107982077714200535f /util/m5/m5op_x86.S
parentd9856f33a455b9c86b90f5857df866fba3aa5bfb (diff)
downloadgem5-fec2dea5c35d830ab4f4dc5295e6dba0e152f18e.tar.xz
x86: Add support for m5ops through a memory mapped interface
In order to support m5ops in virtualized environments, we need to use a memory mapped interface. This changeset adds support for that by reserving 0xFFFF0000-0xFFFFFFFF and mapping those to the generic IPR interface for m5ops. The mapping is done in the X86ISA::TLB::finalizePhysical() which means that it just works for all of the CPU models, including virtualized ones.
Diffstat (limited to 'util/m5/m5op_x86.S')
-rw-r--r--util/m5/m5op_x86.S20
1 files changed, 20 insertions, 0 deletions
diff --git a/util/m5/m5op_x86.S b/util/m5/m5op_x86.S
index 2c25785e6..2e950c10f 100644
--- a/util/m5/m5op_x86.S
+++ b/util/m5/m5op_x86.S
@@ -32,6 +32,24 @@
#include "m5ops.h"
+#ifdef M5OP_ADDR
+/* Use the memory mapped m5op interface */
+#define TWO_BYTE_OP(name, number) \
+ .globl name; \
+ .func name; \
+name: \
+ mov m5_mem, %r11; \
+ mov $number, %rax; \
+ shl $8, %rax; \
+ mov 0(%r11, %rax, 1), %rax; \
+ ret; \
+ .endfunc;
+
+#else
+/* Use the magic instruction based m5op interface. This does not work
+ * in virtualized environments.
+ */
+
#define TWO_BYTE_OP(name, number) \
.globl name; \
.func name; \
@@ -41,6 +59,8 @@ name: \
ret; \
.endfunc;
+#endif
+
TWO_BYTE_OP(arm, arm_func)
TWO_BYTE_OP(quiesce, quiesce_func)
TWO_BYTE_OP(quiesceNs, quiescens_func)