aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kvm.h
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2012-01-11 05:20:30 -0500
committerAvi Kivity <avi@redhat.com>2012-03-05 07:52:22 -0500
commitb9e5dc8d4511e6a00862a795319569e7fe7f60f4 (patch)
tree1be01a8d13e2e5023c22db4a7dd87518f14af5b3 /include/linux/kvm.h
parent8d26cf7b40b1648c39e77a113dac07ad31363120 (diff)
KVM: provide synchronous registers in kvm_run
On some cpus the overhead for virtualization instructions is in the same range as a system call. Having to call multiple ioctls to get set registers will make certain userspace handled exits more expensive than necessary. Lets provide a section in kvm_run that works as a shared save area for guest registers. We also provide two 64bit flags fields (architecture specific), that will specify 1. which parts of these fields are valid. 2. which registers were modified by userspace Each bit for these flag fields will define a group of registers (like general purpose) or a single register. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm.h')
-rw-r--r--include/linux/kvm.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 6cf048d9604b..245bcb3a0fcd 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -279,6 +279,20 @@ struct kvm_run {
279 /* Fix the size of the union. */ 279 /* Fix the size of the union. */
280 char padding[256]; 280 char padding[256];
281 }; 281 };
282
283 /*
284 * shared registers between kvm and userspace.
285 * kvm_valid_regs specifies the register classes set by the host
286 * kvm_dirty_regs specified the register classes dirtied by userspace
287 * struct kvm_sync_regs is architecture specific, as well as the
288 * bits for kvm_valid_regs and kvm_dirty_regs
289 */
290 __u64 kvm_valid_regs;
291 __u64 kvm_dirty_regs;
292 union {
293 struct kvm_sync_regs regs;
294 char padding[1024];
295 } s;
282}; 296};
283 297
284/* for KVM_REGISTER_COALESCED_MMIO / KVM_UNREGISTER_COALESCED_MMIO */ 298/* for KVM_REGISTER_COALESCED_MMIO / KVM_UNREGISTER_COALESCED_MMIO */
@@ -570,6 +584,7 @@ struct kvm_ppc_pvinfo {
570#define KVM_CAP_S390_GMAP 71 584#define KVM_CAP_S390_GMAP 71
571#define KVM_CAP_TSC_DEADLINE_TIMER 72 585#define KVM_CAP_TSC_DEADLINE_TIMER 72
572#define KVM_CAP_S390_UCONTROL 73 586#define KVM_CAP_S390_UCONTROL 73
587#define KVM_CAP_SYNC_REGS 74
573 588
574#ifdef KVM_CAP_IRQ_ROUTING 589#ifdef KVM_CAP_IRQ_ROUTING
575 590