Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3008993yba; Mon, 8 Apr 2019 09:10:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzO4PXRkpjLDYfnSOkKjor5RTd04QHZcTzSxxVv5FBNh5Am3c7iEBWywwadZU2YjGclOMUC X-Received: by 2002:aa7:90ca:: with SMTP id k10mr30858727pfk.144.1554739841398; Mon, 08 Apr 2019 09:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554739841; cv=none; d=google.com; s=arc-20160816; b=xxDGsMfH+S0AynHLx8c/mGI64CaN3cN4NnTsrr3v/i+AWTnBB7+DLTlt1+0v5PyZW1 zQCNxkzL+AIYDGhVXiC3xWN8CfHY5j77U84rr8DGfHglD6v0Mdjf2kJ0RdnxRgxek0jS Bb3NjWY8zG67NIU1wIe2vGZkV3P9oWCuDfp8PZDYcYcI5k/k87YaoXQZPbONTItQFM4V fIjyP88iT/uO3GfMGutbBJ0gq1MMF+qtovdCSgbGCJxADYwbKPfwUNcz6uqynnCdFDpv XYMM2zoM1CWrZzGVIYb9nPvnT6KvWAiGMErUaBeOfhyZrXA5L91hXUObEWmdA49vZi/o MLeg== 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=LBRzxOwUDlUXcbEG5KiImqmgZnBM7yBLEDXIZ2O6S9Y=; b=repipV8aPj2dkutm7eBEiN6bimCDTPu56lqvdTxNSVz/QaGCD1lhhrq8sqFdcHVhqH JZ8rJB39LoOLE3m/e6MB0WPN5r8hmnmU27jhzTYZuZzW5bMANiGPcuwIrq10gKBQCQ8v Q/6VIePB0C17O0edHf43uadCHrMDO/Xtw//mUhC6iLc6qzN+k7utVMygAjVI2OiTPxuB 1L67jIEyOJy/tXtAdEHtuYwDgWXk+K1sHypkHlncTjkGhu8cZ7q2TXcRR/yyecrx4E3I AU5hXmFv/+yn0B++SvgzvqPM7tSymScENVbjc/63cc0NC0ndLTsBmkDyVE0FPDSgbwG8 7+Ow== 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 a33si5066880pld.123.2019.04.08.09.10.26; Mon, 08 Apr 2019 09:10:41 -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 S1728915AbfDHPtp (ORCPT + 99 others); Mon, 8 Apr 2019 11:49:45 -0400 Received: from foss.arm.com ([217.140.101.70]:50620 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728842AbfDHPtn (ORCPT ); Mon, 8 Apr 2019 11:49:43 -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 E5ACA1715; Mon, 8 Apr 2019 08:49:42 -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 256363F557; Mon, 8 Apr 2019 08:49:41 -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 3/7] arm64: Use arch_timer_read_counter instead of arch_counter_get_cntvct Date: Mon, 8 Apr 2019 16:49:03 +0100 Message-Id: <20190408154907.223536-4-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 Only arch_timer_read_counter will guarantee that workarounds are applied. So let's use this one instead of arch_counter_get_cntvct. Signed-off-by: Marc Zyngier --- arch/arm64/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 8ad119c3f665..6190a60388cf 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -493,7 +493,7 @@ static void cntvct_read_handler(unsigned int esr, struct pt_regs *regs) { int rt = ESR_ELx_SYS64_ISS_RT(esr); - pt_regs_write_reg(regs, rt, arch_counter_get_cntvct()); + pt_regs_write_reg(regs, rt, arch_timer_read_counter()); arm64_skip_faulting_instruction(regs, AARCH64_INSN_SIZE); } @@ -665,7 +665,7 @@ static void compat_cntvct_read_handler(unsigned int esr, struct pt_regs *regs) { int rt = (esr & ESR_ELx_CP15_64_ISS_RT_MASK) >> ESR_ELx_CP15_64_ISS_RT_SHIFT; int rt2 = (esr & ESR_ELx_CP15_64_ISS_RT2_MASK) >> ESR_ELx_CP15_64_ISS_RT2_SHIFT; - u64 val = arch_counter_get_cntvct(); + u64 val = arch_timer_read_counter(); pt_regs_write_reg(regs, rt, lower_32_bits(val)); pt_regs_write_reg(regs, rt2, upper_32_bits(val)); -- 2.20.1