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=-4.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 E745FC433E0 for ; Tue, 12 Jan 2021 15:32:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 8BF5C23130 for ; Tue, 12 Jan 2021 15:32:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BF5C23130 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eM/bCK6pRBJ3u7Qmy1xoEWcbMEUJy6mt8J0GgiRaoHQ=; b=Bjx7O5VrTYjfCnRUNM6RIqgCm RAXyFXPRenvZy97gAmENwBo7NeXnHi59ehi55mKzgRRF9yUattEEvUNWn9IipLyLk9xGqh60ulA2P vwVdtaQ/+NVF7MpHJs2Quy2hUnXI9F/+lMXwRgwGNYsWBkf2cl8NR0Rry+IOoknSs79LZfJ9ZRDvH xe65IKznkczJv1Cdpt3OLFnHm87CVCVTIA/iX/v/iHmXobWM+VLYy9EAbwLUaVPSAt8hsHlKzzip8 KzIjz4lN8pSHq7hfTzgHFTCvdOefLN1TqnQUKEpwdFmfkVqid6FgGnQ6pp2e3JH4Tz1jcvhYn5GyN g89ANqZIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzLd5-0003ou-RL; Tue, 12 Jan 2021 15:30:43 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzLd1-0003nM-W0 for linux-arm-kernel@lists.infradead.org; Tue, 12 Jan 2021 15:30:41 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8794623130; Tue, 12 Jan 2021 15:30:38 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kzLcy-0070TP-Be; Tue, 12 Jan 2021 15:30:36 +0000 MIME-Version: 1.0 Date: Tue, 12 Jan 2021 15:30:36 +0000 From: Marc Zyngier To: Chanho Park Subject: Re: [PATCH] clocksource/drivers/arm_arch_timer: export arch_timer_get_rate In-Reply-To: References: <20210112013140.35979-1-chanho61.park@samsung.com> <20210112101247.GA34326@C02TD0UTHF1T.local> <7123dff576287de381c93abb88d9e283@kernel.org> User-Agent: Roundcube Webmail/1.4.9 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: parkch98@gmail.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org, chanho61.park@samsung.com, daniel.lezcano@linaro.org, tglx@linutronix.de X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210112_103040_294845_BE9BB40A X-CRM114-Status: GOOD ( 28.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Chanho Park , Daniel Lezcano , Thomas Gleixner , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Chanho, On 2021-01-12 15:14, Chanho Park wrote: > Hi Marc, > > On Tue, Jan 12, 2021 at 11:45 PM Marc Zyngier wrote: >> >> On 2021-01-12 13:39, Chanho Park wrote: >> > Hi, >> > >> >> On Tue, Jan 12, 2021 at 10:31:40AM +0900, Chanho Park wrote: >> >> > This patch adds to export arch_timer_get_rate function for calculating >> >> > absolute timestamp which is based on arch timer like below. >> >> > arch_timer_read_counter was already exported but arch_timer_get_rate >> >> > wasn't. Thus, this patch tries to export this to use this function from >> >> > loadable kernel module. >> >> >> >> Can you please explain /where/ this would be used? i.e. which module? >> >> >> >> Generally we try to avoid drivers depending on the specific >> >> clocksource, >> >> so I think there needs to be stronger rationale for exposing this. >> > >> > I need a system-wide timestamp which can be available from bootloader >> > and kernel stages including virtual machines. >> > Actually, it's necessary to record a timestamp of each log message for >> > system-wide debugging on type-1 hypervisor. >> > RTC can be used for this purpose but we should make it to hypervisor >> > awareness. >> > |---------------|-------------------------| >> > Bootloader VM1 (Guest) >> > |-------------------------| >> > VM2 (Guest) >> > >> > So, the easiest way is using the arm architect timer's timestamp >> > because it's already supported on each VM by the hypervisor. >> >> This doesn't make much sense. The hypervisor and the VMs are >> independent software entities, and they don't use symbols from >> each other. > > I meant that each VM needs to be synchronized by the ARM arch timer's > timestamp not the symbol itself. > The symbol is necessary to calculate the system-wide time by the > timestamp(counter) value. > > The counter of the arm architect timer will be increasing from the > bootloader. > The hypervisor will not reset the counter and each VMs as well. So, we > can use this timestamp for comparing _real_ time :) Well, you can compare the raw counter values, and do the conversion in a single place. Also, if your system is correctly configured, you have access to CNTFRQ_EL0, which contains the same thing as arch_timer_get_rate(). >> So this symbol is probably used by a module *inside* the VMs, >> and Mark's question still stands. >> > > Yes. Actually, we use this timestamp for our internal module which is > not yet upstreamed. If the module code is not upstream, I don't see the point in exporting this symbol. I suggest you post both as a series so that we can decide whether that is a good idea or not. Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel