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=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 815E0C433ED for ; Fri, 14 May 2021 12:39:08 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 F3D026145B for ; Fri, 14 May 2021 12:39:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3D026145B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iQYv1PSRio4nUaszyFDuLTIQeqp9NaNafRJu+PXtCTk=; b=dAWrEXa/Pw09Uggnx1C2tnDXE HLw63tlalQdaB8E0ccZ6yfNIQM5G1KZabzak0XT3aijKXaKBFmQJCFMOGhcwXbnr7HqDT6rlAQC+O i58wCLBhZ2ogrKpC5cbSnhO/a6CN8Psz2tdw1mC7YbJjrUrSdQ2FEgz4A1nyc/c4hmOkjhAzOdH53 +QzfbndLXXsKhRKrWg+1DOZVySoDKtwPGANNqm7oKzpM0it2sDGvvlhyiBcQyMLR5K6pExNDWpR+T zkYKX1CY3A5iuaeZR0+PNIh/aDL5mmEuzgJ0n8xTnQq7Ii4NOcEtIHHHeTRBXhtmQUecA9aahiMPT m/dp9uGAw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhX4J-0083NG-M3; Fri, 14 May 2021 12:37:27 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhX4H-0083Me-8I for linux-arm-kernel@desiato.infradead.org; Fri, 14 May 2021 12:37:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=QX+Nz4kQxJfOYnNx+HuEd6l3P3A0TLP79pGgCp94M4w=; b=PXQyd3sHKb5Kde9ld6L5PKj8Xi Uvot0sbQuDt6+FcnaLTrHPJtwHGo6EuU+fN2+q6Qo1Qu0eeeerkJdZ7FT78HmVnj5VNWhghZCwBRU 1eInGjiW3Xz/TSNUzneJ4WJy8mnRKuvFCtu67niMYydmmvb4YiuFmTgAVaSgGYGHgDtW+SlG8HfuC hhSHhrut6wi9K2tfKfgtPVJT6cze0pxZP87yr6RqDWGlLH88zQe/Mc4QqLiKvKYuIN1hZqDAKLAOW dLMPoOwJbfK4MbMtLVBFZLGLUVMv1ibJYNY6ot3dImFNXo/cNWe5dBe0PVsnlCp2vdI9Hed4lp4m5 LM+ROnmw==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhX4E-00Byj9-GQ for linux-arm-kernel@lists.infradead.org; Fri, 14 May 2021 12:37:24 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 20B38175D; Fri, 14 May 2021 05:37:17 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.0.219]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 85EBF3F73B; Fri, 14 May 2021 05:37:14 -0700 (PDT) Date: Fri, 14 May 2021 13:37:11 +0100 From: Mark Rutland To: Michael Kelley Cc: will@kernel.org, catalin.marinas@arm.com, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-efi@vger.kernel.org, arnd@arndb.de, wei.liu@kernel.org, ardb@kernel.org, daniel.lezcano@linaro.org, kys@microsoft.com Subject: Re: [PATCH v10 3/7] arm64: hyperv: Add Hyper-V clocksource/clockevent support Message-ID: <20210514123711.GB30645@C02TD0UTHF1T.local> References: <1620841067-46606-1-git-send-email-mikelley@microsoft.com> <1620841067-46606-4-git-send-email-mikelley@microsoft.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1620841067-46606-4-git-send-email-mikelley@microsoft.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_053722_662798_FA5C2FBC X-CRM114-Status: GOOD ( 21.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Michael, On Wed, May 12, 2021 at 10:37:43AM -0700, Michael Kelley wrote: > Add architecture specific definitions and functions needed > by the architecture independent Hyper-V clocksource driver. > Update the Hyper-V clocksource driver to be initialized > on ARM64. Previously we've said that for a clocksource we must use the architected counter, since that's necessary for things like the VDSO to work correctly and efficiently. Given that, I'm a bit confused that we're registering a per-cpu clocksource that is in part based on the architected counter. Likewise, I don't entirely follow why it's necessary to PV the clock_event_device. Are the architected counter and timer reliable without this PV infrastructure? Why do we need to PV either of those? Thanks, Mark. > > Signed-off-by: Michael Kelley > Reviewed-by: Sunil Muthuswamy > --- > arch/arm64/include/asm/mshyperv.h | 12 ++++++++++++ > drivers/clocksource/hyperv_timer.c | 14 ++++++++++++++ > 2 files changed, 26 insertions(+) > > diff --git a/arch/arm64/include/asm/mshyperv.h b/arch/arm64/include/asm/mshyperv.h > index c448704..b17299c 100644 > --- a/arch/arm64/include/asm/mshyperv.h > +++ b/arch/arm64/include/asm/mshyperv.h > @@ -21,6 +21,7 @@ > #include > #include > #include > +#include > > /* > * Declare calls to get and set Hyper-V VP register values on ARM64, which > @@ -41,6 +42,17 @@ static inline u64 hv_get_register(unsigned int reg) > return hv_get_vpreg(reg); > } > > +/* Define the interrupt ID used by STIMER0 Direct Mode interrupts. This > + * value can't come from ACPI tables because it is needed before the > + * Linux ACPI subsystem is initialized. > + */ > +#define HYPERV_STIMER0_VECTOR 31 > + > +static inline u64 hv_get_raw_timer(void) > +{ > + return arch_timer_read_counter(); > +} > + > /* SMCCC hypercall parameters */ > #define HV_SMCCC_FUNC_NUMBER 1 > #define HV_FUNC_ID ARM_SMCCC_CALL_VAL( \ > diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c > index 977fd05..270ad9c 100644 > --- a/drivers/clocksource/hyperv_timer.c > +++ b/drivers/clocksource/hyperv_timer.c > @@ -569,3 +569,17 @@ void __init hv_init_clocksource(void) > hv_setup_sched_clock(read_hv_sched_clock_msr); > } > EXPORT_SYMBOL_GPL(hv_init_clocksource); > + > +/* Initialize everything on ARM64 */ > +static int __init hyperv_timer_init(struct acpi_table_header *table) > +{ > + if (!hv_is_hyperv_initialized()) > + return -EINVAL; > + > + hv_init_clocksource(); > + if (hv_stimer_alloc(true)) > + return -EINVAL; > + > + return 0; > +} > +TIMER_ACPI_DECLARE(hyperv, ACPI_SIG_GTDT, hyperv_timer_init); > -- > 1.8.3.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel