public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Hollis Blanchard <hollis-yUx37fBWTUITNcAmw9vGhQ@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: kvm_regs vs kvm_sregs?
Date: Sun, 18 Mar 2007 07:13:17 +0200	[thread overview]
Message-ID: <45FCCA6D.3070207@qumranet.com> (raw)
In-Reply-To: <1174057254.22955.13.camel@basalt>

Hollis Blanchard wrote:
> What is the distinction between kvm_regs and kvm_sregs? As far as I can
> see, kvm_regs is only used when emulating IO, emulating MMIO, and
> emulating CPUID, where guest GPRs are directly modified. kvm_sregs is
> only used for full CPU state save (for later restore).
>   

After the userspace interface changes, neither of them are used except 
for migration, savevm/loadvm, and debugging. Theoretically they could be 
unified, practically SET_SREGS is a dangerous operation on Intel cpus 
due to kvm's very imperfect real mode support.

> When the kernel had to use copy_to_user() to transfer state to userland,
> I can see that this split resulted in less memory copying. However, now
> that userland can directly map register state without a copy, why not
> combine the two structures?
>   

We don't map the register state as that would require us to sync it on 
every exit.

> I guess it takes longer to copy state out of the VMCS into kvm_sregs, so
> why bother if userspace isn't going to use it?
>   

When it's needed, it's really needed.  Or did I misunderstand the question?

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

  reply	other threads:[~2007-03-18  5:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16 15:00 kvm_regs vs kvm_sregs? Hollis Blanchard
2007-03-18  5:13 ` Avi Kivity [this message]
     [not found]   ` <45FCCA6D.3070207-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-03-23  1:17     ` Hollis Blanchard

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=45FCCA6D.3070207@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=hollis-yUx37fBWTUITNcAmw9vGhQ@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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