hw/arm: Fix smpboot[] on big-endian hosts and remove tswap32()
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest6 patches 12 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | hw/arm/aspeed: Fix smpboot[] on big-endian hostshw/ | +14 | 5 replies | |
| 2/6 | hw/arm/raspi: Fix smpboot[] on big-endian hostshw/ | +23 | 0 replies | |
| 3/6 | hw/arm/exynos4210: Remove tswap32() calls and constify smpboot[]hw/ | +21 | 0 replies | |
| 4/6 | hw/arm/npcm7xx: Remove tswap32() calls and constify smpboot[]hw/ | +20 | 0 replies | |
| 5/6 | hw/arm/xilinx_zynq: Remove tswap32() calls and constify smpboot[]hw/ | +12 | 3 replies | |
| 6/6 | hw/arm/boot: Remove tswap32() calls and constify board_setup_blob[]hw/ | +22 | 0 replies |
Reviews trailers per patch
1 of 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Cédric Le Goater | Richard Henderson |
|---|---|---|
| Series | R-b | |
| 1/6 | R-b | |
| 2/6 | ||
| 3/6 | ||
| 4/6 | ||
| 5/6 | ||
| 6/6 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/6] hw/arm: Fix smpboot[] on big-endian hosts and remove tswap32()
ARM CPUs fetch instructions in little-endian.
smpboot[] encoded instructions are written in little-endian.
We call tswap32() on the array. tswap32 function swap a 32-bit value if the target endianness doesn't match the host one. Otherwise it is a NOP.
* On a little-endian host, the array is stored as it. tswap32() is a NOP, and the vCPU fetches the instructions as it, in little-endian.
* On a big-endian host, the array is stored as it. tswap32() swap the instructions to little-endian, and the vCPU fetches the instructions as it, in little-endian.
Using tswap() on system emulation is a bit odd: while the target particularities might change the system emulation, the host ones (such its endianness) shouldn't interfere.
We can simplify by using const_le32() to always store the instructions in the array in little-endian, removing the need for the dubious tswap().
Two boards which weren't swapping (aspeed and raspi) are fixed.
Tested running ARM avocado tests on x86_64 and s390x.
Philippe Mathieu-Daudé (6):
hw/arm/aspeed: Fix smpboot[] on big-endian hosts hw/arm/raspi: Fix smpboot[] on big-endian hosts hw/arm/exynos4210: Remove tswap32() calls and constify smpboot[] hw/arm/npcm7xx: Remove tswap32() calls and constify smpboot[] hw/arm/xilinx_zynq: Remove tswap32() calls and constify smpboot[] hw/arm/boot: Remove tswap32() calls and constify board_setup_blob[]
hw/arm/aspeed.c | 28 ++++++++++++------------ hw/arm/boot.c | 52 +++++++++++++++++++------------------------- hw/arm/exynos4210.c | 48 ++++++++++++++++++---------------------- hw/arm/npcm7xx.c | 49 +++++++++++++++++------------------------ hw/arm/raspi.c | 46 +++++++++++++++++++-------------------- hw/arm/xilinx_zynq.c | 27 ++++++++++------------- 6 files changed, 112 insertions(+), 138 deletions(-)
Signature · 1 line
2.38.1