From patchwork Tue Jan 21 20:12:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 23448 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 144B4202DA for ; Tue, 21 Jan 2014 20:12:39 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf30976419oag.9 for ; Tue, 21 Jan 2014 12:12:39 -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=XXtg4I6hQ67N4OGX5nzTyibxWi7qXDALEocukefIQgk=; b=kb1HZkFr+z6abEFfJ5hFu7g622HfdHJSzqXIYp9tvSGFhfjXLr1iN5B9ovOUpQSYv3 Xlv5iXvy6BbsMt2I4CtFpD5Z4qq1VKV+nk+3I/3gWUx/ia6YE1u6gqmYLPbWFg4nykBf qcKpqfCTEC+MmLUVyM5gL0h5xXlfXgYrEhEDt25e2zFiSYc6S9NGUYgK42VyHgQ5iS7D aX8YZNlZsd5eqVYUO/rUGbKAhObFRHMqrIe2mVG7Stt04D66+X9DJHNNqlq+7ig1Op1V uMhgRHWgchdhl83cCVECzf85MxEnRUJp8NsZWs9Y5PdPFU7cXWoIWhWOx2/yV3AGvtwK Mrog== X-Gm-Message-State: ALoCoQml3H1KiNFc9LuF7OIfKRfFBsq8xtlAkrBjFjZdw1E+LzGBc70RgGjT8um1AgHc+lP8Hm95 X-Received: by 10.43.96.73 with SMTP id cf9mr8201185icc.22.1390335158955; Tue, 21 Jan 2014 12:12:38 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.119 with SMTP id 110ls1320467qgw.28.gmail; Tue, 21 Jan 2014 12:12:38 -0800 (PST) X-Received: by 10.220.98.143 with SMTP id q15mr1335199vcn.38.1390335158711; Tue, 21 Jan 2014 12:12:38 -0800 (PST) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id ec16si2782008veb.48.2014.01.21.12.12.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Jan 2014 12:12:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.175 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.175; Received: by mail-ve0-f175.google.com with SMTP id c14so1591467vea.34 for ; Tue, 21 Jan 2014 12:12:38 -0800 (PST) X-Received: by 10.220.139.136 with SMTP id e8mr2037526vcu.34.1390335158603; Tue, 21 Jan 2014 12:12:38 -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 u4csp138949vcz; Tue, 21 Jan 2014 12:12:38 -0800 (PST) X-Received: by 10.194.92.164 with SMTP id cn4mr47840wjb.74.1390335156403; Tue, 21 Jan 2014 12:12:36 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id o5si4370570wie.46.2014.01.21.12.12.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 21 Jan 2014 12:12:36 -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 1W5hgU-0003Vz-VK; Tue, 21 Jan 2014 20:12:30 +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 Subject: [PATCH 04/24] target-arm: Log bad system register accesses with LOG_UNIMP Date: Tue, 21 Jan 2014 20:12:10 +0000 Message-Id: <1390335150-13470-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1390335150-13470-1-git-send-email-peter.maydell@linaro.org> References: <1390335150-13470-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.175 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 --- 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 a808a88..e0f6765 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1121,7 +1121,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 8d240e1..59a206d 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -6672,6 +6672,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; }