diff options
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a2d00b1bbf54..186ffab0b9f0 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -35,6 +35,20 @@ | |||
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * If we support unaligned MMIO, at most one fragment will be split into two: | ||
39 | */ | ||
40 | #ifdef KVM_UNALIGNED_MMIO | ||
41 | # define KVM_EXTRA_MMIO_FRAGMENTS 1 | ||
42 | #else | ||
43 | # define KVM_EXTRA_MMIO_FRAGMENTS 0 | ||
44 | #endif | ||
45 | |||
46 | #define KVM_USER_MMIO_SIZE 8 | ||
47 | |||
48 | #define KVM_MAX_MMIO_FRAGMENTS \ | ||
49 | (KVM_MMIO_SIZE / KVM_USER_MMIO_SIZE + KVM_EXTRA_MMIO_FRAGMENTS) | ||
50 | |||
51 | /* | ||
38 | * vcpu->requests bit members | 52 | * vcpu->requests bit members |
39 | */ | 53 | */ |
40 | #define KVM_REQ_TLB_FLUSH 0 | 54 | #define KVM_REQ_TLB_FLUSH 0 |
@@ -117,6 +131,16 @@ enum { | |||
117 | EXITING_GUEST_MODE | 131 | EXITING_GUEST_MODE |
118 | }; | 132 | }; |
119 | 133 | ||
134 | /* | ||
135 | * Sometimes a large or cross-page mmio needs to be broken up into separate | ||
136 | * exits for userspace servicing. | ||
137 | */ | ||
138 | struct kvm_mmio_fragment { | ||
139 | gpa_t gpa; | ||
140 | void *data; | ||
141 | unsigned len; | ||
142 | }; | ||
143 | |||
120 | struct kvm_vcpu { | 144 | struct kvm_vcpu { |
121 | struct kvm *kvm; | 145 | struct kvm *kvm; |
122 | #ifdef CONFIG_PREEMPT_NOTIFIERS | 146 | #ifdef CONFIG_PREEMPT_NOTIFIERS |
@@ -144,10 +168,9 @@ struct kvm_vcpu { | |||
144 | int mmio_needed; | 168 | int mmio_needed; |
145 | int mmio_read_completed; | 169 | int mmio_read_completed; |
146 | int mmio_is_write; | 170 | int mmio_is_write; |
147 | int mmio_size; | 171 | int mmio_cur_fragment; |
148 | int mmio_index; | 172 | int mmio_nr_fragments; |
149 | unsigned char mmio_data[KVM_MMIO_SIZE]; | 173 | struct kvm_mmio_fragment mmio_fragments[KVM_MAX_MMIO_FRAGMENTS]; |
150 | gpa_t mmio_phys_addr; | ||
151 | #endif | 174 | #endif |
152 | 175 | ||
153 | #ifdef CONFIG_KVM_ASYNC_PF | 176 | #ifdef CONFIG_KVM_ASYNC_PF |