From patchwork Thu Mar 17 22:42:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 87443 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D0ABCB6FC4 for ; Fri, 18 Mar 2011 09:47:24 +1100 (EST) Received: from localhost ([127.0.0.1]:44200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0LyT-0004qQ-RQ for incoming@patchwork.ozlabs.org; Thu, 17 Mar 2011 18:47:21 -0400 Received: from [140.186.70.92] (port=54285 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0LtY-0001vu-Nm for qemu-devel@nongnu.org; Thu, 17 Mar 2011 18:42:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0LtX-0002ix-Mu for qemu-devel@nongnu.org; Thu, 17 Mar 2011 18:42:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0LtX-0002ik-DI for qemu-devel@nongnu.org; Thu, 17 Mar 2011 18:42:15 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2HMgE3X007750 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 17 Mar 2011 18:42:14 -0400 Received: from mothafucka.localdomain (ovpn-113-137.phx2.redhat.com [10.3.113.137]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2HMg8Mv016845; Thu, 17 Mar 2011 18:42:13 -0400 From: Glauber Costa To: kvm@vger.kernel.org Date: Thu, 17 Mar 2011 19:42:06 -0300 Message-Id: <1300401727-5235-3-git-send-email-glommer@redhat.com> In-Reply-To: <1300401727-5235-1-git-send-email-glommer@redhat.com> References: <1300401727-5235-1-git-send-email-glommer@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: mtosatti@redhat.com, qemu-devel@nongnu.org, avi@redhat.com Subject: [Qemu-devel] [PATCH 2/3] add kvmclock to its second bit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 both. Besides adding it to the kvm features list, we also have to "break" the assumption represented by the break in lookup_feature. Signed-off-by: Glauber Costa --- target-i386/cpuid.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c index d28de20..48f9bbd 100644 --- a/target-i386/cpuid.c +++ b/target-i386/cpuid.c @@ -73,7 +73,7 @@ static const char *ext3_feature_name[] = { }; static const char *kvm_feature_name[] = { - "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 char *s, const char *e, for (mask = 1, ppc = featureset; mask; mask <<= 1, ++ppc) if (*ppc && !altcmp(s, e, *ppc)) { *pval |= mask; - break; } return (mask ? 1 : 0); }