Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3090201yba; Mon, 8 Apr 2019 10:53:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwjInpjH1DfKvWrxYwKMteXPd4x/gwJ8UkKuWqRt2Ers7mQeDMxJqs60ISdD9K1At2vdPnK X-Received: by 2002:a62:59cb:: with SMTP id k72mr31656542pfj.111.1554746008574; Mon, 08 Apr 2019 10:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554746008; cv=none; d=google.com; s=arc-20160816; b=ZKFmnwIDJZuPlGecThJMP3wGz4Zcbzb9MvrdjKXtGwe/gj9jfa5n96EFO7+RK5agtn okmkTzeBekwdRN0FYa3nwqncIWnEbPEu4kZEl8NsGKuzM8TxEY6fSkEq8pp0oxM3PS0c VxnVPOBa3RVyLLFMTj572xdcSoaOplmAsYBFn/eScpyOuutEnzGPZ8aGwvffD3PIsCch KTYK2fyiEJtSyLMwLrvbtHU/SNoAD3yXU1b7GCXJhjbLv/N6l17AnNV5VLBKUmVrxyf3 G/POJwyZAkHpc2xMu8qQvzzCAekx1Ymd3Tqy7WF2xLmqXvUCdcP2kKQOzfhGzJpwJvtF 8clA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GWLILQ/AekG/VOxx2LX5lvqBDLL+284oFIcXd72Zzqk=; b=N46qfgOXFPVeQTyly832B+l5Bb+kXvmVxIpc7cPVUU147LffOPRB3dALjeMYgFAy5f J+FFJYTm5gMOaOKfO61eqpIm8D5Eliro/XSXgjJWtZjWELJMb+Zg+HAGx2kRWD7gVRLz aXlOvRqEoX0TaBOBbR65CICrCxyM7JwvXufCeB/d/wnr//BhAU92DCqHZbA+OVEWXfJP m7+qjL638P/x0tGIhQTbD1bXwErbrAnpQlZXyben+FGnLz8El08wa1A4E/DQycwkn7CY t30OYz3z7zdGs+FgOxoEZYK4vHP/J6DeLi1+zRnwAIpgUpvAUmEFHB3u/+rWFZm7dB6a c6zw== 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 w126si28457591pfb.196.2019.04.08.10.53.13; Mon, 08 Apr 2019 10:53:28 -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 S1728871AbfDHPtl (ORCPT + 99 others); Mon, 8 Apr 2019 11:49:41 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50584 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726349AbfDHPtj (ORCPT ); Mon, 8 Apr 2019 11:49:39 -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 D1C3C15BE; Mon, 8 Apr 2019 08:49:38 -0700 (PDT) Received: from filthy-habits.cambridge.arm.com (filthy-habits.cambridge.arm.com [10.1.196.92]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0FEEF3F557; Mon, 8 Apr 2019 08:49:36 -0700 (PDT) From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Russell King , Will Deacon , Catalin Marinas , Mark Rutland , Daniel Lezcano , Wim Van Sebroeck , Guenter Roeck , Valentin Schneider Subject: [PATCH 1/7] ARM: vdso: Remove dependency with the arch_timer driver internals Date: Mon, 8 Apr 2019 16:49:01 +0100 Message-Id: <20190408154907.223536-2-marc.zyngier@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190408154907.223536-1-marc.zyngier@arm.com> References: <20190408154907.223536-1-marc.zyngier@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) 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