Re: [PATCH 03/18] KVM: PPC: Teach MMIO Signedness

2010-02-07 Thread Anthony Liguori
On 02/07/2010 03:35 PM, Alexander Graf wrote: It's technically implementation dependent but I don't know of an implementation that doesn't sign extend. Hrm, would gpr = (s64)(s32)gpr; work? :) Yes. Integer promotion does guarantee sign extension. Regards, Anthony Liguori Alex -- To

Re: [PATCH 00/18] KVM: PPC: Virtualize Gekko guests

2010-02-07 Thread Alexander Graf
Avi Kivity wrote: > On 02/07/2010 05:49 PM, Alexander Graf wrote: >> Am 07.02.2010 um 13:54 schrieb Avi Kivity : >> >>> On 02/04/2010 05:55 PM, Alexander Graf wrote: In an effort to get KVM on PPC more useful for other userspace users than Qemu, I figured it'd be a nice idea to imple

Re: [PATCH 03/18] KVM: PPC: Teach MMIO Signedness

2010-02-07 Thread Alexander Graf
Am 07.02.2010 um 17:27 schrieb Anthony Liguori : On 02/07/2010 06:32 AM, Avi Kivity wrote: On 02/04/2010 05:55 PM, Alexander Graf wrote: The guest I was trying to get to run uses the LHA and LHAU instructions. Those instructions basically do a load, but also sign extend the result. Since

Re: [PATCH 03/18] KVM: PPC: Teach MMIO Signedness

2010-02-07 Thread Anthony Liguori
On 02/07/2010 06:32 AM, Avi Kivity wrote: On 02/04/2010 05:55 PM, Alexander Graf wrote: The guest I was trying to get to run uses the LHA and LHAU instructions. Those instructions basically do a load, but also sign extend the result. Since we need to fill our registers by hand when doing MMIO,

Re: [PATCH 00/18] KVM: PPC: Virtualize Gekko guests

2010-02-07 Thread Avi Kivity
On 02/07/2010 05:49 PM, Alexander Graf wrote: Am 07.02.2010 um 13:54 schrieb Avi Kivity : On 02/04/2010 05:55 PM, Alexander Graf wrote: In an effort to get KVM on PPC more useful for other userspace users than Qemu, I figured it'd be a nice idea to implement virtualization of the Gekko CPU.

Re: [PATCH 18/18] KVM: PPC: Implement Paired Single emulation

2010-02-07 Thread Avi Kivity
On 02/07/2010 05:57 PM, Alexander Graf wrote:+ +dprintk(KERN_INFO "FPU Emulator 0x%x ( 0x%llx, 0x%llx, 0x%llx )", inst, +inout[1], inout[2], inout[3]); + +call_stack =&kvmppc_call_stack[(smp_processor_id() * 2)]; +call_stack[0] = inst; +/* call_stack[1] is INS_BLR

Re: [PATCH 03/18] KVM: PPC: Teach MMIO Signedness

2010-02-07 Thread Avi Kivity
On 02/07/2010 05:51 PM, Alexander Graf wrote: +if (vcpu->arch.mmio_sign_extend) { +switch (run->mmio.len) { +#ifdef CONFIG_PPC64 +case 4: +if (gpr& 0x8000) +gpr |= 0xULL; +break; Wouldn't gpr = (s64)(gpr << 32)

Re: [PATCH 18/18] KVM: PPC: Implement Paired Single emulation

2010-02-07 Thread Alexander Graf
Am 07.02.2010 um 13:50 schrieb Avi Kivity : On 02/04/2010 05:55 PM, Alexander Graf wrote: The one big thing about the Gekko is paired singles. Paired singles are an extension to the instruction set, that adds 32 single precision floating point registers (qprs), some SPRs to modify the beh

Re: [PATCH 02/18] KVM: PPC: Enable MMIO to do 64 bits, fprs and qprs

2010-02-07 Thread Alexander Graf
Am 07.02.2010 um 13:29 schrieb Avi Kivity : On 02/04/2010 05:55 PM, Alexander Graf wrote: Right now MMIO access can only happen for GPRs and is at most 32 bit wide. That's actually enough for almost all types of hardware out there. Unfortunately, the guest I was using used FPU writes to MMI

Re: [PATCH 03/18] KVM: PPC: Teach MMIO Signedness

2010-02-07 Thread Alexander Graf
Am 07.02.2010 um 13:32 schrieb Avi Kivity : On 02/04/2010 05:55 PM, Alexander Graf wrote: The guest I was trying to get to run uses the LHA and LHAU instructions. Those instructions basically do a load, but also sign extend the result. Since we need to fill our registers by hand when doin

Re: [PATCH 00/18] KVM: PPC: Virtualize Gekko guests

2010-02-07 Thread Alexander Graf
Am 07.02.2010 um 13:54 schrieb Avi Kivity : On 02/04/2010 05:55 PM, Alexander Graf wrote: In an effort to get KVM on PPC more useful for other userspace users than Qemu, I figured it'd be a nice idea to implement virtualization of the Gekko CPU. The Gekko is the CPU used in the GameCube. I

Re: [PATCH 00/18] KVM: PPC: Virtualize Gekko guests

2010-02-07 Thread Avi Kivity
On 02/04/2010 05:55 PM, Alexander Graf wrote: In an effort to get KVM on PPC more useful for other userspace users than Qemu, I figured it'd be a nice idea to implement virtualization of the Gekko CPU. The Gekko is the CPU used in the GameCube. In a slightly more modern fashion it lives on in th

Re: [PATCH 18/18] KVM: PPC: Implement Paired Single emulation

2010-02-07 Thread Avi Kivity
On 02/04/2010 05:55 PM, Alexander Graf wrote: The one big thing about the Gekko is paired singles. Paired singles are an extension to the instruction set, that adds 32 single precision floating point registers (qprs), some SPRs to modify the behavior of paired singled operations and instructions

Re: [PATCH 03/18] KVM: PPC: Teach MMIO Signedness

2010-02-07 Thread Avi Kivity
On 02/04/2010 05:55 PM, Alexander Graf wrote: The guest I was trying to get to run uses the LHA and LHAU instructions. Those instructions basically do a load, but also sign extend the result. Since we need to fill our registers by hand when doing MMIO, we also need to sign extend manually. This

Re: [PATCH 02/18] KVM: PPC: Enable MMIO to do 64 bits, fprs and qprs

2010-02-07 Thread Avi Kivity
On 02/04/2010 05:55 PM, Alexander Graf wrote: Right now MMIO access can only happen for GPRs and is at most 32 bit wide. That's actually enough for almost all types of hardware out there. Unfortunately, the guest I was using used FPU writes to MMIO regions, so it ended up writing 64 bit MMIOs us