Skip to contentSkip to conversation

KVM: PPC: Memset vcpu to zeros

PATCH Applied Alexander Graf 2 participants 2 messages Feb 22, 2010 – Feb 24, 2010 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: PPC: Memset vcpu to zeros

While converting the kzalloc we used to allocate our vcpu struct to vmalloc, I forgot to memset the contents to zeros. That broke quite a lot.

This patch memsets it to zero again.

---
 arch/powerpc/kvm/book3s.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/powerpc/kvm/book3s.c +1 -0
index 794c94b..94c229d 100644
@@ -1115,6 +1115,7 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
 		err = -ENOMEM;
 		goto out;
 	}
+	memset(vcpu_book3s, 0, sizeof(struct kvmppc_vcpu_book3s));
 
 	vcpu = &vcpu_book3s->vcpu;
 	err = kvm_vcpu_init(vcpu, kvm, id);
Signature · 1 line
1.6.0.2

A message that is not in the archive (sent off-list or not yet received): 1266853928-31825-1-git-send-email-agraf-l3A5Bk7waGM@public.gmane.org

Applied
#2 lore raw
Quoted 6 lines · Alexander Graf

While converting the kzalloc we used to allocate our vcpu struct to vmalloc, I forgot to memset the contents to zeros. That broke quite a lot.

This patch memsets it to zero again.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function