From patchwork Thu Mar 17 22:42:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 87442 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 CDE8CB6FDA for ; Fri, 18 Mar 2011 09:43:21 +1100 (EST) Received: from localhost ([127.0.0.1]:48394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0LuZ-0001xz-0I for incoming@patchwork.ozlabs.org; Thu, 17 Mar 2011 18:43:19 -0400 Received: from [140.186.70.92] (port=54313 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0Lta-0001w8-JV for qemu-devel@nongnu.org; Thu, 17 Mar 2011 18:42:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0LtZ-0002jW-Fk for qemu-devel@nongnu.org; Thu, 17 Mar 2011 18:42:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0LtZ-0002jM-48 for qemu-devel@nongnu.org; Thu, 17 Mar 2011 18:42:17 -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 p2HMgGWI008621 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 17 Mar 2011 18:42:16 -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 p2HMg8Mw016845; Thu, 17 Mar 2011 18:42:15 -0400 From: Glauber Costa To: kvm@vger.kernel.org Date: Thu, 17 Mar 2011 19:42:07 -0300 Message-Id: <1300401727-5235-4-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 3/3] don't create kvmclock when one of the flags are present. 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 kvmclock presence can be signalled by two different flags. So for device creation, we have to test for both. Signed-off-by: Glauber Costa --- hw/kvmclock.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/kvmclock.c b/hw/kvmclock.c index b6ceddf..004c4ad 100644 --- a/hw/kvmclock.c +++ b/hw/kvmclock.c @@ -103,7 +103,11 @@ static SysBusDeviceInfo kvmclock_info = { void kvmclock_create(void) { if (kvm_enabled() && - first_cpu->cpuid_kvm_features & (1ULL << KVM_FEATURE_CLOCKSOURCE)) { + first_cpu->cpuid_kvm_features & ((1ULL << KVM_FEATURE_CLOCKSOURCE) +#ifdef KVM_FEATURE_CLOCKSOURCE2 + || (1ULL << KVM_FEATURE_CLOCKSOURCE2) +#endif + )) { sysbus_create_simple("kvmclock", -1, NULL); } }