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=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT 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 7EFDEC10F13 for ; Mon, 8 Apr 2019 15:59:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0A25120857 for ; Mon, 8 Apr 2019 15:59:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FFpjL89+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0A25120857 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject: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=7JpfNj022v34HLGHcQUNc2KU6iP470IzpXyqpPdhwwY=; b=FFpjL89+Dc+/wk 12MAZrzRNCj19LyxFIToEPPZsN563OUUZOg2FAcRpKpTeg55jZUsY17pfQH1dHpiFfJBTs0fBwN1S 2KpTOBMdb5LanCumzPL9dvDCAj1/QBrQd96nBFoW9UjART6vgCd4wPy1liMArqmovxpv2P8rfRTiC IOrzoXl21qO80ArMI3InTSXIXwJNigD23DoOgPzdsRT/pH5ySDyaNx4ErNwQ07xkwL7ciWNwLOAB1 F6GQWa6WlwvSEhPgoyAMdiA1BGCkUxrcldkldvL6nXPudw+AnRW2C0887auBlA1xnQzVV29ct1N2M VhMBuYcO1QdMbXLEdAgQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDWfm-0000gj-Ao; Mon, 08 Apr 2019 15:59:02 +0000 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70] helo=foss.arm.com) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hDWfe-0000X1-3J for linux-arm-kernel@lists.infradead.org; Mon, 08 Apr 2019 15:58:56 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CAFF015AB; Mon, 8 Apr 2019 08:58:53 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 099633F557; Mon, 8 Apr 2019 08:58:51 -0700 (PDT) Date: Mon, 8 Apr 2019 16:58:49 +0100 From: Mark Rutland To: Marc Zyngier Subject: Re: [PATCH 1/7] ARM: vdso: Remove dependency with the arch_timer driver internals Message-ID: <20190408155849.GM6139@lakrids.cambridge.arm.com> References: <20190408154907.223536-1-marc.zyngier@arm.com> <20190408154907.223536-2-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190408154907.223536-2-marc.zyngier@arm.com> User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190408_085854_211301_318904DB X-CRM114-Status: GOOD ( 19.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , Catalin Marinas , Daniel Lezcano , Will Deacon , linux-kernel@vger.kernel.org, Guenter Roeck , Wim Van Sebroeck , Valentin Schneider , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 08, 2019 at 04:49:01PM +0100, Marc Zyngier wrote: > THe VDSO code uses the kernel helper that was originally designed Nit: s/THe/The/ > to abstract the access between 32 and 64bit systems. It worked so > far because this function is declared as 'inline'. > > As we're about to revamp that part of the code, the VDSO would > break. Let's fix it by doing what should have been done from > the start, a proper system register access. > > Signed-off-by: Marc Zyngier > --- > arch/arm/include/asm/cp15.h | 2 ++ > arch/arm/vdso/vgettimeofday.c | 5 +++-- > 2 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/include/asm/cp15.h b/arch/arm/include/asm/cp15.h > index 07e27f212dc7..d2453e2d3f1f 100644 > --- a/arch/arm/include/asm/cp15.h > +++ b/arch/arm/include/asm/cp15.h > @@ -68,6 +68,8 @@ > #define BPIALL __ACCESS_CP15(c7, 0, c5, 6) > #define ICIALLU __ACCESS_CP15(c7, 0, c5, 0) > > +#define CNTVCT __ACCESS_CP15_64(1, c14) This encoding looks right to me per ARM DDI 0406C.d section B4.1.34. The rest also looks sound, so with that typo fixed: Reviewed-by: Mark Rutland Mark. > + > extern unsigned long cr_alignment; /* defined in entry-armv.S */ > > static inline unsigned long get_cr(void) > diff --git a/arch/arm/vdso/vgettimeofday.c b/arch/arm/vdso/vgettimeofday.c > index a9dd619c6c29..7bdbf5d5c47d 100644 > --- a/arch/arm/vdso/vgettimeofday.c > +++ b/arch/arm/vdso/vgettimeofday.c > @@ -18,9 +18,9 @@ > #include > #include > #include > -#include > #include > #include > +#include > #include > #include > #include > @@ -123,7 +123,8 @@ static notrace u64 get_ns(struct vdso_data *vdata) > u64 cycle_now; > u64 nsec; > > - cycle_now = arch_counter_get_cntvct(); > + isb(); > + cycle_now = read_sysreg(CNTVCT); > > cycle_delta = (cycle_now - vdata->cs_cycle_last) & vdata->cs_mask; > > -- > 2.20.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel