Re: [patch 1/3] kvm: provide synchronous registers in kvm_run

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22.12.2011, at 12:56, Christian Borntraeger wrote:

> From: Christian Borntraeger <borntraeger@xxxxxxxxxx>
> 
> 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 userspace handled exits more expensive than necessary.
> Lets provide two sections in kvm_run to have a shared save area for
> guest registers.
> 1. the first section is read-only, to handle registers that have side-effects
> 2. the second section is read/write, e.g. for general purpose registers.
> 
> 
> Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx>
> ---
> Documentation/virtual/kvm/api.txt |   16 ++++++++++++++++
> arch/ia64/include/asm/kvm.h       |    7 +++++++
> arch/powerpc/include/asm/kvm.h    |    7 +++++++
> arch/s390/include/asm/kvm.h       |    6 ++++++
> arch/x86/include/asm/kvm.h        |    7 +++++++
> include/linux/kvm.h               |   13 +++++++++++++
> 6 files changed, 56 insertions(+)
> 
> Index: b/Documentation/virtual/kvm/api.txt
> ===================================================================
> --- a/Documentation/virtual/kvm/api.txt
> +++ b/Documentation/virtual/kvm/api.txt
> @@ -1652,7 +1652,23 @@ developer registration required to acces
> 		/* Fix the size of the union. */
> 		char padding[256];
> 	};
> +	/* Here are two fields that allow to access often used registers
> +         * directly, to avoid the overhead of the ioctl system call */
> +	union {
> +		/* registers which can be only read */
> +		struct sync_ro_regs sync_ro_regs;
> +		char padding[1024];
> +	};
> +	union {
> +		/* read/write guest registers */
> +		struct sync_rw_regs sync_rw_regs;
> +		char padding[1024];
> +	};

Why have 2 different structs?

Unions shouldn't be anonymous. Please give the union a name :).


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux