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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 E1A2FC4320E for ; Wed, 1 Sep 2021 02:38:23 +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 87DFA60F12 for ; Wed, 1 Sep 2021 02:38:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 87DFA60F12 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:58140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLG8s-00086R-PZ for qemu-devel@archiver.kernel.org; Tue, 31 Aug 2021 22:38:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLFrq-0004Tp-UN; Tue, 31 Aug 2021 22:20:48 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:32899) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLFro-0005wp-Qw; Tue, 31 Aug 2021 22:20:46 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id BDBB05C01D5; Tue, 31 Aug 2021 22:20:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 31 Aug 2021 22:20:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=E5T45o +B1AL+H0Hw+sH0IyFCEoCYZLIkJJwqrEcYp+c=; b=e4Tp5FqLWEVU2YTIqR6k+S h0TrKuJ9x/0FXP00b1HN5aF5z9PKNcDgxE2YDi1xKlgAgZhoB4R5e35PBPZUTWKV HkYla4eKQa2u9gLCUnYL23bkKY/qTPWF+Qxz1Qr8f78BVJOEjaClzDKFJyNs9tQ6 63tt7cSn63oUHmSV5ZEa7Azbdbaj9+dOORpWeYu8FimQ8RiVSKnkKTsQvSr8x5v2 TFHBGLCTugjW2gQEMOrt0z6P7N6418r1RewOgjQp5OE4FW5ngVrZRSuFjDeBzAmp co+b8TgawSX7JASybzqe2jvUrBhfUw+ij/CdbuY7a1tC319XGHYvbvKhBrUFqU+w == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvvddgheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffujgfkfhggtgesthdtredttddtvdenucfhrhhomhephfhinhhnucfv hhgrihhnuceofhhthhgrihhnsehlihhnuhigqdhmieekkhdrohhrgheqnecuggftrfgrth htvghrnhepffduhfegfedvieetudfgleeugeehkeekfeevfffhieevteelvdfhtdevffet uedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepfh hthhgrihhnsehlihhnuhigqdhmieekkhdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 31 Aug 2021 22:20:37 -0400 (EDT) Date: Wed, 1 Sep 2021 12:20:32 +1000 (AEST) From: Finn Thain To: Mark Cave-Ayland Subject: Re: [RFC 00/10] hw/mos6522: VIA timer emulation fixes and improvements In-Reply-To: <4da39536-1acb-05c3-755c-9a30d82d6ace@ilande.co.uk> Message-ID: <6c8edbbb-1d2-ee8f-6550-ace8dea36599@linux-m68k.org> References: <283af572-2157-77c6-2594-8e9e92497346@amsat.org> <4da39536-1acb-05c3-755c-9a30d82d6ace@ilande.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Received-SPF: none client-ip=66.111.4.27; envelope-from=fthain@linux-m68k.org; helo=out3-smtp.messagingengine.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=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: Peter Maydell , qemu-devel@nongnu.org, Laurent Vivier , Greg Kurz , qemu-ppc@nongnu.org, David Gibson , =?UTF-8?Q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, 31 Aug 2021, Mark Cave-Ayland wrote: > You mentioned that the OS may compensate for the fact that the 6522 > doesn't have an overflow flag: can you explain more as to how this works > in Linux? When running on real hardware, Linux/mac68k does so by - Elevating the interrupt priority of VIA 1 so that other drivers do not interfere with timekeeping - Constraining intervals during which the IPL is kept elevated (i.e. local_irq_disable/enable). When runing on QEMU, none of that is sufficient and the Linux/mac68k kernel can do very little to influence interrupt latency. Linux ports to other platforms typically have multiple timers and counters with which to implement reliable clocksource devices. When running on other virtualization platforms, Linux may solve the problem using a paravirtual clock device. Please see CONFIG_PARAVIRT_CLOCK, arch/x86/include/asm/pvclock-abi.h, arch/x86/kernel/pvclock.c, arch/x86/include/asm/vdso/gettimeofday.h arch/x86/xen/time.c and so on.