From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v2] KVM: x86: Extend KVM_SET_VCPU_EVENTS with selective updates Date: Tue, 15 Dec 2009 18:29:56 +0100 Message-ID: <4B27C794.5020400@web.de> References: <4B1BE216.2090407@web.de> <4B1BE452.6090107@redhat.com> <4B1BE8BF.7030404@web.de> <20091208140249.GA19154@amt.cnet> <4B1E5DA4.3010605@redhat.com> <20091208205240.GA24565@amt.cnet> <4B1EC252.9040009@web.de> <4B27A223.1050706@redhat.com> <4B27BCAF.70804@web.de> <4B27C2E9.5090402@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig91F84B91DA4E2B7533BF638F" Cc: Marcelo Tosatti , kvm , Gleb Natapov To: Avi Kivity Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:58393 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754605AbZLORaM (ORCPT ); Tue, 15 Dec 2009 12:30:12 -0500 In-Reply-To: <4B27C2E9.5090402@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig91F84B91DA4E2B7533BF638F Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 whatev= er >>> that was), how about SCOPE_GPR, SCOPE_FPU, SCOPE_SREGS etc. That mea= ns >>> the backing code in kvm.c doesn't have to know what qemu is intereste= d >>> in wrt SCOPE_RESET, and it's easier for readers to infer what is mean= t. >>> =20 >> 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. >> =20 >=20 > 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. >=20 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 --------------enig91F84B91DA4E2B7533BF638F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAksnx50ACgkQitSsb3rl5xSVJQCeOyvg7Lw67ZpncSgd91/IXVs+ jUsAn1DZgcpskWuFuOsztcvnJJHQ1894 =QrR/ -----END PGP SIGNATURE----- --------------enig91F84B91DA4E2B7533BF638F--