From d7d5b05faf1679849c5220627c7263b4041e15ef Mon Sep 17 00:00:00 2001 From: Deng-Cheng Zhu Date: Thu, 26 Jun 2014 12:11:38 -0700 Subject: MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_" Since all the files are in arch/mips/kvm/, there's no need of the prefixes "kvm_" and "kvm_mips_". Reviewed-by: James Hogan Signed-off-by: Deng-Cheng Zhu Signed-off-by: Paolo Bonzini --- arch/mips/kvm/commpage.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 arch/mips/kvm/commpage.c (limited to 'arch/mips/kvm/commpage.c') diff --git a/arch/mips/kvm/commpage.c b/arch/mips/kvm/commpage.c new file mode 100644 index 000000000000..61b9c043ea09 --- /dev/null +++ b/arch/mips/kvm/commpage.c @@ -0,0 +1,36 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * commpage, currently used for Virtual COP0 registers. + * Mapped into the guest kernel @ 0x0. + * + * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. + * Authors: Sanjay Lal + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "commpage.h" + +void kvm_mips_commpage_init(struct kvm_vcpu *vcpu) +{ + struct kvm_mips_commpage *page = vcpu->arch.kseg0_commpage; + + memset(page, 0, sizeof(struct kvm_mips_commpage)); + + /* Specific init values for fields */ + vcpu->arch.cop0 = &page->cop0; + memset(vcpu->arch.cop0, 0, sizeof(struct mips_coproc)); +} -- cgit v1.2.3 From db2fb7f202ba1d1b2c6532b359b7c763bf17fe72 Mon Sep 17 00:00:00 2001 From: Deng-Cheng Zhu Date: Thu, 26 Jun 2014 12:11:39 -0700 Subject: MIPS: KVM: Skip memory cleaning in kvm_mips_commpage_init() The commpage is allocated using kzalloc(), so there's no need of cleaning the memory of the kvm_mips_commpage struct and its internal mips_coproc. Reviewed-by: James Hogan Signed-off-by: Deng-Cheng Zhu Signed-off-by: Paolo Bonzini --- arch/mips/kvm/commpage.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch/mips/kvm/commpage.c') diff --git a/arch/mips/kvm/commpage.c b/arch/mips/kvm/commpage.c index 61b9c043ea09..2d6e976d1add 100644 --- a/arch/mips/kvm/commpage.c +++ b/arch/mips/kvm/commpage.c @@ -28,9 +28,6 @@ void kvm_mips_commpage_init(struct kvm_vcpu *vcpu) { struct kvm_mips_commpage *page = vcpu->arch.kseg0_commpage; - memset(page, 0, sizeof(struct kvm_mips_commpage)); - /* Specific init values for fields */ vcpu->arch.cop0 = &page->cop0; - memset(vcpu->arch.cop0, 0, sizeof(struct mips_coproc)); } -- cgit v1.2.3