From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 2/2] qemu-kvm: x86: Add support for VCPU event states Date: Sun, 15 Nov 2009 15:31:41 +0100 Message-ID: <4B0010CD.7000406@web.de> References: <4AFB5123.7000301@web.de> <4AFB515D.1030202@web.de> <4B00087C.4060007@redhat.com> <4B000E71.3020901@web.de> <4B000FBB.3000600@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB68545573DBFC2B7B0FCCEEA" Cc: Marcelo Tosatti , kvm , Juan Quintela To: Avi Kivity Return-path: Received: from fmmailgate01.web.de ([217.72.192.221]:58790 "EHLO fmmailgate01.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753145AbZKOOc0 (ORCPT ); Sun, 15 Nov 2009 09:32:26 -0500 In-Reply-To: <4B000FBB.3000600@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB68545573DBFC2B7B0FCCEEA Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Avi Kivity wrote: > On 11/15/2009 04:21 PM, Jan Kiszka wrote: >> Avi Kivity wrote: >> =20 >>> On 11/12/2009 02:05 AM, Jan Kiszka wrote: >>> =20 >>>> This patch extends the qemu-kvm state sync logic with support for >>>> KVM_GET/SET_VCPU_EVENTS, giving access to yet missing exception, >>>> interrupt and NMI states. >>>> >>>> diff --git a/target-i386/machine.c b/target-i386/machine.c >>>> index 6bd447f..1eda7c5 100644 >>>> --- a/target-i386/machine.c >>>> +++ b/target-i386/machine.c >>>> @@ -452,6 +452,11 @@ static const VMStateDescription vmstate_cpu =3D= { >>>> VMSTATE_INT32_V(interrupt_injected, CPUState, 9), >>>> VMSTATE_UINT32_V(mp_state, CPUState, 9), >>>> VMSTATE_UINT64_V(tsc, CPUState, 9), >>>> + VMSTATE_UINT8_V(soft_interrupt, CPUState, 11), >>>> + VMSTATE_UINT8_V(nmi_injected, CPUState, 11), >>>> + VMSTATE_UINT8_V(nmi_pending, CPUState, 11), >>>> + VMSTATE_UINT8_V(has_error_code, CPUState, 11), >>>> + VMSTATE_UINT32_V(sipi_vector, CPUState, 11), >>>> /* MCE */ >>>> VMSTATE_UINT64_V(mcg_cap, CPUState, 10), >>>> VMSTATE_UINT64_V(mcg_status, CPUState, 10), >>>> >>>> >>>> =20 >>> Is there a reason why you add 11 between 9 and 10? We'll probably se= e >>> another 11 when someone else adds the next state. >>> >>> =20 >> Logical grouping ("/* KVM-related states */"). >=20 > These aren't kvm-related, just not implemented in tcg yet. Nothing > kvmish about them - it's all architectural state. Most of them are KVM-specific. TCG don't have to deal with event re-injection due to host page faults etc. on first try. >=20 >> If anyone once tries to >> add non-KVM stuff here just because it's version 12, it should be >> rejected. I don't think you have to sort VMSTATE entries by their >> version number. Am I right, Juan? >> =20 >=20 > I'm worried about something else - someone looking at the end, seeing > version 10, and appending new state with version 11. Again, that's something proper review should catch (just like checking for the right place when adding a new IOCTL to kvm.h). Jan --------------enigB68545573DBFC2B7B0FCCEEA 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 iEYEARECAAYFAksAEM0ACgkQitSsb3rl5xSJZQCfVFEGgdWIxSBhRrITrBSkOThH WRYAnRgTnwZVz4Ki/hIkTYjnUG+oZk+C =dHGZ -----END PGP SIGNATURE----- --------------enigB68545573DBFC2B7B0FCCEEA--