On 04/13/2012 06:07 AM, Varun Sethi wrote:
For Guest accessible SPRGs 4-7, save/restore must be handled differently for 64bit and non-64 bit case. The registers are maintained as 64 bit copies by KVM. While saving/restoring for the non-64 bit case we should always take the lower 4 bytes. Signed-off-by: Varun Sethi<Varun.Sethi@xxxxxxxxxxxxx> --- arch/powerpc/kvm/bookehv_interrupts.S | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S index 909e96e..98751af 100644 --- a/arch/powerpc/kvm/bookehv_interrupts.S +++ b/arch/powerpc/kvm/bookehv_interrupts.S @@ -40,6 +40,14 @@ #define VCPU_GPR(n) (VCPU_GPRS + (n * LONGBYTES)) #define VCPU_GUEST_SPRG(n) (VCPU_GUEST_SPRGS + (n * LONGBYTES)) +#ifdef CONFIG_64BIT +#define PPC_STD(sreg, offset, areg) std sreg, offset(areg) +#define PPC_LD(treg, offset, areg) ld treg, offset(areg) +#else +#define PPC_STD(sreg, offset, areg) stw sreg, offset+4(areg) +#define PPC_LD(treg, offset, areg) lwz treg, offset+4(areg)
Please use parentheses around "offset". -Scott -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html