From patchwork Thu Feb 20 11:17:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 25029 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 29200203C6 for ; Thu, 20 Feb 2014 11:32:05 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id kp14sf4451142pab.10 for ; Thu, 20 Feb 2014 03:32:04 -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: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=K+PZMN6gM30n1ZyWLjHvLpmkleGrgAqNd2ME6YjLWUw=; b=CjPUKcaCqs6z/2yY3QHbNpeEgO4dNM8d7ncS85a50AcDR64ptBXsbzhOq91ZQac+4u ggumKjz3HiYdPIOjy0HRtgWFI8TV2dgJXjdqm6xoEUU22AQvijZxoijU0DHyK4uJgnvA n629KYjUXNJIoqE3aUvr43uVQFxSrjpkJ4GgIEbzzdJnI+8nAdamLMQPnKo+yD07+M/b ud8JSZzxgmdQMmW9ZYK+8XtTJvG4yG4+NqoP2WKb+P52TrI6AlUKoOpV+KpV+28NsIfH oLqmvVvpCvgZhIoCycq2iPYsBSJBShblCfOUyegZpNzunhoFeune9yhBxSCfi2eBXCf7 oeSg== X-Gm-Message-State: ALoCoQnG5k1Gw8YmLQWAUQv5VhleFScvkGHiFEox0tsYBRPpwrch59lrIGmZBPajVCyJwGE7mzVk X-Received: by 10.66.246.194 with SMTP id xy2mr513807pac.36.1392895923853; Thu, 20 Feb 2014 03:32:03 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.39.37 with SMTP id u34ls516987qgu.37.gmail; Thu, 20 Feb 2014 03:32:03 -0800 (PST) X-Received: by 10.220.159.4 with SMTP id h4mr704207vcx.1.1392895923556; Thu, 20 Feb 2014 03:32:03 -0800 (PST) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id vf1si1349809vcb.17.2014.02.20.03.32.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 03:32:03 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.169 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.169; Received: by mail-ve0-f169.google.com with SMTP id oy12so1728920veb.0 for ; Thu, 20 Feb 2014 03:32:03 -0800 (PST) X-Received: by 10.52.106.166 with SMTP id gv6mr569774vdb.86.1392895923488; Thu, 20 Feb 2014 03:32:03 -0800 (PST) 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.174.196 with SMTP id u4csp51014vcz; Thu, 20 Feb 2014 03:32:03 -0800 (PST) X-Received: by 10.224.98.212 with SMTP id r20mr872426qan.0.1392895922933; Thu, 20 Feb 2014 03:32:02 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x103si1661511qgx.127.2014.02.20.03.32.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 20 Feb 2014 03:32:02 -0800 (PST) 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]:37669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGRrG-0006re-Iw for patch@linaro.org; Thu, 20 Feb 2014 06:32:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58947) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGRej-00046H-7z for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:19:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGRei-0004yk-2A for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:19:05 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:46035) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGReh-0004wV-P3 for qemu-devel@nongnu.org; Thu, 20 Feb 2014 06:19:03 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WGRdH-0003Sm-72; Thu, 20 Feb 2014 11:17:35 +0000 From: Peter Maydell To: Anthony Liguori Date: Thu, 20 Feb 2014 11:17:18 +0000 Message-Id: <1392895054-13232-15-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1392895054-13232-1-git-send-email-peter.maydell@linaro.org> References: <1392895054-13232-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: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PULL 14/30] target-arm: Log bad system register accesses with LOG_UNIMP 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=neutral (google.com: 209.85.128.169 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 c96ba68..f6500e5 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1177,7 +1177,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 782aab8..6d822c6 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -6962,6 +6962,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; }