diff mbox

target-ppc kvm: save cr register

Message ID 1369905970-27249-1-git-send-email-aik@ozlabs.ru
State New
Headers show

Commit Message

Alexey Kardashevskiy May 30, 2013, 9:26 a.m. UTC
This adds a missing code to save CR (condition register) via
kvm_arch_put_registers(). kvm_arch_get_registers() already has it.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 target-ppc/kvm.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

David Gibson June 4, 2013, 12:11 p.m. UTC | #1
On Thu, May 30, 2013 at 07:26:10PM +1000, Alexey Kardashevskiy wrote:
> This adds a missing code to save CR (condition register) via
> kvm_arch_put_registers(). kvm_arch_get_registers() already has it.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Huh.  I can't believe that's been broken for so long.  I'll put that
in my tree.

I meant to post my pending patches at the end of last week, but was
sidetracked by a minor injury :(.
Alexey Kardashevskiy June 5, 2013, 2:36 a.m. UTC | #2
On 06/04/2013 10:11 PM, David Gibson wrote:
> On Thu, May 30, 2013 at 07:26:10PM +1000, Alexey Kardashevskiy wrote:
>> This adds a missing code to save CR (condition register) via
>> kvm_arch_put_registers(). kvm_arch_get_registers() already has it.
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> 
> Huh.  I can't believe that's been broken for so long.  I'll put that
> in my tree.

We probably have another bug which compensates this one but just have not
found it yet :-D


> I meant to post my pending patches at the end of last week, but was
> sidetracked by a minor injury :(.

Sigh...
What exactly are you going to post? PCI rework?
David Gibson June 5, 2013, 9:22 a.m. UTC | #3
On Wed, Jun 05, 2013 at 12:36:04PM +1000, Alexey Kardashevskiy wrote:
> On 06/04/2013 10:11 PM, David Gibson wrote:
> > On Thu, May 30, 2013 at 07:26:10PM +1000, Alexey Kardashevskiy wrote:
> >> This adds a missing code to save CR (condition register) via
> >> kvm_arch_put_registers(). kvm_arch_get_registers() already has it.
> >>
> >> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > 
> > Huh.  I can't believe that's been broken for so long.  I'll put that
> > in my tree.
> 
> We probably have another bug which compensates this one but just have not
> found it yet :-D

Yay :/.

> > I meant to post my pending patches at the end of last week, but was
> > sidetracked by a minor injury :(.
> 
> Sigh...
> What exactly are you going to post? PCI rework?

Well until now the only thing I had in my ppc-next tree was the change
of default machine.  I have the PCI stuff too, but that's no PCI
related so I was going to post those separately, rather than as a PPC
pull request.
Alexey Kardashevskiy June 5, 2013, 10:54 a.m. UTC | #4
On 05.06.2013 19:22, David Gibson wrote:

>>> I meant to post my pending patches at the end of last week, but was
>>> sidetracked by a minor injury :(.
>>
>> Sigh...
>> What exactly are you going to post? PCI rework?
> 
> Well until now the only thing I had in my ppc-next tree was the change
> of default machine. 

btw what is going on with this patch?

> I have the PCI stuff too, but that's no PCI
> related so I was going to post those separately, rather than as a PPC
> pull request.


I guess I still want this stuff for VFIO, some bits.
David Gibson June 5, 2013, 11:12 a.m. UTC | #5
On Wed, Jun 05, 2013 at 08:54:38PM +1000, Alexey Kardashevskiy wrote:
> On 05.06.2013 19:22, David Gibson wrote:
> 
> >>> I meant to post my pending patches at the end of last week, but was
> >>> sidetracked by a minor injury :(.
> >>
> >> Sigh...
> >> What exactly are you going to post? PCI rework?
> > 
> > Well until now the only thing I had in my ppc-next tree was the change
> > of default machine. 
> 
> btw what is going on with this patch?

I've pulled it into my github tree at
git://github.com/dgibson/qemu.git, ppc-next branch.  I'm still trying
to find time to push that out.
diff mbox

Patch

diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 2bbc3b8..c89dd58 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -791,6 +791,11 @@  int kvm_arch_put_registers(CPUState *cs, int level)
     for (i = 0;i < 32; i++)
         regs.gpr[i] = env->gpr[i];
 
+    regs.cr = 0;
+    for (i = 0; i < 8; i++) {
+        regs.cr |= (env->crf[i] & 15) << (4 * (7 - i));
+    }
+
     ret = kvm_vcpu_ioctl(cs, KVM_SET_REGS, &regs);
     if (ret < 0)
         return ret;