[PATCH] powerpc/kvm: Copy the pvr value after memset

Subsystems: kernel virtual machine for powerpc (kvm/powerpc), linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

STALE4813d

2 messages, 2 authors, 2013-08-22 · open the first message on its own page

[PATCH] powerpc/kvm: Copy the pvr value after memset

From: Aneesh Kumar K.V <hidden>
Date: 2013-08-22 11:38:47

From: "Aneesh Kumar K.V" <redacted>

Otherwise we would clear the pvr value

Signed-off-by: Aneesh Kumar K.V <redacted>
---
 arch/powerpc/kvm/book3s_hv.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 2efa9dd..dd1b72c 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -680,13 +680,12 @@ static int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
 }
 
 int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
-                                  struct kvm_sregs *sregs)
+				  struct kvm_sregs *sregs)
 {
 	int i;
 
-	sregs->pvr = vcpu->arch.pvr;
-
 	memset(sregs, 0, sizeof(struct kvm_sregs));
+	sregs->pvr = vcpu->arch.pvr;
 	for (i = 0; i < vcpu->arch.slb_max; i++) {
 		sregs->u.s.ppc64.slb[i].slbe = vcpu->arch.slb[i].orige;
 		sregs->u.s.ppc64.slb[i].slbv = vcpu->arch.slb[i].origv;
@@ -696,7 +695,7 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
 }
 
 int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
-                                  struct kvm_sregs *sregs)
+				  struct kvm_sregs *sregs)
 {
 	int i, j;
 
-- 
1.8.1.2

Re: [PATCH] powerpc/kvm: Copy the pvr value after memset

From: Alexander Graf <hidden>
Date: 2013-08-22 16:48:04

On 22.08.2013, at 12:38, Aneesh Kumar K.V wrote:
From: "Aneesh Kumar K.V" <redacted>
=20
Otherwise we would clear the pvr value
=20
Signed-off-by: Aneesh Kumar K.V <redacted>
Thanks, applied to kvm-ppc-queue. Next time please do whitespace changes =
in a separate patch.


Alex
quoted hunk
---
arch/powerpc/kvm/book3s_hv.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
=20
diff --git a/arch/powerpc/kvm/book3s_hv.c =
b/arch/powerpc/kvm/book3s_hv.c
quoted hunk
index 2efa9dd..dd1b72c 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -680,13 +680,12 @@ static int kvmppc_handle_exit(struct kvm_run =
*run, struct kvm_vcpu *vcpu,
}
=20
int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
-                                  struct kvm_sregs *sregs)
+				  struct kvm_sregs *sregs)
{
	int i;
=20
-	sregs->pvr =3D vcpu->arch.pvr;
-
	memset(sregs, 0, sizeof(struct kvm_sregs));
+	sregs->pvr =3D vcpu->arch.pvr;
	for (i =3D 0; i < vcpu->arch.slb_max; i++) {
		sregs->u.s.ppc64.slb[i].slbe =3D =
vcpu->arch.slb[i].orige;
		sregs->u.s.ppc64.slb[i].slbv =3D =
vcpu->arch.slb[i].origv;
quoted hunk
@@ -696,7 +695,7 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu =
*vcpu,
}
=20
int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
-                                  struct kvm_sregs *sregs)
+				  struct kvm_sregs *sregs)
{
	int i, j;
=20
--=20
1.8.1.2
=20
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help