[PATCH v2] KVM: PPC: Book3S HV: ptes are big endian

2014-11-20 Thread Cédric Le Goater
When being restored from qemu, the kvm_get_htab_header are in native endian, but the ptes are big endian. This patch fixes restore on a KVM LE host. Qemu also needs a fix for this : http://lists.nongnu.org/archive/html/qemu-ppc/2014-11/msg8.html Signed-off-by: Cédric Le Goater c

[PATCH v2] KVM: PPC: Book3S HV: ptes are big endian

2014-11-20 Thread Cédric Le Goater
When being restored from qemu, the kvm_get_htab_header are in native endian, but the ptes are big endian. This patch fixes restore on a KVM LE host. Qemu also needs a fix for this : http://lists.nongnu.org/archive/html/qemu-ppc/2014-11/msg8.html Signed-off-by: Cédric Le Goater c

[PATCH] KVM: PPC: Book3S HV: ptes are big endian

2014-11-03 Thread Cédric Le Goater
When being restored from qemu, the kvm_get_htab_header are in native endian, but the ptes are big endian. This patch fixes restore on a KVM LE host. Qemu also needs a fix for this : http://lists.nongnu.org/archive/html/qemu-ppc/2014-11/msg8.html Signed-off-by: Cédric Le Goater c

[PATCH] KVM: PPC: Book3S HV: ptes are big endian

2014-11-03 Thread Cédric Le Goater
When being restored from qemu, the kvm_get_htab_header are in native endian, but the ptes are big endian. This patch fixes restore on a KVM LE host. Qemu also needs a fix for this : http://lists.nongnu.org/archive/html/qemu-ppc/2014-11/msg8.html Signed-off-by: Cédric Le Goater c

[RFC PATCH 4/4] vhost_net: byteswap virtio_net header

2014-10-29 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- drivers/vhost/net.c | 39 ++- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 8dae2f724a35..f2d5f585dae9 100644 --- a/drivers/vhost/net.c +++ b

[RFC PATCH 1/4] vhost: add VHOST_VRING_F_BYTESWAP flag

2014-10-29 Thread Cédric Le Goater
The VHOST_VRING_F_BYTESWAP flag will be used by the host to byteswap the vring data when the guest and the host have a different endian order. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- drivers/vhost/vhost.c |5 - drivers/vhost/vhost.h |1 + include/uapi/linux

[RFC PATCH 3/4] vhost: byteswap virtqueue attributes

2014-10-29 Thread Cédric Le Goater
The virtqueue structure shares a few attributes with the guest OS which need to be byteswapped when the endian order of the host is different. This patch uses the vq-byteswap attribute to decide whether to byteswap or not data being accessed in the guest memory. Signed-off-by: Cédric Le Goater c

[RFC PATCH 0/4] vhost_net: support for cross endian guests

2014-10-29 Thread Cédric Le Goater
: trusty/ppc64le, utopic/ppc64le, debian/ppc64le, rhel6.5/ppc64, fedora21/ppc64, debian/ppc64 Regressions tests for x86_64 were done a debian host using rhel6.6, fedora20 and debian guests. Cédric Le Goater (4): vhost: add VHOST_VRING_F_BYTESWAP flag vhost: add byteswap

[RFC PATCH 2/4] vhost: add byteswap routines

2014-10-29 Thread Cédric Le Goater
This patch adds a few helper routines around get_user and put_user to ease byteswapping. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- I am not sure these routines belong to this file. There is room for improvement to remove the ugly switch (sizeof(*(ptr))). Please comment ! drivers

[RFC PATCH 3/4] vhost: byteswap virtqueue attributes

2014-10-29 Thread Cédric Le Goater
The virtqueue structure shares a few attributes with the guest OS which need to be byteswapped when the endian order of the host is different. This patch uses the vq-byteswap attribute to decide whether to byteswap or not data being accessed in the guest memory. Signed-off-by: Cédric Le Goater c

[RFC PATCH 4/4] vhost_net: byteswap virtio_net header

2014-10-29 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- drivers/vhost/net.c | 39 ++- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 8dae2f724a35..f2d5f585dae9 100644 --- a/drivers/vhost/net.c +++ b

[RFC PATCH 2/4] vhost: add byteswap routines

2014-10-29 Thread Cédric Le Goater
This patch adds a few helper routines around get_user and put_user to ease byteswapping. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- I am not sure these routines belong to this file. There is room for improvement to remove the ugly switch (sizeof(*(ptr))). Please comment ! drivers

[PATCH] KVM: PPC: Book3S HV: return htab entries in big endian

2014-10-02 Thread Cédric Le Goater
Le Goater c...@fr.ibm.com --- Tested on 3.17-rc7 with LE and BE host. Looking at the code, it is not very clear what we are doing in terms of endianness. May be this needs more work on both side, KVM and qemu, to remove the big endian assumptions ? Thanks, arch/powerpc/kvm

[PATCH] KVM: PPC: Book3S HV: return htab entries in big endian

2014-10-02 Thread Cédric Le Goater
Le Goater c...@fr.ibm.com --- Tested on 3.17-rc7 with LE and BE host. Looking at the code, it is not very clear what we are doing in terms of endianness. May be this needs more work on both side, KVM and qemu, to remove the big endian assumptions ? Thanks, arch/powerpc/kvm

[PATCH v7] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2014-01-09 Thread Cédric Le Goater
to reverse the endianness of the MMIO if required. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- How's that ? As the changes were small, I kept them in one patch but I can split if necessary. This patch was tested for Big Endian and Little Endian HV guests and Big Endian PR guests

[PATCH v8] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2014-01-09 Thread Cédric Le Goater
to reverse the endianness of the MMIO if required. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- How's that ? As the changes were small, I kept them in one patch but I can split if necessary. This patch was tested for Big Endian and Little Endian HV guests and Big Endian PR guests on 3.13

[PATCH v7] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2014-01-09 Thread Cédric Le Goater
to reverse the endianness of the MMIO if required. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- How's that ? As the changes were small, I kept them in one patch but I can split if necessary. This patch was tested for Big Endian and Little Endian HV guests and Big Endian PR guests

[PATCH v8] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2014-01-09 Thread Cédric Le Goater
to reverse the endianness of the MMIO if required. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- How's that ? As the changes were small, I kept them in one patch but I can split if necessary. This patch was tested for Big Endian and Little Endian HV guests and Big Endian PR guests on 3.13

[PATCH v6] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2014-01-08 Thread Cédric Le Goater
to reverse the endianness of the MMIO if required. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- This patch was tested for Big Endian and Little Endian HV guests and Big Endian PR guests on 3.13 (plus a h_set_mode hack) Changes in v6: - removed asm changes (Alexander Graf) - byteswaps

[PATCH v6] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2014-01-08 Thread Cédric Le Goater
to reverse the endianness of the MMIO if required. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- This patch was tested for Big Endian and Little Endian HV guests and Big Endian PR guests on 3.13 (plus a h_set_mode hack) Changes in v6: - removed asm changes (Alexander Graf) - byteswaps

[PATCH v5 0/6] KVM: PPC: Book3S: MMIO support for Little Endian guests

2013-11-05 Thread Cédric Le Goater
() and kvmppc_handle_load() by changing the is_bigendian parameter meaning. (Paul Mackerras) Thanks, C. Cédric 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

[PATCH v5 3/6] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-11-05 Thread Cédric Le Goater
() is slightly changed to represent an eventual reverse operation. This is used in conjunction with kvmppc_is_bigendian() to determine if the instruction being emulated should be byte-swapped. Signed-off-by: Cédric Le Goater c...@fr.ibm.com Signed-off-by: Paul Mackerras pau...@samba.org --- Changes

[PATCH v5 2/6] KVM: PPC: Book3S: add helper routines to detect endian

2013-11-05 Thread Cédric Le Goater
They will be used to decide whether to byte-swap or not. When Little Endian host kernels come, these routines will need to be changed accordingly. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH v5 5/6] powerpc: add Split Little Endian bit to MSR

2013-11-05 Thread Cédric Le Goater
0 0 Big Big 0 1 Little Little 1 0 Little Big 1 1 Big Little Signed-off-by: Cédric Le Goater c...@fr.ibm.com Cc: Benjamin Herrenschmidt b...@kernel.crashing.org --- This is clearly a powerpc patch

[PATCH v5 1/6] KVM: PPC: Book3S: add helper routine to load guest instructions

2013-11-05 Thread Cédric Le Goater
This patch adds an helper routine kvmppc_ld32() to load an instruction form the guest. This routine will be modified in the next patch to take into account the endian order of the guest. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Changes in v4: - got rid of useless helper routine

[PATCH v5 6/6] KVM: PPC: Book3S: modify byte loading when guest uses Split Little Endian

2013-11-05 Thread Cédric Le Goater
Instruction and data storage accesses are done in opposite order when the Split Little Endian mode is used. This patch modifies the kvmppc_ld32() routine to reverse the byteswap when the guest is in SLE mode. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm

[PATCH v5 4/6] KVM: PPC: Book3S: modify kvmppc_need_byteswap() for little endian host

2013-11-05 Thread Cédric Le Goater
If the host is in little endian order, there is no need to byte-swap in little endian guests. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h |4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc

[PATCH v5 2/6] KVM: PPC: Book3S: add helper routines to detect endian

2013-11-05 Thread Cédric Le Goater
They will be used to decide whether to byte-swap or not. When Little Endian host kernels come, these routines will need to be changed accordingly. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH v5 1/6] KVM: PPC: Book3S: add helper routine to load guest instructions

2013-11-05 Thread Cédric Le Goater
This patch adds an helper routine kvmppc_ld32() to load an instruction form the guest. This routine will be modified in the next patch to take into account the endian order of the guest. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Changes in v4: - got rid of useless helper routine

[PATCH v2 2/3] KVM: PPC: Book3S: add helper routines to detect endian

2013-10-08 Thread Cédric Le Goater
They will be used to decide whether to byte-swap or not. When Little Endian host kernels come, these routines will need to be changed accordingly. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH v2 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Cédric Le Goater
() is slightly changed to represent an eventual reverse operation. This is used in conjunction with kvmppc_is_bigendian() to determine if the instruction being emulated should be byte-swapped. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Changes in v2: - replaced rldicl. by andi. to test

[PATCH v2 1/3] KVM: PPC: Book3S: add helper routine to load guest instructions

2013-10-08 Thread Cédric Le Goater
This patch adds an helper routine kvmppc_ld_inst() to load an instruction form the guest. This routine will be modified in the next patch to take into account the endian order of the guest. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 16

[PATCH v2 0/3] KVM: PPC: Book3S: MMIO support for Little Endian guests

2013-10-08 Thread Cédric Le Goater
parameter meaning. (Paul Mackerras) Thanks, C. Cédric Le Goater (3): 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 arch/powerpc/include/asm

[PATCH v4 0/3] KVM: PPC: Book3S: MMIO support for Little Endian guests

2013-10-08 Thread Cédric Le Goater
: - 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 kvmppc_handle_load() by changing the is_bigendian parameter meaning. (Paul Mackerras) Thanks, C. Cédric Le Goater (3): KVM

[PATCH v4 1/3] KVM: PPC: Book3S: add helper routine to load guest instructions

2013-10-08 Thread Cédric Le Goater
This patch adds an helper routine kvmppc_ld32() to load an instruction form the guest. This routine will be modified in the next patch to take into account the endian order of the guest. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Changes in v4: - got rid of useless helper routine

[PATCH v4 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Cédric Le Goater
() is slightly changed to represent an eventual reverse operation. This is used in conjunction with kvmppc_is_bigendian() to determine if the instruction being emulated should be byte-swapped. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Changes in v3: - moved kvmppc_need_byteswap

[PATCH v4 2/3] KVM: PPC: Book3S: add helper routines to detect endian order

2013-10-08 Thread Cédric Le Goater
They will be used to decide whether to byte-swap or not. When Little Endian host kernels come, these routines will need to be changed accordingly. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH v2 1/3] KVM: PPC: Book3S: add helper routine to load guest instructions

2013-10-08 Thread Cédric Le Goater
This patch adds an helper routine kvmppc_ld_inst() to load an instruction form the guest. This routine will be modified in the next patch to take into account the endian order of the guest. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 16

[PATCH v2 0/3] KVM: PPC: Book3S: MMIO support for Little Endian guests

2013-10-08 Thread Cédric Le Goater
parameter meaning. (Paul Mackerras) Thanks, C. Cédric Le Goater (3): 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 arch/powerpc/include/asm

[PATCH v2 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Cédric Le Goater
() is slightly changed to represent an eventual reverse operation. This is used in conjunction with kvmppc_is_bigendian() to determine if the instruction being emulated should be byte-swapped. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Changes in v2: - replaced rldicl. by andi. to test

[PATCH v2 2/3] KVM: PPC: Book3S: add helper routines to detect endian

2013-10-08 Thread Cédric Le Goater
They will be used to decide whether to byte-swap or not. When Little Endian host kernels come, these routines will need to be changed accordingly. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH v3 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Cédric Le Goater
() is slightly changed to represent an eventual reverse operation. This is used in conjunction with kvmppc_is_bigendian() to determine if the instruction being emulated should be byte-swapped. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Changes in v3: - moved kvmppc_need_byteswap

[PATCH v4 0/3] KVM: PPC: Book3S: MMIO support for Little Endian guests

2013-10-08 Thread Cédric Le Goater
: - 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 kvmppc_handle_load() by changing the is_bigendian parameter meaning. (Paul Mackerras) Thanks, C. Cédric Le Goater (3): KVM

[PATCH v4 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-08 Thread Cédric Le Goater
() is slightly changed to represent an eventual reverse operation. This is used in conjunction with kvmppc_is_bigendian() to determine if the instruction being emulated should be byte-swapped. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Changes in v3: - moved kvmppc_need_byteswap

[PATCH v4 1/3] KVM: PPC: Book3S: add helper routine to load guest instructions

2013-10-08 Thread Cédric Le Goater
This patch adds an helper routine kvmppc_ld32() to load an instruction form the guest. This routine will be modified in the next patch to take into account the endian order of the guest. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Changes in v4: - got rid of useless helper routine

[PATCH v4 2/3] KVM: PPC: Book3S: add helper routines to detect endian order

2013-10-08 Thread Cédric Le Goater
They will be used to decide whether to byte-swap or not. When Little Endian host kernels come, these routines will need to be changed accordingly. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH 0/3] KVM: PPC: Book3S: MMIO support for Little Endian guests

2013-10-07 Thread Cédric Le Goater
is Little Endian. This patchset is based on Alex Graf's kvm-ppc-queue branch. It has been tested with anton's patchset for Big Endian and Little Endian HV guests and Big Endian PR guests. Thanks, C. Cédric Le Goater (3): KVM: PPC: Book3S: add helper routine to load guest instructions KVM: PPC

[PATCH 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-07 Thread Cédric Le Goater
to be done. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h |9 +++- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 12 ++ arch/powerpc/kvm/book3s_segment.S | 11 + arch/powerpc/kvm/emulate.c | 72

[PATCH 1/3] KVM: PPC: Book3S: add helper routine to load guest instructions

2013-10-07 Thread Cédric Le Goater
This patch adds an helper routine kvmppc_ld_inst() to load an instruction form the guest. This routine will be modified in the next patches to take into account the endian order of the guest. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 16

[PATCH 2/3] KVM: PPC: Book3S: add helper routines to detect endian order

2013-10-07 Thread Cédric Le Goater
They will be used to decide whether to byte-swap or not. When Little Endian host kernels come, these routines will need to be changed accordingly. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 10 ++ 1 file changed, 10 insertions(+) diff

[PATCH 0/3] KVM: PPC: Book3S: MMIO support for Little Endian guests

2013-10-07 Thread Cédric Le Goater
is Little Endian. This patchset is based on Alex Graf's kvm-ppc-queue branch. It has been tested with anton's patchset for Big Endian and Little Endian HV guests and Big Endian PR guests. Thanks, C. Cédric Le Goater (3): KVM: PPC: Book3S: add helper routine to load guest instructions KVM: PPC

[PATCH 1/3] KVM: PPC: Book3S: add helper routine to load guest instructions

2013-10-07 Thread Cédric Le Goater
This patch adds an helper routine kvmppc_ld_inst() to load an instruction form the guest. This routine will be modified in the next patches to take into account the endian order of the guest. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 16

[PATCH 3/3] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-07 Thread Cédric Le Goater
to be done. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h |9 +++- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 12 ++ arch/powerpc/kvm/book3s_segment.S | 11 + arch/powerpc/kvm/emulate.c | 72

[PATCH 2/3] KVM: PPC: Book3S: add helper routines to detect endian order

2013-10-07 Thread Cédric Le Goater
They will be used to decide whether to byte-swap or not. When Little Endian host kernels come, these routines will need to be changed accordingly. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- arch/powerpc/include/asm/kvm_book3s.h | 10 ++ 1 file changed, 10 insertions(+) diff

[RFC PATCH] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-03 Thread Cédric Le Goater
. The patch is based on Alex Graf's kvm-ppc-queue branch and it has been tested on Big Endian and Little Endian HV guests and Big Endian PR guests. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Here are some comments/questions : * the host is assumed to be running in Big Endian. when

[RFC PATCH] KVM: PPC: Book3S: MMIO emulation support for little endian guests

2013-10-03 Thread Cédric Le Goater
. The patch is based on Alex Graf's kvm-ppc-queue branch and it has been tested on Big Endian and Little Endian HV guests and Big Endian PR guests. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- Here are some comments/questions : * the host is assumed to be running in Big Endian. when