qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Bhushan Bharat-R65777 <R65777@freescale.com>
Cc: "agraf@suse.de" <agraf@suse.de>,
	"aliguori@us.ibm.com" <aliguori@us.ibm.com>,
	"jan.kiszka@siemens.com" <jan.kiszka@siemens.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Jason J. Herne" <jjherne@us.ibm.com>,
	"borntraeger@de.ibm.com" <borntraeger@de.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 4/7 v2] KVM regsync: Add register bitmap parameter to do_kvm_cpu_synchronize_state
Date: Wed, 16 Jan 2013 18:09:15 -0200	[thread overview]
Message-ID: <20130116200914.GA1413@amt.cnet> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D06564C9A@039-SN2MPN1-023.039d.mgd.msft.net>

On Wed, Jan 16, 2013 at 05:00:52PM +0000, Bhushan Bharat-R65777 wrote:
> Second-)
> Currently kvm_arch_get_registers() is not optimized in two sense; one, it always get all registers from KVM; two, in kvm_arch_get_registers() it copies all registers to env->. This patch-set handles the second issue of optimization, copy only the requested registers to env-> in kvm_arch_get_registers(), plus when kvm_arch_put_registers() is called then it copies only the modified registers for KVM_SET_SREGS.
> 
> This optimization is looking good to me and allows sync of registers via one common kvm_arch_get/set_registers() and no separate function definition for setting is needed for timer related changes.

To be clearer. For example, executing:

- kvm_get_regs(FULL_STATE)
- kvm_put_regs(FULL_STATE)

Is reading and writing the full register set while
in runtime state.

/* full state set, modified during initialization or on vmload */
#define KVM_PUT_FULL_STATE      3

Again, its necessary to read the full state on "cpu_synchronize_state" 
because its not specified which registers can be modified
during ioctl(KVM_RUN) (therefore separating get registers operation
in full/reset/runtime sets is awkward).

But direct read/write of registers is also bad: if a given register is
read and modified (but not written back), then reading through ioctl()
returns a wrong value.

Apparently accessors are the best option. 

  parent reply	other threads:[~2013-01-16 20:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 15:29 [Qemu-devel] [PATCH 4/7 v2] KVM regsync: Add register bitmap parameter to do_kvm_cpu_synchronize_state Jason J. Herne
2013-01-12 11:08 ` Blue Swirl
2013-01-14 11:32 ` Bhushan Bharat-R65777
2013-01-16 16:05 ` Marcelo Tosatti
2013-01-16 16:12   ` Marcelo Tosatti
2013-01-16 17:00   ` Bhushan Bharat-R65777
2013-01-16 17:23     ` Marcelo Tosatti
2013-01-16 20:09     ` Marcelo Tosatti [this message]
2013-01-16 20:03   ` Christian Borntraeger
2013-01-16 20:21     ` Marcelo Tosatti
2013-01-16 20:41       ` Christian Borntraeger
2013-01-16 23:01         ` Marcelo Tosatti
     [not found]           ` <9F9185C2-DDA5-4242-9BF2-664F4E0329F9@suse.de>
2013-02-01 15:47             ` Jason J. Herne

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=20130116200914.GA1413@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=R65777@freescale.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jjherne@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).