From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2FDA3C433E0 for ; Fri, 31 Jul 2020 11:00:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04D2C20838 for ; Fri, 31 Jul 2020 11:00:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04D2C20838 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k1Slt-0003e1-2h for qemu-devel@archiver.kernel.org; Fri, 31 Jul 2020 07:00:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1SlH-0003AJ-7u for qemu-devel@nongnu.org; Fri, 31 Jul 2020 06:59:39 -0400 Received: from mx2.suse.de ([195.135.220.15]:49910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1SlF-0005wD-DJ for qemu-devel@nongnu.org; Fri, 31 Jul 2020 06:59:38 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 13059AD0B; Fri, 31 Jul 2020 10:59:49 +0000 (UTC) Subject: Re: [PATCH 3/3] cpu-timers, icount: new modules To: Paolo Bonzini , Thomas Huth , Laurent Vivier , =?UTF-8?Q?Alex_Benn=c3=a9e?= , Peter Maydell , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Roman Bolshakov , Markus Armbruster References: <20200629093504.3228-1-cfontana@suse.de> <20200629093504.3228-4-cfontana@suse.de> <996dc455-548e-5964-9c87-f4abe5b63907@redhat.com> <146b0cf2-509b-6a48-e82b-b93740e4c60d@redhat.com> <76aac4ac-40f5-4870-ed2b-bab8b68b0a64@redhat.com> <9630c685-0a37-a1e7-4614-9d692988a799@suse.de> <22228280-f3b4-3f64-d2ba-30cfc47c8b0d@redhat.com> <994492fd-5ae2-52e2-0864-7216ec9dae34@suse.de> <5a41a63f-8397-64d3-0839-6990e2965339@suse.de> <8aaa983a-c720-88f2-5ad4-b88078ef705e@redhat.com> From: Claudio Fontana Message-ID: <8ea42cd4-02ef-8c5b-7286-bc9db37deba9@suse.de> Date: Fri, 31 Jul 2020 12:59:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <8aaa983a-c720-88f2-5ad4-b88078ef705e@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=195.135.220.15; envelope-from=cfontana@suse.de; helo=mx2.suse.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/30 02:10:23 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Marcelo Tosatti , qemu-devel@nongnu.org, haxm-team@intel.com, Wenchao Wang , Sunil Muthuswamy , Richard Henderson , Colin Xu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 7/31/20 12:09 AM, Paolo Bonzini wrote: > On 30/07/20 18:33, Claudio Fontana wrote: >> One problem I noticed is that qemu_clock_get_ns is util/qemu-timer.c, >> which is tools _and_ softmmu, while I tried to extract the >> softmmu-only timer code in softmmu/cpu-timers.c, > > Not all of it, only the VIRTUAL clock which is > > if (use_icount) { > return cpu_get_icount(); > } else { > return cpu_get_clock(); > } > > and would be changed to something like > > return cpu_get_virtual_clock(); > > In turn cpu_get_virtual_clock() is > > return (accel_ops->cpu_get_virtual clock ?: cpu_get_clock)(); > > in the emulators, plus a stub that replaces stubs/cpu-get-icount.c and > is just > > return get_clock_realtime(); > > as in stubs/cpu-get-clock.c. > > Paolo > > works, hooking up cpu_get_ticks() also works. qemu_start_warp_timer seems to make sense only for tcg/icount and not for qtest, which directly sets and warps the clock, is that right? Would you want a start_warp_timer cpu accel interface that is actually useful only for tcg, to avoid if (icount_enabled()) { qemu_start_warp_timer()? } Thanks, Claudio