Skip to content
Commit 73601775 authored by Cédric Le Goater's avatar Cédric Le Goater Committed by Alexander Graf
Browse files

KVM: PPC: Book3S: MMIO emulation support for little endian guests



MMIO emulation reads the last instruction executed by the guest
and then emulates. If the guest is running in Little Endian order,
or more generally in a different endian order of the host, the
instruction needs to be byte-swapped before being emulated.

This patch adds a helper routine which tests the endian order of
the host and the guest in order to decide whether a byteswap is
needed or not. It is then used to byteswap the last instruction
of the guest in the endian order of the host before MMIO emulation
is performed.

Finally, kvmppc_handle_load() of kvmppc_handle_store() are modified
to reverse the endianness of the MMIO if required.

Signed-off-by: default avatarCédric Le Goater <clg@fr.ibm.com>
[agraf: add booke handling]
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 7a8ff56b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment