From patchwork Sat Apr 16 22:10:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 91505 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 24011B7014 for ; Sun, 17 Apr 2011 08:12:20 +1000 (EST) Received: from localhost ([::1]:59049 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBDiz-0002nB-Bb for incoming@patchwork.ozlabs.org; Sat, 16 Apr 2011 18:12:17 -0400 Received: from eggs.gnu.org ([140.186.70.92]:45402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBDiY-0002fw-HP for qemu-devel@nongnu.org; Sat, 16 Apr 2011 18:11:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QBDiW-0002Ch-Sl for qemu-devel@nongnu.org; Sat, 16 Apr 2011 18:11:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QBDiW-0002Bx-Jc for qemu-devel@nongnu.org; Sat, 16 Apr 2011 18:11:48 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p3GMBjVd014959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 16 Apr 2011 18:11:46 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p3GMBjhX015420; Sat, 16 Apr 2011 18:11:45 -0400 Received: from amt.cnet (vpn-9-82.rdu.redhat.com [10.11.9.82]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p3GMBhQp018386; Sat, 16 Apr 2011 18:11:44 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 200FB6521E1; Sat, 16 Apr 2011 19:10:22 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p3GMAKGm003961; Sat, 16 Apr 2011 19:10:20 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Sat, 16 Apr 2011 19:10:04 -0300 Message-Id: <8f53372986d7726c02fe0147e45be504a5208edc.1302991808.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Glauber Costa , qemu-devel@nongnu.org, kvm@vger.kernel.org, Avi Kivity Subject: [Qemu-devel] [PATCH 2/6] kvm: add kvmclock to its second bit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Glauber Costa 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 Signed-off-by: Avi Kivity --- 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 814d13e..5e48d35 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); }