From patchwork Thu Jul 10 15:50:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 33466 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f199.google.com (mail-yk0-f199.google.com [209.85.160.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DA03E203F4 for ; Fri, 11 Jul 2014 00:31:24 +0000 (UTC) Received: by mail-yk0-f199.google.com with SMTP id 200sf875689ykr.10 for ; Thu, 10 Jul 2014 17:31:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version: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:content-type :content-transfer-encoding; bh=SIBIqgURvCS8IgnM6bTA4qydUGq36epAgelinae7oVs=; b=bUYsoEC0J1AaiTbp0ALjhnOvP3Vie/Ua+A8NShU/sUEEwv6BA1jKG5MANogSZK/d19 Q7epNFL+7SGPT15PIbWlaPb9m4cY0Mrmr8tgqQgchgXr8VjOAoIHSga5HUUSEwRafc9u Iu5JOa8NfzSIQS5kEPCevbU2OJDLPr8VmLX4UNEEecb7v9jdrAxTK4Tft8LKqSViVIMa Zyi7IKD9xlQe+rV7pQEpfqwjHIlxts46K8K/LSOC3PmRxUdob0Rf6TcSViuZ3waEuRQz EsaOG+fmD0vUAVI4YkyGaXAFR3kcd7uOWzC61eGoJ2PM4w72j0zim6MtqFqdI2v79XDo mMWA== X-Gm-Message-State: ALoCoQmQQJOMgsTivLebIOImbMjHoBPtTrfnDslukvCxuyWnv/GywVmQBCxArMSZwyfyZ+HBYF6c X-Received: by 10.58.187.200 with SMTP id fu8mr17463083vec.7.1405038684547; Thu, 10 Jul 2014 17:31:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.36.71 with SMTP id o65ls251736qgo.4.gmail; Thu, 10 Jul 2014 17:31:24 -0700 (PDT) X-Received: by 10.52.106.162 with SMTP id gv2mr2847665vdb.47.1405038684466; Thu, 10 Jul 2014 17:31:24 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id om8si542472vcb.63.2014.07.10.17.31.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Jul 2014 17:31:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id hy4so691735vcb.5 for ; Thu, 10 Jul 2014 17:31:24 -0700 (PDT) X-Received: by 10.52.106.162 with SMTP id gv2mr2847656vdb.47.1405038684332; Thu, 10 Jul 2014 17:31:24 -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.221.37.5 with SMTP id tc5csp178721vcb; Thu, 10 Jul 2014 17:31:24 -0700 (PDT) X-Received: by 10.224.55.202 with SMTP id v10mr88542858qag.10.1405038683964; Thu, 10 Jul 2014 17:31:23 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id i10si1028622qan.100.2014.07.10.17.31.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 10 Jul 2014 17:31:23 -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]:38675 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Gef-0002bv-Ob for patch@linaro.org; Thu, 10 Jul 2014 11:53:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50710) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Gbd-0001lv-UZ for qemu-devel@nongnu.org; Thu, 10 Jul 2014 11:50:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5GbZ-00072D-3p for qemu-devel@nongnu.org; Thu, 10 Jul 2014 11:49:57 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:35662 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5GbY-000722-U6 for qemu-devel@nongnu.org; Thu, 10 Jul 2014 11:49:53 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaro.local) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1X5GgM-0007L4-4z; Thu, 10 Jul 2014 17:54:50 +0200 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 10 Jul 2014 16:50:06 +0100 Message-Id: <1405007407-23549-10-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1405007407-23549-1-git-send-email-alex.bennee@linaro.org> References: <1405007407-23549-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: alex.bennee@linaro.org X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 88.198.71.155 Cc: Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , "open list:Overall" , Paolo Bonzini Subject: [Qemu-devel] [PATCH v2 09/10] target-arm/kvm.c: better error reporting 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: alex.bennee@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.174 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 From: Alex Bennée When we have a problem syncing CP registers between kvm<->qemu it's a lot more useful to have the names of the registers in the log than just a random abort() and core dump. Signed-off-by: Alex Bennée --- v2 - less verbose log message - fix checkpatch warnings diff --git a/target-arm/kvm.c b/target-arm/kvm.c index 319784d..72e242d 100644 --- a/target-arm/kvm.c +++ b/target-arm/kvm.c @@ -279,6 +279,16 @@ void kvm_arm_register_device(MemoryRegion *mr, uint64_t devid, uint64_t group, memory_region_ref(kd->mr); } +static void failed_cpreg_operation(ARMCPU *cpu, uint64_t regidx, int ret, + const char *func) +{ + uint32_t cpreg_id = kvm_to_cpreg_id(regidx); + ARMCPRegInfo *cpreg = g_hash_table_lookup(cpu->cp_regs, &cpreg_id); + qemu_log_mask(LOG_UNIMP, + "%s: failed (%d) KVM reg op %"PRIx64" (%s)\n", + func, ret, regidx, cpreg ? cpreg->name : "unknown"); +} + bool write_kvmstate_to_list(ARMCPU *cpu) { CPUState *cs = CPU(cpu); @@ -309,6 +319,7 @@ bool write_kvmstate_to_list(ARMCPU *cpu) abort(); } if (ret) { + failed_cpreg_operation(cpu, regidx, ret, __func__); ok = false; } } @@ -345,6 +356,7 @@ bool write_list_to_kvmstate(ARMCPU *cpu) * "you tried to set a register which is constant with * a different value from what it actually contains". */ + failed_cpreg_operation(cpu, regidx, ret, __func__); ok = false; } }