[PATCH v3 0/9] MIPS: KVM: Bugfixes and cleanups

2014-06-24 Thread Deng-Cheng Zhu
etect renames). o Add patch #8. Deng-Cheng Zhu (8): MIPS: KVM: Reformat code and comments MIPS: KVM: Use KVM internal logger MIPS: KVM: Simplify functions by removing redundancy MIPS: KVM: Remove unneeded volatile MIPS: KVM: Rename files to remove the prefix "kvm_" and "kv

[PATCH v3 8/9] MIPS: KVM: Skip memory cleaning in kvm_mips_commpage_init()

2014-06-24 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu 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. Signed-off-by: Deng-Cheng Zhu --- arch/mips/kvm/commpage.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch

[PATCH v3 4/9] MIPS: KVM: Remove unneeded volatile

2014-06-24 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu The keyword volatile for idx in the TLB functions is unnecessary. Signed-off-by: Deng-Cheng Zhu --- arch/mips/kvm/kvm_tlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/kvm/kvm_tlb.c b/arch/mips/kvm/kvm_tlb.c index 29a5bdb..bbcd822

[PATCH v3 6/9] MIPS: KVM: Restore correct value for WIRED at TLB uninit

2014-06-24 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu At TLB initialization, the commpage TLB entry is reserved on top of the existing WIRED entries (the number not necessarily be 0). Signed-off-by: Deng-Cheng Zhu --- arch/mips/kvm/mips.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/kvm

[PATCH v3 9/9] MIPS: KVM: Remove dead code of TLB index error in kvm_mips_emul_tlbwr()

2014-06-24 Thread Deng-Cheng Zhu
From: James Hogan It's impossible to fall into the error handling of the TLB index after being masked by (KVM_MIPS_GUEST_TLB_SIZE - 1). Remove the dead code. Signed-off-by: James Hogan Signed-off-by: Deng-Cheng Zhu --- arch/mips/kvm/emulate.c | 5 - 1 file changed, 5 deletions(-)

[PATCH v3 7/9] MIPS: KVM: Fix memory leak on VCPU

2014-06-24 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu kvm_arch_vcpu_free() is called in 2 code paths: 1) kvm_vm_ioctl() kvm_vm_ioctl_create_vcpu() kvm_arch_vcpu_destroy() kvm_arch_vcpu_free() 2) kvm_put_kvm() kvm_destroy_vm() kvm_arch_destroy_vm

[PATCH v3 2/9] MIPS: KVM: Use KVM internal logger

2014-06-24 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu Replace printks with kvm_[err|info|debug]. Signed-off-by: Deng-Cheng Zhu --- Changes: v3 - v2: o Change the use of kvm_[err|info|debug]. arch/mips/kvm/kvm_mips.c | 23 - arch/mips/kvm/kvm_mips_emul.c | 107 - arch

[PATCH v3 5/9] MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_"

2014-06-24 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu Since all the files are in arch/mips/kvm/, there's no need of the prefixes "kvm_" and "kvm_mips_". Signed-off-by: Deng-Cheng Zhu --- arch/mips/kvm/Makefile| 8 arch/mips/kvm/{kvm_cb.c => callback.c}

[PATCH v3 3/9] MIPS: KVM: Simplify functions by removing redundancy

2014-06-24 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu No logic changes inside. Signed-off-by: Deng-Cheng Zhu --- Changes: v3 - v2: o Add err removal in kvm_arch_commit_memory_region(). o Revert the changes to kvm_arch_vm_ioctl(). arch/mips/include/asm/kvm_host.h | 2 +- arch/mips/kvm/kvm_mips.c | 18

[PATCH v4 0/7] MIPS: KVM: Bugfixes and cleanups

2014-06-26 Thread Deng-Cheng Zhu
x27;t change the opening comment mark for kernel-doc comments. o In patch #1, to make long lines more readable, use local variables / macros. o In patch #1, slight format adjustments are made. o Use -M flag to generate patches (detect renames). o Add patch #8. Deng-Cheng Zhu (7): MIPS: KVM: Reformat

[PATCH v4 4/7] MIPS: KVM: Remove unneeded volatile

2014-06-26 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu The keyword volatile for idx in the TLB functions is unnecessary. Reviewed-by: James Hogan Signed-off-by: Deng-Cheng Zhu --- arch/mips/kvm/kvm_tlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/kvm/kvm_tlb.c b/arch/mips/kvm/kvm_tlb.c

[PATCH v4 3/7] MIPS: KVM: Simplify functions by removing redundancy

2014-06-26 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu No logic changes inside. Reviewed-by: James Hogan Signed-off-by: Deng-Cheng Zhu --- Changes: v3 - v2: o Add err removal in kvm_arch_commit_memory_region(). o Revert the changes to kvm_arch_vm_ioctl(). arch/mips/include/asm/kvm_host.h | 2 +- arch/mips/kvm/kvm_mips.c

[PATCH v4 6/7] MIPS: KVM: Skip memory cleaning in kvm_mips_commpage_init()

2014-06-26 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu 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 --- arch/mips/kvm/commpage.c | 3 --- 1 file changed, 3 dele

[PATCH v4 2/7] MIPS: KVM: Use KVM internal logger

2014-06-26 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu Replace printks with kvm_[err|info|debug]. Signed-off-by: Deng-Cheng Zhu --- Changes: v4 - v3: o Use kvm_debug instead of kvm_err in kvm_mips_check_privilege(). v3 - v2: o Change the use of kvm_[err|info|debug]. arch/mips/kvm/kvm_mips.c | 23 - arch/mips

[PATCH v4 5/7] MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_"

2014-06-26 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu 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 --- arch/mips/kvm/Makefile| 8 arch/mips/kv

[PATCH v4 7/7] MIPS: KVM: Remove dead code of TLB index error in kvm_mips_emul_tlbwr()

2014-06-26 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu It's impossible to fall into the error handling of the TLB index after being masked by (KVM_MIPS_GUEST_TLB_SIZE - 1). Remove the dead code. Reported-by: James Hogan Signed-off-by: Deng-Cheng Zhu --- arch/mips/kvm/emulate.c | 5 - 1 file changed, 5 deletions(-)

Re: [PATCH v4 5/7] MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_"

2014-06-26 Thread Deng-Cheng Zhu
On 06/26/2014 12:28 PM, David Daney wrote: On 06/26/2014 12:11 PM, Deng-Cheng Zhu wrote: From: Deng-Cheng Zhu Since all the files are in arch/mips/kvm/, there's no need of the prefixes "kvm_" and "kvm_mips_". I don't like this change. It will leads me to con

Re: [PATCH v4 5/7] MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_"

2014-06-26 Thread Deng-Cheng Zhu
On 06/26/2014 02:55 PM, David Daney wrote: On 06/26/2014 12:55 PM, Deng-Cheng Zhu wrote: On 06/26/2014 12:28 PM, David Daney wrote: On 06/26/2014 12:11 PM, Deng-Cheng Zhu wrote: From: Deng-Cheng Zhu Since all the files are in arch/mips/kvm/, there's no need of the prefixes "

Re: [PATCH v4 5/7] MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_"

2014-06-26 Thread Deng-Cheng Zhu
On 06/26/2014 02:55 PM, David Daney wrote: On 06/26/2014 12:55 PM, Deng-Cheng Zhu wrote: On 06/26/2014 12:28 PM, David Daney wrote: On 06/26/2014 12:11 PM, Deng-Cheng Zhu wrote: From: Deng-Cheng Zhu Since all the files are in arch/mips/kvm/, there's no need of the prefixes "

Re: [PATCH v3 7/9] MIPS: KVM: Fix memory leak on VCPU

2014-06-27 Thread Deng-Cheng Zhu
Hi Paolo, On 06/25/2014 05:17 AM, Paolo Bonzini wrote: Il 25/06/2014 11:28, James Hogan ha scritto: On 24/06/14 18:31, Deng-Cheng Zhu wrote: From: Deng-Cheng Zhu kvm_arch_vcpu_free() is called in 2 code paths: 1) kvm_vm_ioctl() kvm_vm_ioctl_create_vcpu

[PATCH] MIPS: KVM: remove the stale memory alias support function unalias_gfn

2014-05-29 Thread Deng-Cheng Zhu
From: Deng-Cheng Zhu The memory alias support has been removed since a1f4d39500 (KVM: Remove memory alias support). So remove unalias_gfn from the MIPS port. Reviewed-by: James Hogan Signed-off-by: Deng-Cheng Zhu --- arch/mips/kvm/kvm_mips.c | 5 - 1 file changed, 5 deletions(-) diff