Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297062
b: refs/heads/master
c: b9e5dc8
h: refs/heads/master
v: v3
  • Loading branch information
Christian Borntraeger authored and Avi Kivity committed Mar 5, 2012
1 parent 60d3d87 commit e2e6bc8
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8d26cf7b40b1648c39e77a113dac07ad31363120
refs/heads/master: b9e5dc8d4511e6a00862a795319569e7fe7f60f4
23 changes: 23 additions & 0 deletions trunk/Documentation/virtual/kvm/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,29 @@ developer registration required to access it).
/* Fix the size of the union. */
char padding[256];
};

/*
* shared registers between kvm and userspace.
* kvm_valid_regs specifies the register classes set by the host
* kvm_dirty_regs specified the register classes dirtied by userspace
* struct kvm_sync_regs is architecture specific, as well as the
* bits for kvm_valid_regs and kvm_dirty_regs
*/
__u64 kvm_valid_regs;
__u64 kvm_dirty_regs;
union {
struct kvm_sync_regs regs;
char padding[1024];
} s;

If KVM_CAP_SYNC_REGS is defined, these fields allow userspace to access
certain guest registers without having to call SET/GET_*REGS. Thus we can
avoid some system call overhead if userspace has to handle the exit.
Userspace can query the validity of the structure by checking
kvm_valid_regs for specific bits. These bits are architecture specific
and usually define the validity of a groups of registers. (e.g. one bit
for general purpose registers)

};

6. Capabilities that can be enabled
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/ia64/include/asm/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,8 @@ struct kvm_debug_exit_arch {
struct kvm_guest_debug_arch {
};

/* definition of registers in kvm_run */
struct kvm_sync_regs {
};

#endif
4 changes: 4 additions & 0 deletions trunk/arch/powerpc/include/asm/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ struct kvm_debug_exit_arch {
struct kvm_guest_debug_arch {
};

/* definition of registers in kvm_run */
struct kvm_sync_regs {
};

#define KVM_REG_MASK 0x001f
#define KVM_REG_EXT_MASK 0xffe0
#define KVM_REG_GPR 0x0000
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/s390/include/asm/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ struct kvm_debug_exit_arch {
struct kvm_guest_debug_arch {
};

/* definition of registers in kvm_run */
struct kvm_sync_regs {
};
#endif
4 changes: 4 additions & 0 deletions trunk/arch/x86/include/asm/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,8 @@ struct kvm_xcrs {
__u64 padding[16];
};

/* definition of registers in kvm_run */
struct kvm_sync_regs {
};

#endif /* _ASM_X86_KVM_H */
15 changes: 15 additions & 0 deletions trunk/include/linux/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,20 @@ struct kvm_run {
/* Fix the size of the union. */
char padding[256];
};

/*
* shared registers between kvm and userspace.
* kvm_valid_regs specifies the register classes set by the host
* kvm_dirty_regs specified the register classes dirtied by userspace
* struct kvm_sync_regs is architecture specific, as well as the
* bits for kvm_valid_regs and kvm_dirty_regs
*/
__u64 kvm_valid_regs;
__u64 kvm_dirty_regs;
union {
struct kvm_sync_regs regs;
char padding[1024];
} s;
};

/* for KVM_REGISTER_COALESCED_MMIO / KVM_UNREGISTER_COALESCED_MMIO */
Expand Down Expand Up @@ -570,6 +584,7 @@ struct kvm_ppc_pvinfo {
#define KVM_CAP_S390_GMAP 71
#define KVM_CAP_TSC_DEADLINE_TIMER 72
#define KVM_CAP_S390_UCONTROL 73
#define KVM_CAP_SYNC_REGS 74

#ifdef KVM_CAP_IRQ_ROUTING

Expand Down

0 comments on commit e2e6bc8

Please sign in to comment.