Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4985412yba; Tue, 30 Apr 2019 07:25:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUanUhEUynvCVBDJSu8Hoi7yVCZ76rVGbVzeiwESnwzQyzYvnLFqXjaiCaIq3I7E1GNocI X-Received: by 2002:a63:cd15:: with SMTP id i21mr3450588pgg.269.1556634332990; Tue, 30 Apr 2019 07:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556634332; cv=none; d=google.com; s=arc-20160816; b=wAmuM2dqi/29wjyyfpmclm7YEhjzSqhvnyFCahL7Le25dTQy5wSsqDnF1gQD/rySjS MELSr+gcofJ7zmuAth/QJ+JS/Feg1yHP41T94kyDb8aI4y9go1/wvClkf6vbyk3q2+GW GJ2XlIRA6/b7c+UFpP4dueMyJ+Kwh+tOFA5m/QAnjF8OjmN1xNXamyMk9iXGWRVhN4gW gUujId9ckb+umg7ijwOJeP4TDVM0kTp6HMc5G1HuQeN80qk5vpyL67abCQrQ+sEU8i4k eGWZzIIRpj/x/hp0uuN5ClDHKuday9STrkTNz7YCNgxwdyTbyGkSztIDdkesiYNQ1TH4 eOIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=pCiC3HOVUSzu2siKkf7KiY9/SewUM2U1nVsu/apXjqM=; b=QPtApBR71R2AlQumzY0gfxcSnTMbKO4RM9YBG+CdO4HzSjG2Exu9OHC2+bDTzC5oXY eRCcSF0CLwv8zBB07ERY7sxKqjEGTwbOrn6rLPjhQ0Q/tRHFd+S8NiH+zXfauJosJVHY 3NHOcnZwiK4+B1Etc1QKVUp4Z0lW8AJuNz+ydxFTJ89mHg3xY+N6TGC8ZgIWl8XIOKHq /8d1Wt6slrDhP/YdE+g0vPXBVPVS+VTcJhDC5trO8bqNcDuGtDklu1m3DK5B/P5PnQnz 2+PTwB/SS0CfWqK94v7FowC1QTo30deUbQ9ADG4yYwxVclm1o4+6CU0zsv2W1NNl4FoO M58A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si24401771pgv.51.2019.04.30.07.25.13; Tue, 30 Apr 2019 07:25:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727406AbfD3OYA (ORCPT + 99 others); Tue, 30 Apr 2019 10:24:00 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:48224 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726303AbfD3OYA (ORCPT ); Tue, 30 Apr 2019 10:24:00 -0400 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 8AC2280D; Tue, 30 Apr 2019 07:23:59 -0700 (PDT) Received: from fuggles.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 AB2183F719; Tue, 30 Apr 2019 07:23:57 -0700 (PDT) Date: Tue, 30 Apr 2019 15:23:55 +0100 From: Will Deacon To: Marc Zyngier , linux@armlinux.org.uk Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Catalin Marinas , Mark Rutland , Daniel Lezcano , Wim Van Sebroeck , Guenter Roeck , Valentin Schneider Subject: Re: [PATCH 1/7] ARM: vdso: Remove dependency with the arch_timer driver internals Message-ID: <20190430142355.GF17870@fuggles.cambridge.arm.com> References: <20190408154907.223536-1-marc.zyngier@arm.com> <20190408154907.223536-2-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190408154907.223536-2-marc.zyngier@arm.com> User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On Mon, Apr 08, 2019 at 04:49:01PM +0100, Marc Zyngier wrote: > THe VDSO code uses the kernel helper that was originally designed > 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(-) This looks ok to me and I'd like to take the series via arm64, but I could do with an Ack from Russell on these 32-bit ARM parts first. Will > 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) > + > 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 >