• C
    KVM: PPC: Book3S: MMIO emulation support for little endian guests · 73601775
    Cédric Le Goater 提交于
    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: NCédric Le Goater <clg@fr.ibm.com>
    [agraf: add booke handling]
    Signed-off-by: NAlexander Graf <agraf@suse.de>
    73601775
book3s_64_mmu_hv.c 41.0 KB