When reading the vcpu creationg flow of vmx, I find it hard to follow since it mixes the data structure allocation and initilization together. This series tries to make the vcpu creation flow more clear that first allocating data structure and then initializing them. In this way, it helps move FPU allocation to generic x86 code (Patch 4). This series intends to do no functional change. I just tested it with kvm_unit_tests for vmx since I have no AMD machine at hand. Xiaoyao Li (4): KVM: VMX: rename {vmx,nested_vmx}_vcpu_setup functions KVM: VMX: Setup MSR bitmap only when has msr_bitmap capability KVM: X86: Refactor kvm_arch_vcpu_create KVM: X86: Make vcpu's FPU allocation a common function arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/svm.c | 81 ++++++--------- arch/x86/kvm/vmx/nested.c | 2 +- arch/x86/kvm/vmx/nested.h | 2 +- arch/x86/kvm/vmx/vmx.c | 173 ++++++++++++++------------------ arch/x86/kvm/x86.c | 40 ++++++++ 6 files changed, 150 insertions(+), 149 deletions(-) -- 2.19.1