Add Transactional Synchronization eXtensions to QEMU
C C++ Python Haxe Assembly Perl Other
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
QMP
audio
backends
block
bsd-user
default-configs
docs
fpu
fsdev
gdb-xml
htmtest
hw
include/qemu
libcacard
linux-headers
linux-user
net
pc-bios
pixman @ 97336fa
qapi
qga
qom
roms
scripts
slirp
stubs
sysconfigs/target
target-alpha
target-arm
target-cris
target-i386
target-lm32
target-m68k
target-microblaze
target-mips
target-openrisc
target-ppc
target-s390x
target-sh4
target-sparc
target-unicore32
target-xtensa
tcg
tests
trace
ui
.exrc
.gitignore
.gitmodules
.mailmap
CODING_STYLE
COPYING
COPYING.LIB
Changelog
HACKING
LICENSE
MAINTAINERS
Makefile
Makefile.dis
Makefile.objs
Makefile.target
Makefile.user
README
README.md
TODO
VERSION
a.out.h
acl.c
acl.h
aes.c
aes.h
aio-posix.c
aio-win32.c
alpha-dis.c
alpha.ld
arch_init.c
arch_init.h
arm-dis.c
arm.ld
async.c
balloon.c
balloon.h
bitmap.c
bitmap.h
bitops.c
bitops.h
block-migration.c
block-migration.h
block.c
block.h
block_int.h
blockdev-nbd.c
blockdev.c
blockdev.h
blockjob.c
blockjob.h
bswap.h
bt-host.c
bt-host.h
bt-vhci.c
buffered_file.c
buffered_file.h
cache-utils.c
cache-utils.h
cmd.c
cmd.h
compatfd.c
compatfd.h
compiler.h
config.h
configure
console.c
console.h
coroutine-gthread.c
coroutine-sigaltstack.c
coroutine-ucontext.c
coroutine-win32.c
cpu-all.h
cpu-common.h
cpu-defs.h
cpu-exec.c
cpus.c
cpus.h
cputlb.c
cputlb.h
cris-dis.c
cursor.c
cursor_hidden.xpm
cursor_left_ptr.xpm
cutils.c
def-helper.h
device_tree.c
device_tree.h
dis-asm.h
disas.c
disas.h
dma-helpers.c
dma.h
dump-stub.c
dump.c
dump.h
elf.h
envlist.c
envlist.h
error.c
error.h
event_notifier-posix.c
event_notifier-win32.c
event_notifier.h
exec-all.h
exec-memory.h
exec.c
gdbstub.c
gdbstub.h
gen-icount.h
hmp-commands.hx
hmp.c
hmp.h
host-utils.c
host-utils.h
hppa-dis.c
hppa.ld
hwaddr.h
i386-dis.c
i386.ld
ia64-dis.c
ia64.ld
input.c
int128.h
iohandler.c
ioport.c
ioport.h
iorange.h
iov.c
iov.h
json-lexer.c
json-lexer.h
json-parser.c
json-parser.h
json-streamer.c
json-streamer.h
kvm-all.c
kvm-stub.c
kvm.h
libfdt_env.h
lm32-dis.c
m68k-dis.c
m68k.ld
main-loop.c
main-loop.h
memory-internal.h
memory.c
memory.h
memory_mapping-stub.c
memory_mapping.c
memory_mapping.h
microblaze-dis.c
migration-exec.c
migration-fd.c
migration-tcp.c
migration-unix.c
migration.c
migration.h
mips-dis.c
mips.ld
module.c
module.h
monitor.c
monitor.h
nbd.c
nbd.h
net.c
net.h
notify.c
notify.h
os-posix.c
os-win32.c
osdep.c
osdep.h
oslib-posix.c
oslib-win32.c
page_cache.c
path.c
pci-ids.txt
poison.h
ppc-dis.c
ppc.ld
ppc64.ld
qapi-schema-guest.json
qapi-schema-test.json
qapi-schema.json
qbool.c
qbool.h
qdict-test-data.txt
qdict.c
qdict.h
qemu-aio.h
qemu-barrier.h
qemu-bridge-helper.c
qemu-char.c
qemu-char.h
qemu-common.h
qemu-config.c
qemu-config.h
qemu-coroutine-int.h
qemu-coroutine-io.c
qemu-coroutine-lock.c
qemu-coroutine-sleep.c
qemu-coroutine.c
qemu-coroutine.h
qemu-doc.texi
qemu-error.c
qemu-error.h
qemu-file.h
qemu-ga.c
qemu-img-cmds.hx
qemu-img.c
qemu-img.texi
qemu-io.c
qemu-lock.h
qemu-log.c
qemu-log.h
qemu-nbd.c
qemu-nbd.texi
qemu-objects.h
qemu-option-internal.h
qemu-option.c
qemu-option.h
qemu-options-wrapper.h
qemu-options.h
qemu-options.hx
qemu-os-posix.h
qemu-os-win32.h
qemu-pixman.c
qemu-pixman.h
qemu-progress.c
qemu-queue.h
qemu-seccomp.c
qemu-seccomp.h
qemu-sockets.c
qemu-tech.texi
qemu-thread-posix.c
qemu-thread-posix.h
qemu-thread-win32.c
qemu-thread-win32.h
qemu-thread.h
qemu-timer-common.c
qemu-timer.c
qemu-timer.h
qemu-tls.h
qemu-tool.c
qemu-user.c
qemu-x509.h
qemu-xattr.h
qemu.sasl
qemu_socket.h
qerror.c
qerror.h
qfloat.c
qfloat.h
qint.c
qint.h
qjson.c
qjson.h
qlist.c
qlist.h
qmp-commands.hx
qmp.c
qobject.h
qstring.c
qstring.h
qtest.c
qtest.h
range.h
readline.c
readline.h
rules.mak
s390-dis.c
s390.ld
savevm.c
sh4-dis.c
softmmu-semi.h
softmmu_defs.h
softmmu_exec.h
softmmu_header.h
softmmu_template.h
sparc-dis.c
sparc.ld
sparc64.ld
spice-qemu-char.c
sysemu.h
tcg-runtime.c
tci-dis.c
tci.c
thread-pool.c
thread-pool.h
thunk.c
thunk.h
trace-events
translate-all.c
uboot_image.h
uri.c
uri.h
user-exec.c
version.rc
vgafont.h
vl.c
vmstate.h
x86_64.ld
xen-all.c
xen-mapcache.c
xen-mapcache.h
xen-stub.c

README.md

qemu-tsx

Add Transactional Synchronization eXtensions to QEMU

About

Intel's Haswell microarchitecture will support Transactional Synchronization eXtensions (TSX) including Restricted Transactional Memory (RTM) and Hardware Lock Elision (HLE). The specification can be found at http://software.intel.com/sites/default/files/m/3/2/1/0/b/41417-319433-012.pdf

This project is an implementation of TSX on top of the QEMU emulator.

Installation

./configure --target-list=x86_64-softmmu

make

make install

Usage

qemu-system-x86_64 -cpu Haswell

This creates a file 'execlog', which can be parsed with 'htmtest/parselog.py'.

Design

Several changes were made to the i386 target to support TSX:

  • New cpu type "Haswell". '-cpu Haswell' must be specified on the command line to QEMU to support TSX instructions.
  • New common memory interface in 'target-i386/mem_wrap.h'. This is used to wrap all memory micro-operations in 'target-i386/translate.c' to efficiently switch behavior when RTM mode is active.
  • Changes to CPUX86State to support RTM and store register state.
  • Simulate a configurable transaction cache with 64 byte cache lines.
  • Instruction interleaving. To force as much contention as possible (and really stress the design) QEMU was modified to execute one emulated instruction at a time on processors in transactional mode before yielding to other emulated processors. This mode can be explicitly triggered using the dummy interrupt 'int $0xFF' and exited using the dummy interrupt 'int $0xFE'. This can be enabled by the command line option -txstep

Features

  • Configurable caches (defaulting to 32KB 8-way set associative). See target-i386/tsx_cache.h
  • Non-transactional memory access killing transactions.

See also

For userspace: Intel's SDE (http://software.intel.com/en-us/articles/intel-software-development-emulator).

TODO

  • Implement Hardware Lock Elision (HLE). Probably not that difficult given RTM is implemented. project does not yet support it.