public inbox for kvm-ppc@vger.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: kvm-ppc@vger.kernel.org
Subject: Re: [PATCH v2] KVM: PPC: bookehv: Fix save/restore of guest accessible SPRGs.
Date: Fri, 13 Apr 2012 14:15:49 +0000	[thread overview]
Message-ID: <4F883515.70909@freescale.com> (raw)
In-Reply-To: <1334315222-28228-1-git-send-email-Varun.Sethi@freescale.com>

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@freescale.com>
> ---
>   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


      reply	other threads:[~2012-04-13 14:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13 11:19 [PATCH v2] KVM: PPC: bookehv: Fix save/restore of guest accessible SPRGs Varun Sethi
2012-04-13 14:15 ` Scott Wood [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F883515.70909@freescale.com \
    --to=scottwood@freescale.com \
    --cc=kvm-ppc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox