All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
	Gleb Natapov <gleb@redhat.com>
Subject: Re: [PATCH v2] KVM: x86: Extend KVM_SET_VCPU_EVENTS with selective updates
Date: Tue, 15 Dec 2009 18:29:56 +0100	[thread overview]
Message-ID: <4B27C794.5020400@web.de> (raw)
In-Reply-To: <4B27C2E9.5090402@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]

Avi Kivity wrote:
> On 12/15/2009 06:43 PM, Jan Kiszka wrote:
>>
>>> I now agree.  But instead of SCOPE_RESET and SCOPE_RUNTIME (or whatever
>>> that was), how about SCOPE_GPR, SCOPE_FPU, SCOPE_SREGS etc.  That means
>>> the backing code in kvm.c doesn't have to know what qemu is interested
>>> in wrt SCOPE_RESET, and it's easier for readers to infer what is meant.
>>>      
>> That's not my idea. I want to be able to state the scope in generic,
>> arch-independent, KVM-unaware code. What the scope actually means /wrt
>> writeback should only be defined in the arch-specific kvm service
>> implementing it. Your suggestion would go in the wrong direction IMO.
>>    
> 
> What I'm worried is how to tell which registers go in which scope?  And
> contrariwise, when doing a cpu_synchronize_state(), how to select the
> scope?  It's easy when there's just normal and reset, but what happens
> when we gain another one?  The code may not know who calls it.
> 

In my original patch, scopes could only be widened: If we first sync'ed
for potential register modifications and then added a sync for reset,
the latter ruled on write-back. In my current idea, there would be three
sync scopes (in increasing order):

CPU_SYNC_RUNTIME  - only write states that cannot not change
                    asynchronously
CPU_SYNC_RESET    - write everything that would change during a CPU
                    reset (excludes TSC MSR on x86)
CPU_SYNC_COMPLETE - write everything

I think these scopes are generic enough to match problems of other archs
beyond x86 as well (though I don't if any exist).

Hope I'll find some time soon to code this down, but I'm currently
stuffed with unrelated issues.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  reply	other threads:[~2009-12-15 17:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-06 16:55 [PATCH] KVM: x86: Extend KVM_SET_VCPU_EVENTS with selective updates Jan Kiszka
2009-12-06 17:05 ` Avi Kivity
2009-12-06 17:12   ` Jan Kiszka
2009-12-15 14:54     ` Avi Kivity
2009-12-15 16:41       ` Jan Kiszka
2009-12-15 17:08         ` Avi Kivity
2009-12-15 22:57           ` [PATCH] KVM: x86: Adjust KVM_VCPUEVENT flag names Jan Kiszka
2009-12-16  9:59             ` Avi Kivity
2009-12-06 17:24   ` [PATCH v2] KVM: x86: Extend KVM_SET_VCPU_EVENTS with selective updates Jan Kiszka
2009-12-08 14:02     ` Marcelo Tosatti
2009-12-08 14:07       ` Avi Kivity
2009-12-08 20:52         ` Marcelo Tosatti
2009-12-08 21:17           ` Jan Kiszka
2009-12-15 14:50             ` Avi Kivity
2009-12-15 16:43               ` Jan Kiszka
2009-12-15 17:10                 ` Avi Kivity
2009-12-15 17:29                   ` Jan Kiszka [this message]
2009-12-14 10:32 ` [PATCH] " Jan Kiszka
2009-12-14 10:34   ` Avi Kivity

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=4B27C794.5020400@web.de \
    --to=jan.kiszka@web.de \
    --cc=avi@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.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.