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=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham 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 F305BC43381 for ; Sat, 30 Mar 2019 09:56:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD59F218AC for ; Sat, 30 Mar 2019 09:56:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730625AbfC3J4V convert rfc822-to-8bit (ORCPT ); Sat, 30 Mar 2019 05:56:21 -0400 Received: from foss.arm.com ([217.140.101.70]:42482 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730415AbfC3J4U (ORCPT ); Sat, 30 Mar 2019 05:56:20 -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 6CC2680D; Sat, 30 Mar 2019 02:56:20 -0700 (PDT) Received: from big-swifty.misterjones.org (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E45703F557; Sat, 30 Mar 2019 02:56:17 -0700 (PDT) Date: Sat, 30 Mar 2019 09:56:14 +0000 Message-ID: <86wokg65z5.wl-marc.zyngier@arm.com> From: Marc Zyngier To: Wei Huang Cc: , , , , , , , Subject: Re: [PATCH 1/1] KVM: arm/arm64: arch_timer: Fix TimerValue TVAL calculation in KVM In-Reply-To: <20190329201253.29164-1-wei@redhat.com> References: <20190329201253.29164-1-wei@redhat.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: ARM Ltd MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 29 Mar 2019 20:12:53 +0000, Wei Huang wrote: > > Recently the generic timer test of kvm-unit-tests failed to complete > (stalled) when a physical timer is being used. This issue is caused > by incorrect update of CNT_CVAL when TimerValue is being accessed, > introduced by 'Commit 84135d3d18da ("KVM: arm/arm64: consolidate arch > timer trap handlers")'. According to Arm ARM, the read/write behavior > of accesses to TimeValue registers is expected to be: > > * READ: TimerValue = (CompareValue – (Counter - Offset) > * WRITE: CompareValue = ((Counter - Offset) + Sign(TimerValue) > > This patch fixes the TVAL read/write code path according to the > specification. > > Signed-off-by: Wei Huang Huh... Nice catch. I guess I only ran this with a VHE host, where this code path is unused. Thanks, M. -- Jazz is not dead, it just smell funny.