aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/virtual
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 /Documentation/virtual
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 'Documentation/virtual')
-rw-r--r--Documentation/virtual/kvm/api.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
index a67fb35993f..7ca696227d3 100644
--- a/Documentation/virtual/kvm/api.txt
+++ b/Documentation/virtual/kvm/api.txt
@@ -1771,6 +1771,29 @@ developer registration required to access it).
1771 /* Fix the size of the union. */ 1771 /* Fix the size of the union. */
1772 char padding[256]; 1772 char padding[256];
1773 }; 1773 };
1774
1775 /*
1776 * shared registers between kvm and userspace.
1777 * kvm_valid_regs specifies the register classes set by the host
1778 * kvm_dirty_regs specified the register classes dirtied by userspace
1779 * struct kvm_sync_regs is architecture specific, as well as the
1780 * bits for kvm_valid_regs and kvm_dirty_regs
1781 */
1782 __u64 kvm_valid_regs;
1783 __u64 kvm_dirty_regs;
1784 union {
1785 struct kvm_sync_regs regs;
1786 char padding[1024];
1787 } s;
1788
1789If KVM_CAP_SYNC_REGS is defined, these fields allow userspace to access
1790certain guest registers without having to call SET/GET_*REGS. Thus we can
1791avoid some system call overhead if userspace has to handle the exit.
1792Userspace can query the validity of the structure by checking
1793kvm_valid_regs for specific bits. These bits are architecture specific
1794and usually define the validity of a groups of registers. (e.g. one bit
1795 for general purpose registers)
1796
1774}; 1797};
1775 1798
17766. Capabilities that can be enabled 17996. Capabilities that can be enabled