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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 26A36C433E0 for ; Thu, 2 Jul 2020 13:53:45 +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 E671920772 for ; Thu, 2 Jul 2020 13:53:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CeJPAj/v"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y2kvmOQO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E671920772 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=YBT0x6bGQDJIJo+c9fsEQWT3jMuiSxdOHqjIRfahfhM=; b=CeJPAj/vd02XtkSMndeAWwLJ+ nmusDj6epRuz6njiuXSmYDt4rKPrvr9obp0QrGE4gH2ldipSbINPZfzMJTwGSEgtrIrOMypWeJ4/4 ZO7+pfmtLZwufJILWioy2J2OF9VpJMTIRE4Y+lZtAJvcMgq7EtpJacHt512lBLjLa6FV9uU5nvHzy ndjCTDonQvyV+6QrJZbeH9CgAgIge3ix2WRtk/eD+SyJZd1JvvNd0KThICTe+e8cg3XyD+4Bd0vhf tfR3hMpcjh0jdY2Is5HZgdl0uXNg6wkKL8H/STowbzTi9h6gtJPGh2/r5R4B6eLXUJl7LSJGRkD9c jFQVIprCg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqzde-0000zI-Qt; Thu, 02 Jul 2020 13:52:30 +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 1jqzdb-0000yg-Kn for linux-arm-kernel@lists.infradead.org; Thu, 02 Jul 2020 13:52:28 +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 E3B8620772; Thu, 2 Jul 2020 13:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593697947; bh=DoDqXqmrd3oM09yjqOF1BqRub857Xf66aLnPbcmfgw8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Y2kvmOQO+uHgsfEzN56+/cG89ZHvlaemE2rI9ilz0cLz65/8Ja7mrD8oCpuyqBp1J Sh+9xqh0UHs0RyKSS/PZ/RG/K6bA3qRe8DgueFqkEXoq548z/SPsbuqbyDZINv4Pc0 6MrNv6thF7kIg1GCGpvuovO/3p8Nuv7JF9rMpAU4= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jqzdZ-008QCW-Cp; Thu, 02 Jul 2020 14:52:25 +0100 MIME-Version: 1.0 Date: Thu, 02 Jul 2020 14:52:25 +0100 From: Marc Zyngier To: Mark Rutland Subject: Re: [PATCH 2/3] arm64: arch_timer: Allow an workaround descriptor to provide vdso_clock_mode In-Reply-To: <20200702102859.GC15391@C02TD0UTHF1T.local> References: <20200701161824.1346732-1-maz@kernel.org> <20200701161824.1346732-3-maz@kernel.org> <20200702102859.GC15391@C02TD0UTHF1T.local> User-Agent: Roundcube Webmail/1.4.5 Message-ID: <82ce7e37d05dd184c2e225e5384ce77e@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: mark.rutland@arm.com, will@kernel.org, catalin.marinas@arm.com, daniel.lezcano@linaro.org, vincenzo.frascino@arm.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@android.com 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-20200702_095227_830834_F4D39FEC X-CRM114-Status: GOOD ( 19.33 ) 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: kernel-team@android.com, Catalin Marinas , Daniel Lezcano , linux-kernel@vger.kernel.org, Thomas Gleixner , Vincenzo Frascino , Will Deacon , 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 On 2020-07-02 11:28, Mark Rutland wrote: > On Wed, Jul 01, 2020 at 05:18:23PM +0100, Marc Zyngier wrote: >> As we are about to disable the vdso for compat tasks in some >> circumstances, >> let's allow a workaround descriptor to provide the vdso_clock_mode >> that >> matches the platform. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/include/asm/arch_timer.h | 3 +++ >> drivers/clocksource/arm_arch_timer.c | 3 +++ >> 2 files changed, 6 insertions(+) >> >> diff --git a/arch/arm64/include/asm/arch_timer.h >> b/arch/arm64/include/asm/arch_timer.h >> index 7ae54d7d333a..fb8dfcbf9c01 100644 >> --- a/arch/arm64/include/asm/arch_timer.h >> +++ b/arch/arm64/include/asm/arch_timer.h >> @@ -18,6 +18,8 @@ >> #include >> #include >> >> +#include >> + >> #include >> >> #if IS_ENABLED(CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND) >> @@ -58,6 +60,7 @@ struct arch_timer_erratum_workaround { >> u64 (*read_cntvct_el0)(void); >> int (*set_next_event_phys)(unsigned long, struct clock_event_device >> *); >> int (*set_next_event_virt)(unsigned long, struct clock_event_device >> *); >> + enum vdso_clock_mode vdso_clock_mode; >> }; >> >> DECLARE_PER_CPU(const struct arch_timer_erratum_workaround *, >> diff --git a/drivers/clocksource/arm_arch_timer.c >> b/drivers/clocksource/arm_arch_timer.c >> index ecf7b7db2d05..f828835c568f 100644 >> --- a/drivers/clocksource/arm_arch_timer.c >> +++ b/drivers/clocksource/arm_arch_timer.c >> @@ -566,6 +566,9 @@ void arch_timer_enable_workaround(const struct >> arch_timer_erratum_workaround *wa >> if (wa->read_cntvct_el0) { >> clocksource_counter.vdso_clock_mode = VDSO_CLOCKMODE_NONE; >> vdso_default = VDSO_CLOCKMODE_NONE; >> + } else { >> + clocksource_counter.vdso_clock_mode = wa->vdso_clock_mode; >> + vdso_default = wa->vdso_clock_mode; >> } > > I fear that we're liable to forget to set vdso_clock_mode on new errata > that don't need a read_cntvct_el0 hook, and if so we'll happen to set > these to 0 (i.e. VDSO_CLOCKMODE_NONE). > > For now could we instead have a boolan disable_compat_vdso, with this > being: > > | if (wa->read_cntvct_el0) { > | clocksource_counter.vdso_clock_mode = VDSO_CLOCKMODE_NONE; > | vdso_default = VDSO_CLOCKMODE_NONE; > | } else if (wa->disable_compat_vdso) { > | clocksource_counter.vdso_clock_mode = > VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT; > | vdso_default = wa->vdso_clock_mode = > VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT; > | } Sure, that'd work too. > Do we need to handle the comination of a workaround seeting NONE and > one > setting ARCHTIMER_NOCOMPAT? Not yet. Probably coming any time now. Which is why we may need to look into per-CPU vdso data pages (Broonie has a series that could be of some use, apparently). 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