From patchwork Tue May 13 15:31:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 30111 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6D51D20446 for ; Tue, 13 May 2014 17:28:14 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf2994896pab.5 for ; Tue, 13 May 2014 10:28:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=cjg1jfdUzM2yTdwwko+sdf11HQmO0akFAMrvrzHaDUE=; b=aHzJcpk8Ftp3rJgVjGQG2dXywmq26zS8d7YPIXNXMQ/mRgpNYG3W2Ef3JINwy+zEK0 utrD6jtn8uFUfuHtNZ9BMPcQG/0Q8FphVL1Du3YcXrSe7dP0DD4uWQkjSj/7zd4CdPw5 xjAjEW9l0QQscVGHNV00xBZQgKOyVTxtQ64hIIsApeJMF86NGkcpNs93hwVEytv19CtA MaqG/IXNNRD1muNohU0r8vm3+P7feMwMh7+vDVn8sYzVif4U136Ro1wtRkOHGYQkG29t OXy7/qiQjWBxS+9biOZDXeMmY+1LB5ukMPGALUMZGdbRaVHpLCXGlyZ4F2LHt6ThrWiE qULw== X-Gm-Message-State: ALoCoQki6E6vc/dtv5y4Al5hk9G64j70L4CNXwY23MXtV6K/LrgEyf4CWZl2GSrBv1f06Fi4GpWs X-Received: by 10.66.251.70 with SMTP id zi6mr14453972pac.37.1400002093757; Tue, 13 May 2014 10:28:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.147 with SMTP id 19ls1987606qgp.68.gmail; Tue, 13 May 2014 10:28:13 -0700 (PDT) X-Received: by 10.52.72.138 with SMTP id d10mr25298309vdv.15.1400002093639; Tue, 13 May 2014 10:28:13 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id tr2si2751181vdc.186.2014.05.13.10.28.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 May 2014 10:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so911966vcb.1 for ; Tue, 13 May 2014 10:28:13 -0700 (PDT) X-Received: by 10.220.5.129 with SMTP id 1mr1277335vcv.71.1400002093572; Tue, 13 May 2014 10:28:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp169218vcb; Tue, 13 May 2014 10:28:13 -0700 (PDT) X-Received: by 10.220.159.4 with SMTP id h4mr30560306vcx.1.1400002092699; Tue, 13 May 2014 10:28:12 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v10si8122109qat.116.2014.05.13.10.28.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 13 May 2014 10:28:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:45917 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkElw-0006wy-78 for patch@linaro.org; Tue, 13 May 2014 11:37:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkEgM-00083s-CN for qemu-devel@nongnu.org; Tue, 13 May 2014 11:31:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WkEgG-000690-Iq for qemu-devel@nongnu.org; Tue, 13 May 2014 11:31:54 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:48125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WkEgG-00066p-D9 for qemu-devel@nongnu.org; Tue, 13 May 2014 11:31:48 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WkEg8-0006xZ-1N; Tue, 13 May 2014 16:31:40 +0100 From: Peter Maydell To: Anthony Liguori Date: Tue, 13 May 2014 16:31:38 +0100 Message-Id: <1399995099-26635-17-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1399995099-26635-1-git-send-email-peter.maydell@linaro.org> References: <1399995099-26635-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 16/17] hw/arm/stellaris: Correct handling of GPTM TAR register X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 We don't implement very much of the GPTM TAR register, and what we do is wrong. The "are we in RT mode?" field is in s->config, not s->control. Correct this, use LOG_UNIMP rather than hw_error() for the cases we don't support, and avoid an unlabelled fallthrough that makes Coverity complain. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite --- hw/arm/stellaris.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index c7de9cf..a2095c0 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -185,12 +185,19 @@ static uint64_t gptm_read(void *opaque, hwaddr offset, case 0x44: /* TBPMR */ return s->match_prescale[1]; case 0x48: /* TAR */ - if (s->control == 1) + if (s->config == 1) { return s->rtc; + } + qemu_log_mask(LOG_UNIMP, + "GPTM: read of TAR but timer read not supported"); + return 0; case 0x4c: /* TBR */ - hw_error("TODO: Timer value read\n"); + qemu_log_mask(LOG_UNIMP, + "GPTM: read of TBR but timer read not supported"); + return 0; default: - hw_error("gptm_read: Bad offset 0x%x\n", (int)offset); + qemu_log_mask(LOG_GUEST_ERROR, + "GPTM: read at bad offset 0x%x\n", (int)offset); return 0; } }