From patchwork Fri Jan 31 15:45:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 23976 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E15DC202B2 for ; Fri, 31 Jan 2014 15:58:23 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id hu8sf10898067vcb.2 for ; Fri, 31 Jan 2014 07:58:23 -0800 (PST) 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:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Vf4U7nTJfcdRJEr4rexLPXPgREihywpaYEQadFrbIsk=; b=f9T4BkX6aXkBl/k2Ke/2XD5iSlbvSCYobW1mKhQFvhye0OWfp+GApKST8Rty9rz7uT wyV51C2ty4zGZP+1ODuyq168mMy4TlwceK3EnJ9b4gbCuL4tFULbfheqVWDej57Zu65J ZovDy8CSnvx+vUcB1bsvac0q0r9jqhyYfb5fHGl0YAI+cqXx1h4ehP50/A1PAfEE9oAL eg0K/KByv4YSlI8Q4WGPp7qLyj3bq3f15gfFXdMTf+uosxNj14A1Dk8WfHjmOw/Rosq8 STj37D3bWGiA0HGveYvYrbQOZOv3yUaK2cCE/S4FrDaKVS8aWuTbcYkDDqLw+J3B+DSY Dtrw== X-Gm-Message-State: ALoCoQmWhsKIw+DM7zBlHYMUpKNyJ/8WaZAVXnIxzS+XO3KSdzcDmJe69H2+/5LUyU0c/dZm6eGb X-Received: by 10.236.82.110 with SMTP id n74mr359919yhe.57.1391183903082; Fri, 31 Jan 2014 07:58:23 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.49 with SMTP id v46ls1018903qge.6.gmail; Fri, 31 Jan 2014 07:58:23 -0800 (PST) X-Received: by 10.52.171.39 with SMTP id ar7mr10387392vdc.5.1391183903012; Fri, 31 Jan 2014 07:58:23 -0800 (PST) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id xw5si3660850vec.46.2014.01.31.07.58.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 Jan 2014 07:58:23 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id pa12so3234687veb.33 for ; Fri, 31 Jan 2014 07:58:22 -0800 (PST) X-Received: by 10.52.170.3 with SMTP id ai3mr2197691vdc.35.1391183902928; Fri, 31 Jan 2014 07:58:22 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp106477vcz; Fri, 31 Jan 2014 07:58:22 -0800 (PST) X-Received: by 10.180.103.227 with SMTP id fz3mr27633871wib.29.1391183901798; Fri, 31 Jan 2014 07:58:21 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id qa8si5661255wic.27.2014.01.31.07.58.20 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 31 Jan 2014 07:58:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1W9GHn-00080P-NF; Fri, 31 Jan 2014 15:45:43 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Michael Matz , Claudio Fontana , Dirk Mueller , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Will Newton , Peter Crosthwaite , Rob Herring Subject: [PATCH v2 06/35] target-arm: Log bad system register accesses with LOG_UNIMP Date: Fri, 31 Jan 2014 15:45:14 +0000 Message-Id: <1391183143-30724-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391183143-30724-1-git-send-email-peter.maydell@linaro.org> References: <1391183143-30724-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Log guest attempts to access unimplemented system registers via the LOG_UNIMP reporting mechanism (for both the 32 bit and 64 bit instruction sets). This is particularly useful for debugging problems where the guest is trying to use a system register that QEMU doesn't implement. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite --- target-arm/translate-a64.c | 7 ++++++- target-arm/translate.c | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index ee768f2..f808998 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1172,7 +1172,12 @@ static void handle_sys(DisasContext *s, uint32_t insn, bool isread, crn, crm, op0, op1, op2)); if (!ri) { - /* Unknown register */ + /* Unknown register; this might be a guest error or a QEMU + * unimplemented feature. + */ + qemu_log_mask(LOG_UNIMP, "%s access to unsupported AArch64 " + "system register op0:%d op1:%d crn:%d crm:%d op2:%d\n", + isread ? "read" : "write", op0, op1, crn, crm, op2); unallocated_encoding(s); return; } diff --git a/target-arm/translate.c b/target-arm/translate.c index e701c0f..45886f9 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -6923,6 +6923,19 @@ static int disas_coproc_insn(CPUARMState * env, DisasContext *s, uint32_t insn) return 0; } + /* Unknown register; this might be a guest error or a QEMU + * unimplemented feature. + */ + if (is64) { + qemu_log_mask(LOG_UNIMP, "%s access to unsupported AArch32 " + "64 bit system register cp:%d opc1: %d crm:%d\n", + isread ? "read" : "write", cpnum, opc1, crm); + } else { + qemu_log_mask(LOG_UNIMP, "%s access to unsupported AArch32 " + "system register cp:%d opc1:%d crn:%d crm:%d opc2:%d\n", + isread ? "read" : "write", cpnum, opc1, crn, crm, opc2); + } + return 1; }