From patchwork Mon Jun 30 13:59:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Tanase X-Patchwork-Id: 365633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 749651400EE for ; Tue, 1 Jul 2014 00:00:26 +1000 (EST) Received: from localhost ([::1]:34542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1c88-0000s0-OX for incoming@patchwork.ozlabs.org; Mon, 30 Jun 2014 10:00:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1c7O-0007pE-BV for qemu-devel@nongnu.org; Mon, 30 Jun 2014 09:59:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1c7E-0006Pj-Ah for qemu-devel@nongnu.org; Mon, 30 Jun 2014 09:59:38 -0400 Received: from zimbra3.corp.accelance.fr ([2001:4080:204::2:8]:46880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1c7E-0006Pa-3U for qemu-devel@nongnu.org; Mon, 30 Jun 2014 09:59:28 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra3.corp.accelance.fr (Postfix) with ESMTP id 6257F72C53; Mon, 30 Jun 2014 15:59:27 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra3.corp.accelance.fr Received: from zimbra3.corp.accelance.fr ([127.0.0.1]) by localhost (zimbra3.corp.accelance.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id taLhXpfw1kL6; Mon, 30 Jun 2014 15:59:23 +0200 (CEST) Received: from debian-seb.daviel.openwide.fr. (unknown [193.56.60.160]) by zimbra3.corp.accelance.fr (Postfix) with ESMTPSA id 923BB72C5A; Mon, 30 Jun 2014 15:59:18 +0200 (CEST) From: Sebastian Tanase To: qemu-devel@nongnu.org Date: Mon, 30 Jun 2014 15:59:06 +0200 Message-Id: <1404136749-523-4-git-send-email-sebastian.tanase@openwide.fr> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: <1404136749-523-1-git-send-email-sebastian.tanase@openwide.fr> References: <1404136749-523-1-git-send-email-sebastian.tanase@openwide.fr> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4080:204::2:8 Cc: kwolf@redhat.com, peter.maydell@linaro.org, alex@alex.org.uk, wenchaoqemu@gmail.com, quintela@redhat.com, mjt@tls.msk.ru, mst@redhat.com, stefanha@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, michael@walle.cc, aliguori@amazon.com, crobinso@redhat.com, pbonzini@redhat.com, Sebastian Tanase , afaerber@suse.de, rth@twiddle.net Subject: [Qemu-devel] [RFC PATCH V3 3/6] icount: Make icount_time_shift available everywhere 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 icount_time_shift is used for calculting the delay qemu has to sleep in order to synchronise the host and guest clocks. Therefore, we need it in cpu-exec.c. Signed-off-by: Sebastian Tanase Tested-by: Camille Bégué --- cpus.c | 8 ++++++-- include/qemu-common.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cpus.c b/cpus.c index 3fa8ce7..312c2ee 100644 --- a/cpus.c +++ b/cpus.c @@ -105,8 +105,12 @@ static bool all_cpu_threads_idle(void) /* Compensate for varying guest execution speed. */ static int64_t qemu_icount_bias; static int64_t vm_clock_warp_start; -/* Conversion factor from emulated instructions to virtual clock ticks. */ -static int icount_time_shift; +/* Conversion factor from emulated instructions to virtual clock ticks. + * icount_time_shift is defined as extern in include/qemu-common.h because + * it is used (in cpu-exec.c) for calculating the delay for sleeping + * qemu in order to align the host and virtual clocks. + */ +int icount_time_shift; /* Arbitrarily pick 1MIPS as the minimum allowable speed. */ #define MAX_ICOUNT_SHIFT 10 diff --git a/include/qemu-common.h b/include/qemu-common.h index 860bb15..f568635 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -108,6 +108,7 @@ static inline char *realpath(const char *path, char *resolved_path) /* icount */ void configure_icount(QemuOpts *opts, Error **errp); extern int use_icount; +extern int icount_time_shift; extern int icount_align_option; #include "qemu/osdep.h"