All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	Marcelo Tossati <mtosatti@redhat.com>,
	Carsten Otte <cotte@de.ibm.com>,
	Jens Freimann <jfrei@linux.vnet.ibm.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	KVM <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/4] kvm: provide synchronous registers in kvm_run
Date: Mon, 09 Jan 2012 15:06:54 +0200	[thread overview]
Message-ID: <4F0AE66E.6020300@redhat.com> (raw)
In-Reply-To: <6224ACE2-3AE2-4441-BAE5-9A3E4A749574@suse.de>

On 01/09/2012 03:01 PM, Alexander Graf wrote:
> On 05.01.2012, at 10:54, Christian Borntraeger wrote:
>
> > 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 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.
> > We also provide two 64bit flags fields (architecture specific), that will
> > specify which parts of these fields are valid. Each bit will define that
> > a group of registers (like general purpose) or a single register is valid.
> > In that way we can extend and shrink the interface. (The structure definition
> > itself can only grow of course).
> > 
> > Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> > ---
> > Documentation/virtual/kvm/api.txt |   28 ++++++++++++++++++++++++++++
> > 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               |   20 ++++++++++++++++++++
> > 6 files changed, 75 insertions(+), 0 deletions(-)
> > 
> > diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt
> > index da1f8fd..a149e22 100644
> > --- a/Documentation/virtual/kvm/api.txt
> > +++ b/Documentation/virtual/kvm/api.txt
> > @@ -1693,6 +1693,34 @@ developer registration required to access it).
> > 		/* 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. Each
> > +         * register can be extended or reduced by having flag bits specifying
> > +         * if a group of registers is valid.
> > +         */
> > +	__u64 kvm_valid_sync_ro_regs;
> > +	__u64 kvm_valid_sync_rw_regs;
> > +	union {
> > +		/* registers which can be only read */
> > +		struct kvm_sync_ro_regs sync_ro;
> > +		char padding[1024];
> > +	};
> > +	union {
> > +		/* read/write guest registers */
> > +		struct kvm_sync_rw_regs sync_rw;
> > +		char padding[1024];
> > +	};
>
> Ah, new patch set. Same comment here. Please give the union a name. Also, I still don't understand why we need 2 structs. 

Right.

> All we need is a bitmap that says "this field is dirty" and then kernel space can decide to ignore it.

Makes sense.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2012-01-09 13:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05  9:54 synchronous register in kvm_run Christian Borntraeger
2012-01-05  9:54 ` [PATCH 1/4] kvm: provide synchronous registers " Christian Borntraeger
2012-01-09 13:01   ` Alexander Graf
2012-01-09 13:06     ` Avi Kivity [this message]
2012-01-05  9:54 ` [PATCH 2/4] kvm-s390: provide the prefix register via kvm_run Christian Borntraeger
2012-01-09 13:06   ` Alexander Graf
2012-01-05  9:54 ` [PATCH 3/4] kvm-s390: provide general purpose guest registers " Christian Borntraeger
2012-01-09 13:10   ` Alexander Graf
2012-01-05  9:54 ` [PATCH 4/4] kvm-s390: provide access " Christian Borntraeger
2012-01-09 12:37 ` synchronous register in kvm_run Christian Borntraeger
2012-01-09 12:49   ` Marcelo Tosatti
2012-01-09 12:58     ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2012-01-11 10:20 kvm: provide synchronous registers " Christian Borntraeger
2012-01-11 10:20 ` [PATCH 1/4] " Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F0AE66E.6020300@redhat.com \
    --to=avi@redhat.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=cotte@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.