KVM: Move cpuid code to new file
PATCH 1/1 KVM: Move cpuid code to new file
The cpuid code has grown; put it into a separate file.
Signed-off-by Avi Kivity <[email protected]>
--- arch/x86/kvm/Makefile | 2 +- arch/x86/kvm/cpuid.c | 629 ++++++++++++++++++++++++++++++++++++++++++++++++ arch/x86/kvm/cpuid.h | 46 ++++ arch/x86/kvm/lapic.c | 1 + arch/x86/kvm/vmx.c | 1 + arch/x86/kvm/x86.c | 638 +------------------------------------------------ arch/x86/kvm/x86.h | 5 +- 7 files changed, 683 insertions(+), 639 deletions(-) create mode 100644 arch/x86/kvm/cpuid.c create mode 100644 arch/x86/kvm/cpuid.h
arch/x86/kvm/Makefile +1 -1
@@ -12,7 +12,7 @@ kvm-$(CONFIG_IOMMU_API) += $(addprefix ../../../virt/kvm/, iommu.o) kvm-$(CONFIG_KVM_ASYNC_PF) += $(addprefix ../../../virt/kvm/, async_pf.o) kvm-y += x86.o mmu.o emulate.o i8259.o irq.o lapic.o \ - i8254.o timer.o + i8254.o timer.o cpuid.o kvm-intel-y += vmx.o kvm-amd-y += svm.o
arch/x86/kvm/cpuid.c new file +629 -0
629 lines not on this page · raw message
arch/x86/kvm/cpuid.h new file +46 -0
46 lines not on this page · raw message
arch/x86/kvm/lapic.c +1 -0
@@ -38,6 +38,7 @@#include "irq.h" #include "trace.h" #include "x86.h" +#include "cpuid.h" #ifndef CONFIG_X86_64 #define mod_64 (x, y) ((x) - (y) * div64_u64(x, y))
arch/x86/kvm/vmx.c +1 -0
@@ -18,6 +18,7 @@#include "irq.h" #include "mmu.h" +#include "cpuid.h" #include <linux/kvm_host.h> #include <linux/module.h>
arch/x86/kvm/x86.c +3 -635
680 lines not on this page · raw message
arch/x86/kvm/x86.h +2 -3
@@ -33,9 +33,6 @@ static inline bool kvm_exception_is_soft(unsigned int nr)return (nr ==BP_VECTOR ) || (nr ==OF_VECTOR ); } -struct kvm_cpuid_entry2 *kvm_find_cpuid_entry (struct kvm_vcpu *vcpu, -u32 function,u32 index); -static inline bool is_protmode (struct kvm_vcpu *vcpu) {return kvm_read_cr0_bits (vcpu,X86_CR0_PE );
@@ -125,4 +122,6 @@ int kvm_write_guest_virt_system(struct x86_emulate_ctxt *ctxt, gva_t addr, void *val, unsigned int bytes, struct x86_exception *exception); +extern u64 host_xcr0; +#endif
Signature · 1 line
1.7.7.1