From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PATCH v5 0/6] KVM: PPC: Book3S: MMIO support for Little Endian guests Date: Tue, 5 Nov 2013 18:22:02 +0100 Message-ID: <1383672128-26795-1-git-send-email-clg@fr.ibm.com> References: <84018BDE-858B-4F59-8AA0-9135CCFF4720@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: agraf@suse.de, paulus@samba.org Return-path: In-Reply-To: <84018BDE-858B-4F59-8AA0-9135CCFF4720@suse.de> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org MIO emulation reads the last instruction executed by the guest and then emulates. If the guest is running in Little Endian mode, the instruction needs to be byte-swapped before being emulated. The first patches add simple helper routines to load instructions from=20 the guest. It prepares ground for the byte-swapping of instructions=20 when reading memory from Little Endian guests.=20 The last patches enable the MMIO support by byte-swapping the last=20 instruction if the guest is Little Endian and add support for little endian host and Split Little Endian mode. This patchset is based on Alex Graf's kvm-ppc-queue branch. It has been= =20 tested with anton's patchset for Big Endian and Little Endian HV guests= =20 and Big Endian PR guests.=20 The kvm-ppc-queue branch I am using might be a bit outdated. The HEAD=20 is on : 0c58eb4 KVM: PPC: E500: Add userspace debug stub support Changes in v5: =20 - changed register usage slightly (paulus@samba.org) - added #ifdef CONFIG_PPC64 in book3s_segment.S (paulus@samba.org) - added support for little endian host - added support for Split Little Endian (SLE) =20 Changes in v4: - got rid of useless helper routine kvmppc_ld_inst(). (Alexander Graf) Changes in v3: - moved kvmppc_need_byteswap() in kvmppc_ld32. It previously was in kvmppc_ld_inst(). (Alexander Graf) Changes in v2: - replaced rldicl. by andi. to test the MSR_LE bit in the guest exit paths. (Paul Mackerras) - moved the byte swapping logic to kvmppc_handle_load() and=20 kvmppc_handle_load() by changing the is_bigendian parameter meaning. (Paul Mackerras) Thanks, C.=09 C=C3=A9dric Le Goater (6): KVM: PPC: Book3S: add helper routine to load guest instructions KVM: PPC: Book3S: add helper routines to detect endian KVM: PPC: Book3S: MMIO emulation support for little endian guests KVM: PPC: Book3S: modify kvmppc_need_byteswap() for little endian hos= t powerpc: add Split Little Endian bit to MSR KVM: PPC: Book3S: modify byte loading when guest uses Split Little En= dian arch/powerpc/include/asm/kvm_book3s.h | 43 +++++++++++++++++++++++= ++++++-- arch/powerpc/include/asm/kvm_ppc.h | 10 +++---- arch/powerpc/include/asm/reg.h | 3 +++ arch/powerpc/kernel/process.c | 1 + arch/powerpc/kvm/book3s_64_mmu_hv.c | 2 +- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 9 +++++++ arch/powerpc/kvm/book3s_pr.c | 2 +- arch/powerpc/kvm/book3s_segment.S | 9 +++++++ arch/powerpc/kvm/emulate.c | 1 - arch/powerpc/kvm/powerpc.c | 16 +++++++++--- 10 files changed, 82 insertions(+), 14 deletions(-) --=20 1.7.10.4