From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBPkS-0006UV-6b for qemu-devel@nongnu.org; Sun, 17 Apr 2011 07:02:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QBPkN-0003Xi-5b for qemu-devel@nongnu.org; Sun, 17 Apr 2011 07:02:36 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:42701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBPkM-0003XU-RN for qemu-devel@nongnu.org; Sun, 17 Apr 2011 07:02:31 -0400 Message-ID: <4DAAC8B9.7020708@web.de> Date: Sun, 17 Apr 2011 13:02:17 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <8f53372986d7726c02fe0147e45be504a5208edc.1302991808.git.mtosatti@redhat.com> In-Reply-To: <8f53372986d7726c02fe0147e45be504a5208edc.1302991808.git.mtosatti@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig847D27251136DE0BAFC990EB" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] [PATCH 2/6] kvm: add kvmclock to its second bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: Avi Kivity , Anthony Liguori , Glauber Costa , kvm@vger.kernel.org, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig847D27251136DE0BAFC990EB Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2011-04-17 00:10, Marcelo Tosatti wrote: > From: Glauber Costa >=20 > We have two bits that can represent kvmclock in cpuid. > They signal the guest which msr set to use. When we tweak flags > involving this value - specially when we use "-", we have to act on bot= h. >=20 > Besides adding it to the kvm features list, we also have to "break" the= > assumption represented by the break in lookup_feature. >=20 > Signed-off-by: Glauber Costa > Signed-off-by: Avi Kivity > --- > target-i386/cpuid.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) >=20 > diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c > index 814d13e..5e48d35 100644 > --- a/target-i386/cpuid.c > +++ b/target-i386/cpuid.c > @@ -73,7 +73,7 @@ static const char *ext3_feature_name[] =3D { > }; > =20 > static const char *kvm_feature_name[] =3D { > - "kvmclock", "kvm_nopiodelay", "kvm_mmu", NULL, "kvm_asyncpf", NULL= , NULL, NULL, > + "kvmclock", "kvm_nopiodelay", "kvm_mmu", "kvmclock", "kvm_asyncpf"= , NULL, NULL, NULL, > NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, > NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, > NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, > @@ -193,7 +193,6 @@ static int lookup_feature(uint32_t *pval, const cha= r *s, const char *e, > for (mask =3D 1, ppc =3D featureset; mask; mask <<=3D 1, ++ppc) > if (*ppc && !altcmp(s, e, *ppc)) { > *pval |=3D mask; > - break; > } > return (mask ? 1 : 0); > } This is required on top to fix the issues Anthony was seeing: diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index 5e48d35..b7e20e8 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -189,12 +189,14 @@ static int lookup_feature(uint32_t *pval, const cha= r *s, const char *e, { uint32_t mask; const char **ppc; + int found =3D 0; =20 for (mask =3D 1, ppc =3D featureset; mask; mask <<=3D 1, ++ppc) if (*ppc && !altcmp(s, e, *ppc)) { *pval |=3D mask; + found =3D 1; } - return (mask ? 1 : 0); + return found; } =20 static void add_flagname_to_bitmaps(const char *flagname, uint32_t *feat= ures, --------------enig847D27251136DE0BAFC990EB 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.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk2qyL4ACgkQitSsb3rl5xQmoQCg4uKUzTYDUE4FhpaZn12rWnaR bJYAn3DL/qD9zb1Yne/GmAn1eYYJFiif =+y3J -----END PGP SIGNATURE----- --------------enig847D27251136DE0BAFC990EB--