diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 20:16:21 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 20:16:21 -0400 |
| commit | 98edb6ca4174f17a64890a02f44c211c8b44fb3c (patch) | |
| tree | 033bc5f7da410046d28dd1cefcd2d63cda33d25b /include/linux | |
| parent | a8251096b427283c47e7d8f9568be6b388dd68ec (diff) | |
| parent | 8fbf065d625617bbbf6b72d5f78f84ad13c8b547 (diff) | |
Merge branch 'kvm-updates/2.6.35' of git://git.kernel.org/pub/scm/virt/kvm/kvm
* 'kvm-updates/2.6.35' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (269 commits)
KVM: x86: Add missing locking to arch specific vcpu ioctls
KVM: PPC: Add missing vcpu_load()/vcpu_put() in vcpu ioctls
KVM: MMU: Segregate shadow pages with different cr0.wp
KVM: x86: Check LMA bit before set_efer
KVM: Don't allow lmsw to clear cr0.pe
KVM: Add cpuid.txt file
KVM: x86: Tell the guest we'll warn it about tsc stability
x86, paravirt: don't compute pvclock adjustments if we trust the tsc
x86: KVM guest: Try using new kvm clock msrs
KVM: x86: export paravirtual cpuid flags in KVM_GET_SUPPORTED_CPUID
KVM: x86: add new KVMCLOCK cpuid feature
KVM: x86: change msr numbers for kvmclock
x86, paravirt: Add a global synchronization point for pvclock
x86, paravirt: Enable pvclock flags in vcpu_time_info structure
KVM: x86: Inject #GP with the right rip on efer writes
KVM: SVM: Don't allow nested guest to VMMCALL into host
KVM: x86: Fix exception reinjection forced to true
KVM: Fix wallclock version writing race
KVM: MMU: Don't read pdptrs with mmu spinlock held in mmu_alloc_roots
KVM: VMX: enable VMXON check with SMX enabled (Intel TXT)
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/kvm.h | 26 | ||||
| -rw-r--r-- | include/linux/kvm_host.h | 16 | ||||
| -rw-r--r-- | include/linux/tboot.h | 1 |
3 files changed, 41 insertions, 2 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 60df9c84ecae..23ea02253900 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
| @@ -160,6 +160,7 @@ struct kvm_pit_config { | |||
| 160 | #define KVM_EXIT_DCR 15 | 160 | #define KVM_EXIT_DCR 15 |
| 161 | #define KVM_EXIT_NMI 16 | 161 | #define KVM_EXIT_NMI 16 |
| 162 | #define KVM_EXIT_INTERNAL_ERROR 17 | 162 | #define KVM_EXIT_INTERNAL_ERROR 17 |
| 163 | #define KVM_EXIT_OSI 18 | ||
| 163 | 164 | ||
| 164 | /* For KVM_EXIT_INTERNAL_ERROR */ | 165 | /* For KVM_EXIT_INTERNAL_ERROR */ |
| 165 | #define KVM_INTERNAL_ERROR_EMULATION 1 | 166 | #define KVM_INTERNAL_ERROR_EMULATION 1 |
| @@ -259,6 +260,10 @@ struct kvm_run { | |||
| 259 | __u32 ndata; | 260 | __u32 ndata; |
| 260 | __u64 data[16]; | 261 | __u64 data[16]; |
| 261 | } internal; | 262 | } internal; |
| 263 | /* KVM_EXIT_OSI */ | ||
| 264 | struct { | ||
| 265 | __u64 gprs[32]; | ||
| 266 | } osi; | ||
| 262 | /* Fix the size of the union. */ | 267 | /* Fix the size of the union. */ |
| 263 | char padding[256]; | 268 | char padding[256]; |
| 264 | }; | 269 | }; |
| @@ -400,6 +405,15 @@ struct kvm_ioeventfd { | |||
| 400 | __u8 pad[36]; | 405 | __u8 pad[36]; |
| 401 | }; | 406 | }; |
| 402 | 407 | ||
| 408 | /* for KVM_ENABLE_CAP */ | ||
| 409 | struct kvm_enable_cap { | ||
| 410 | /* in */ | ||
| 411 | __u32 cap; | ||
| 412 | __u32 flags; | ||
| 413 | __u64 args[4]; | ||
| 414 | __u8 pad[64]; | ||
| 415 | }; | ||
| 416 | |||
| 403 | #define KVMIO 0xAE | 417 | #define KVMIO 0xAE |
| 404 | 418 | ||
| 405 | /* | 419 | /* |
| @@ -501,7 +515,15 @@ struct kvm_ioeventfd { | |||
| 501 | #define KVM_CAP_HYPERV_VAPIC 45 | 515 | #define KVM_CAP_HYPERV_VAPIC 45 |
| 502 | #define KVM_CAP_HYPERV_SPIN 46 | 516 | #define KVM_CAP_HYPERV_SPIN 46 |
| 503 | #define KVM_CAP_PCI_SEGMENT 47 | 517 | #define KVM_CAP_PCI_SEGMENT 47 |
| 518 | #define KVM_CAP_PPC_PAIRED_SINGLES 48 | ||
| 519 | #define KVM_CAP_INTR_SHADOW 49 | ||
| 520 | #ifdef __KVM_HAVE_DEBUGREGS | ||
| 521 | #define KVM_CAP_DEBUGREGS 50 | ||
| 522 | #endif | ||
| 504 | #define KVM_CAP_X86_ROBUST_SINGLESTEP 51 | 523 | #define KVM_CAP_X86_ROBUST_SINGLESTEP 51 |
| 524 | #define KVM_CAP_PPC_OSI 52 | ||
| 525 | #define KVM_CAP_PPC_UNSET_IRQ 53 | ||
| 526 | #define KVM_CAP_ENABLE_CAP 54 | ||
| 505 | 527 | ||
| 506 | #ifdef KVM_CAP_IRQ_ROUTING | 528 | #ifdef KVM_CAP_IRQ_ROUTING |
| 507 | 529 | ||
| @@ -688,6 +710,10 @@ struct kvm_clock_data { | |||
| 688 | /* Available with KVM_CAP_VCPU_EVENTS */ | 710 | /* Available with KVM_CAP_VCPU_EVENTS */ |
| 689 | #define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events) | 711 | #define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events) |
| 690 | #define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events) | 712 | #define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events) |
| 713 | /* Available with KVM_CAP_DEBUGREGS */ | ||
| 714 | #define KVM_GET_DEBUGREGS _IOR(KVMIO, 0xa1, struct kvm_debugregs) | ||
| 715 | #define KVM_SET_DEBUGREGS _IOW(KVMIO, 0xa2, struct kvm_debugregs) | ||
| 716 | #define KVM_ENABLE_CAP _IOW(KVMIO, 0xa3, struct kvm_enable_cap) | ||
| 691 | 717 | ||
| 692 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 718 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
| 693 | 719 | ||
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 169d07758ee5..7cb116afa1cd 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -105,6 +105,12 @@ struct kvm_vcpu { | |||
| 105 | struct kvm_vcpu_arch arch; | 105 | struct kvm_vcpu_arch arch; |
| 106 | }; | 106 | }; |
| 107 | 107 | ||
| 108 | /* | ||
| 109 | * Some of the bitops functions do not support too long bitmaps. | ||
| 110 | * This number must be determined not to exceed such limits. | ||
| 111 | */ | ||
| 112 | #define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1) | ||
| 113 | |||
| 108 | struct kvm_memory_slot { | 114 | struct kvm_memory_slot { |
| 109 | gfn_t base_gfn; | 115 | gfn_t base_gfn; |
| 110 | unsigned long npages; | 116 | unsigned long npages; |
| @@ -237,17 +243,23 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | |||
| 237 | void vcpu_load(struct kvm_vcpu *vcpu); | 243 | void vcpu_load(struct kvm_vcpu *vcpu); |
| 238 | void vcpu_put(struct kvm_vcpu *vcpu); | 244 | void vcpu_put(struct kvm_vcpu *vcpu); |
| 239 | 245 | ||
| 240 | int kvm_init(void *opaque, unsigned int vcpu_size, | 246 | int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align, |
| 241 | struct module *module); | 247 | struct module *module); |
| 242 | void kvm_exit(void); | 248 | void kvm_exit(void); |
| 243 | 249 | ||
| 244 | void kvm_get_kvm(struct kvm *kvm); | 250 | void kvm_get_kvm(struct kvm *kvm); |
| 245 | void kvm_put_kvm(struct kvm *kvm); | 251 | void kvm_put_kvm(struct kvm *kvm); |
| 246 | 252 | ||
| 253 | static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) | ||
| 254 | { | ||
| 255 | return rcu_dereference_check(kvm->memslots, | ||
| 256 | srcu_read_lock_held(&kvm->srcu) | ||
| 257 | || lockdep_is_held(&kvm->slots_lock)); | ||
| 258 | } | ||
| 259 | |||
| 247 | #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) | 260 | #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) |
| 248 | #define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) | 261 | #define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) |
| 249 | static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } | 262 | static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } |
| 250 | struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva); | ||
| 251 | 263 | ||
| 252 | extern struct page *bad_page; | 264 | extern struct page *bad_page; |
| 253 | extern pfn_t bad_pfn; | 265 | extern pfn_t bad_pfn; |
diff --git a/include/linux/tboot.h b/include/linux/tboot.h index bf2a0c748878..1dba6ee55203 100644 --- a/include/linux/tboot.h +++ b/include/linux/tboot.h | |||
| @@ -150,6 +150,7 @@ extern int tboot_force_iommu(void); | |||
| 150 | 150 | ||
| 151 | #else | 151 | #else |
| 152 | 152 | ||
| 153 | #define tboot_enabled() 0 | ||
| 153 | #define tboot_probe() do { } while (0) | 154 | #define tboot_probe() do { } while (0) |
| 154 | #define tboot_shutdown(shutdown_type) do { } while (0) | 155 | #define tboot_shutdown(shutdown_type) do { } while (0) |
| 155 | #define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \ | 156 | #define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \ |
