]> git.proxmox.com Git - mirror_qemu.git/commit
tcg/sparc: Zero extend data argument to store helpers
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 30 Mar 2017 10:52:30 +0000 (11:52 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 3 Apr 2017 11:59:14 +0000 (12:59 +0100)
commit709a340d679d95a0c6cbb9b5f654498f04345b50
tree696ed93f00169508b696f0d3a6917df7c2f4023a
parentf9e46d37bd19b4f3faaedb78a48c53d02ee4197e
tcg/sparc: Zero extend data argument to store helpers

The C store helper functions take the data argument as a uint8_t,
uint16_t, etc depending on the store size. The SPARC calling
convention requires that data types smaller than the register
size must be extended by the caller. We weren't doing this,
which meant that if QEMU was compiled with optimizations enabled
we could end up storing incorrect values to guest memory.
(In particular the i386 guest BIOS would crash on startup.)

Add code to the trampolines that call the store helpers to
do the zero extension as required.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 1490871151-29029-2-git-send-email-peter.maydell@linaro.org
Reviewed-by: Richard Henderson <rth@twiddle.net>
tcg/sparc/tcg-target.inc.c