diff options
author | Carsten Otte <cotte@de.ibm.com> | 2007-10-11 13:16:52 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:52 -0500 |
commit | 313a3dc75da20630e549441932a7654223f8d72a (patch) | |
tree | 96af61f06c198834d49c886476ed30b418d853c0 /drivers/kvm/kvm.h | |
parent | c4fcc2724628c6548748ec80a90b548fc300e81f (diff) |
KVM: Portability: split kvm_vcpu_ioctl
This patch splits kvm_vcpu_ioctl into archtecture independent parts, and
x86 specific parts which go to kvm_arch_vcpu_ioctl in x86.c.
Common ioctls for all architectures are:
KVM_RUN, KVM_GET/SET_(S-)REGS, KVM_TRANSLATE, KVM_INTERRUPT,
KVM_DEBUG_GUEST, KVM_SET_SIGNAL_MASK, KVM_GET/SET_FPU
Note that some PPC chips don't have an FPU, so we might need an #ifdef
around KVM_GET/SET_FPU one day.
x86 specific ioctls are:
KVM_GET/SET_LAPIC, KVM_SET_CPUID, KVM_GET/SET_MSRS
An interresting aspect is vcpu_load/vcpu_put. We now have a common
vcpu_load/put which does the preemption stuff, and an architecture
specific kvm_arch_vcpu_load/put. In the x86 case, this one calls the
vmx/svm function defined in kvm_x86_ops.
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r-- | drivers/kvm/kvm.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index d56962d49aa6..1edf8a5e365e 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
@@ -537,6 +537,10 @@ extern struct kvm_x86_ops *kvm_x86_ops; | |||
537 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); | 537 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); |
538 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | 538 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); |
539 | 539 | ||
540 | void vcpu_load(struct kvm_vcpu *vcpu); | ||
541 | void vcpu_put(struct kvm_vcpu *vcpu); | ||
542 | |||
543 | |||
540 | int kvm_init_x86(struct kvm_x86_ops *ops, unsigned int vcpu_size, | 544 | int kvm_init_x86(struct kvm_x86_ops *ops, unsigned int vcpu_size, |
541 | struct module *module); | 545 | struct module *module); |
542 | void kvm_exit_x86(void); | 546 | void kvm_exit_x86(void); |
@@ -655,6 +659,11 @@ int kvm_fix_hypercall(struct kvm_vcpu *vcpu); | |||
655 | 659 | ||
656 | long kvm_arch_dev_ioctl(struct file *filp, | 660 | long kvm_arch_dev_ioctl(struct file *filp, |
657 | unsigned int ioctl, unsigned long arg); | 661 | unsigned int ioctl, unsigned long arg); |
662 | long kvm_arch_vcpu_ioctl(struct file *filp, | ||
663 | unsigned int ioctl, unsigned long arg); | ||
664 | void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu); | ||
665 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); | ||
666 | |||
658 | __init void kvm_arch_init(void); | 667 | __init void kvm_arch_init(void); |
659 | 668 | ||
660 | static inline void kvm_guest_enter(void) | 669 | static inline void kvm_guest_enter(void) |