From: chenjiajun chenjiajun8@huawei.com
euleros inclusion category: bugfix bugzilla: NA CVE: NA
Since commit bbb5023b977a ("kvm: debugfs: Export vcpu stat via debugfs") add vcpu_stat debugfs entry for arm64 and x86 introduce some architecture independent code, which will cause compile err in other arches.
So, modify vcpu_stat arch support to avoid compile err in arches such as mips, ppc,s390 and etc.
Fixes: bbb5023b977 ("kvm: debugfs: Export vcpu stat via debugfs") Signed-off-by: chenjiajun chenjiajun8@huawei.com Reviewed-by: Zenghui Yu yuzenghui@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- virt/kvm/kvm_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 9768ab63ef30..38fbd4c3aba8 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -141,6 +141,11 @@ static void kvm_uevent_notify_change(unsigned int type, struct kvm *kvm); static unsigned long long kvm_createvm_count; static unsigned long long kvm_active_vms;
+/* debugfs entries of Detail For vcpu stat EXtension */ +__weak struct dfx_kvm_stats_debugfs_item dfx_debugfs_entries[] = { + { NULL } +}; + __weak void kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm, unsigned long start, unsigned long end) { @@ -2908,8 +2913,9 @@ static long kvm_vcpu_ioctl(struct file *filp, if (oldpid) synchronize_rcu(); put_pid(oldpid); - /* NOTE: only work on aarch64 */ +#if defined(CONFIG_X86) || defined(CONFIG_ARM64) vcpu->stat.pid = current->pid; +#endif /* defined(CONFIG_X86) || defined (CONFIG_ARM64) */ } r = kvm_arch_vcpu_ioctl_run(vcpu, vcpu->run); trace_kvm_userspace_exit(vcpu->run->exit_reason, r);