aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kvm.h26
-rw-r--r--include/linux/kvm_host.h16
-rw-r--r--include/linux/tboot.h1
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 */
409struct 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
108struct kvm_memory_slot { 114struct 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);
237void vcpu_load(struct kvm_vcpu *vcpu); 243void vcpu_load(struct kvm_vcpu *vcpu);
238void vcpu_put(struct kvm_vcpu *vcpu); 244void vcpu_put(struct kvm_vcpu *vcpu);
239 245
240int kvm_init(void *opaque, unsigned int vcpu_size, 246int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
241 struct module *module); 247 struct module *module);
242void kvm_exit(void); 248void kvm_exit(void);
243 249
244void kvm_get_kvm(struct kvm *kvm); 250void kvm_get_kvm(struct kvm *kvm);
245void kvm_put_kvm(struct kvm *kvm); 251void kvm_put_kvm(struct kvm *kvm);
246 252
253static 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)
249static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } 262static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; }
250struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva);
251 263
252extern struct page *bad_page; 264extern struct page *bad_page;
253extern pfn_t bad_pfn; 265extern 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) \