kvm_update_cpuid_runtime() is currently called by various functions for the purpose of updating vCPU's cpuid entries, due to specific runtime changes, e.g. CR4 bits changes, XCR0 bits changes, etc. Each of them actually just needs to update 1 ~ 2 CPUID entries. But current kvm_update_cpuid_runtime() packages all. Given finding a target CPUID entry need to go through all CPUID entries, calling kvm_update_cpuid_runtime() is a waste for each cause. This patch set splits kvm_update_cpuid_runtime() into pieces according to different updating causes. Then let various callers call their specific necessary kvm_xxx_update_cpuid(). This not only significantly saves each caller's time, but also eliminates unnecessary couplings. Robert Hoo (9): KVM:x86: Abstract sub functions from kvm_update_cpuid_runtime() and kvm_vcpu_after_set_cpuid() KVM:x86: Substitute kvm_update_cpuid_runtime() with kvm_apic_base_update_cpuid() in kvm_lapic_set_base() KVM:x86: Substitute kvm_update_cpuid_runtime() with kvm_xcr0_update_cpuid() in __kvm_set_xcr() KVM:x86: Substitute kvm_update_cpuid_runtime() with kvm_{osxsave,pke}_update_cpuid() in kvm_set_cr4() KVM:x86: Substitute kvm_update_cpuid_runtime() with kvm_mwait_update_cpuid() in kvm_set_msr_common() KVM:x86: Substitute kvm_update_cpuid_runtime() with kvm_{osxsave,pke}_update_cpuid() in enter_smm() KVM:x86: Substitute kvm_update_cpuid_runtime() with kvm_{osxsave,pke}_update_cpuid() in __set_sregs() KVM:x86: Substitute kvm_vcpu_after_set_cpuid() with abstracted functions KVM:x86: Remove kvm_update_cpuid_runtime() arch/x86/kvm/cpuid.c | 118 ++++++++++++++++++++++++++++++++++----------------- arch/x86/kvm/cpuid.h | 7 ++- arch/x86/kvm/lapic.c | 2 +- arch/x86/kvm/x86.c | 29 ++++++++----- 4 files changed, 103 insertions(+), 53 deletions(-) -- 1.8.3.1