From patchwork Wed Jul 1 16:18:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 11636835 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F28FE912 for ; Wed, 1 Jul 2020 16:20:22 +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 CBEDB2065D for ; Wed, 1 Jul 2020 16:20:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2G22u7IS"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="uCbpj/Tf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CBEDB2065D 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+patchwork-linux-arm=patchwork.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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GTYHyJuSD4kulS888ZnC5AdvBMjRuWwaeQi4D17BBMs=; b=2G22u7ISTvzokDd74MI6+ci+k DMXINo8WI8+2EImLGmAX42JFfQbWzaQODqbkJMnO8XH3vebM6H+6DyvVC5Taq56Jniy09impe8hgu fA0PD385mtzB5OW0d0fdAYqLGlxtVgwGfheT7MrCo8FgSc5cyKjpRIkjIc5WiDQ8qpVRkwTx3k8rh aHeFJcdivlXJeBoMPwz/RGFh7P/QHT7NYZq0QCsaktNrdQ5yK15fEnyGLV6CuQfQNdrlTm4NI7pjD 2GI0UDJD4d6G38XmHWgfOiicagGki2GafS+KTzNrWKc5AJfv/dDiBeycuw8Ha5QSt0Vs2HAJQVlwZ qqa8jyQVw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqfRY-0004pj-9P; Wed, 01 Jul 2020 16:18:40 +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 1jqfRR-0004n2-0B for linux-arm-kernel@lists.infradead.org; Wed, 01 Jul 2020 16:18:34 +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 5CFF82082F; Wed, 1 Jul 2020 16:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593620312; bh=PT78ahc4H7LmUWiLIneFFK3wQQU/fwD0zv8IBHzE/3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uCbpj/TfjJLqlBr7uxh9PAUI5xk26GxTK3BOy/0MbCG+6zv4XdQV+sDGSdIGuo9zv hxQn9cflTJ4oyYDFVHZh3oWuveEw7DrQJVQgaBrLZZoVtKJQadXQhLN/okTZcmTfKO z9LCxnbUBIHELBw0SKzliRTyocNT/gZapLTuAqtw= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jqfRO-0087Zf-Ru; Wed, 01 Jul 2020 17:18:31 +0100 From: Marc Zyngier To: Will Deacon , Catalin Marinas Subject: [PATCH 2/3] arm64: arch_timer: Allow an workaround descriptor to provide vdso_clock_mode Date: Wed, 1 Jul 2020 17:18:23 +0100 Message-Id: <20200701161824.1346732-3-maz@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701161824.1346732-1-maz@kernel.org> References: <20200701161824.1346732-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: will@kernel.org, catalin.marinas@arm.com, mark.rutland@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-20200701_121833_132572_AFFBFACA X-CRM114-Status: GOOD ( 13.81 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender 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 , Daniel Lezcano , linux-kernel@vger.kernel.org, Thomas Gleixner , Vincenzo Frascino , kernel-team@android.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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; } }