From patchwork Thu Aug 3 06:25:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9878167 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 57D4660360 for ; Thu, 3 Aug 2017 06:26:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B27728883 for ; Thu, 3 Aug 2017 06:26:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F9152887F; Thu, 3 Aug 2017 06:26:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 774DF28884 for ; Thu, 3 Aug 2017 06:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751137AbdHCGZy (ORCPT ); Thu, 3 Aug 2017 02:25:54 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:32853 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032AbdHCGZx (ORCPT ); Thu, 3 Aug 2017 02:25:53 -0400 Received: by mail-wm0-f41.google.com with SMTP id k20so1972890wmg.0 for ; Wed, 02 Aug 2017 23:25:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=zIybOA7mg6njs54+kuYkgNSRXWo9UKDCvIimnkJcDzM=; b=JJmsEZk6BFLVC6QU5sFf10yMDMlIApbtrVIY4l4qy+rcdPIBRrU4GCTjxN7ChxAQXG aEoFArQu+Ej+HzGO94H4QG/BZaCy1D25lNUkwgIqMNrkm6A1pUDjPehJS2FAesdQHaTY D4ylC3Vth707Epq2d/+uUa8ZcINdL6Q+0Hyd4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zIybOA7mg6njs54+kuYkgNSRXWo9UKDCvIimnkJcDzM=; b=GJmlvHu1WLP2CScGZav5MxWKfXB4PiNy6uYYexnKcD92U51emnm3NsOU1YjAs8y0bS djy2sxpJ6nWurlLffC4xftv1baMh/+HQp8NBtMRDHFS4sB7FpZ384LyFz9WzpHA0dO9x /XYI+gGp8Ib1zyxlbejhnbMs7R98jS1AiB/gXKyRVY2noVqqzb/UhTxrVKlS6B3S5AE6 zZp9c158ffrMCUm1nw3dyPfD8hIud6xb5hnVGdE3reRa/BHxom5AFMvpxNW5xGGBTYKd MZ1RaVx20tuOIJTXZvZKXoE4kBV4S6LAHLgRyE3lGjrIrHSQwknMYZUGgLTF/0rofy1K rxZw== X-Gm-Message-State: AIVw113z9ZdPLqjQ5mhRgQ6H4cUli7n9ax7WZiKPOdaocqlZJvWsovSk rzh3g/yyiK2Eqqg8mLf/PQ== X-Received: by 10.80.225.66 with SMTP id i2mr741107edl.211.1501741552329; Wed, 02 Aug 2017 23:25:52 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id v18sm690912edi.66.2017.08.02.23.25.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 23:25:51 -0700 (PDT) From: Christoffer Dall To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu Cc: Andrew Jones , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Marc Zyngier , Christoffer Dall Subject: [PATCH kvm-unit-tests] arm64: timer: Use correct counter for !pending_before Date: Thu, 3 Aug 2017 08:25:45 +0200 Message-Id: <20170803062545.17533-1-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We were using the virtual counter to calculate a timer cval which is 10 seconds in the future, but this obviously doesn't work for the physical timer which is bases on the physical counter. Make sure we use a properly paired timer/counter pair. Reported-by: Andrew Jones Signed-off-by: Christoffer Dall --- arm/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arm/timer.c b/arm/timer.c index e824338..4cdca9e 100644 --- a/arm/timer.c +++ b/arm/timer.c @@ -174,7 +174,7 @@ static bool test_cval_10msec(struct timer_info *info) static void test_timer(struct timer_info *info) { - u64 now = read_sysreg(cntvct_el0); + u64 now = info->read_counter(); u64 time_10s = read_sysreg(cntfrq_el0) * 10; u64 later = now + time_10s;