From patchwork Sat May 16 04:45:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Huang X-Patchwork-Id: 48585 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B65D92121F for ; Sat, 16 May 2015 04:51:14 +0000 (UTC) Received: by wivs14 with SMTP id s14sf3818018wiv.1 for ; Fri, 15 May 2015 21:51:14 -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:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=aHjwbJr5GxDBfz8kcV2Ohrcr48uz0mBS6BhV96q1tas=; b=grT4KDFQbjEFcNowWDvrzbepzJSQ+VT7xH8i5uZbCU06bPKd6DLe18M2ALpOGy5f0q 7CNY0bSMT+8FJ6hCn1LoauvBl01ANXDXydRuaiJJtPAAaSgXiDSO0TbTqjP1/SxRs23a vHDXdOQuC9jdISVVQBw9m4UdisnwQsBn/pWkOn3C28dF+Zzk7N3mrjMOm/x4hLaR+8L/ 9SIwcVcCrYjM9ReZ8C4038DjWr7xEjrAxv1r9XE43uu4vMGasevq08sQlJ17A3Tp2m33 D4dVR/N6oN7hXKhfmz9FybbVFDONEEUfhHqZzYnfe78+2YUtoJXjT7eOa8r4xGxSeU24 uXWg== X-Gm-Message-State: ALoCoQmdFvNOmM3rBrBOrX+m8ZKuuAhHGHkE8Zur9dNS17jZCydghog0ZMKS5jsW94zBi7nRO9JW X-Received: by 10.152.203.233 with SMTP id kt9mr9571757lac.7.1431751874028; Fri, 15 May 2015 21:51:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.98 with SMTP id 2ls24324lal.36.gmail; Fri, 15 May 2015 21:51:13 -0700 (PDT) X-Received: by 10.152.37.228 with SMTP id b4mr9393837lak.117.1431751873819; Fri, 15 May 2015 21:51:13 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id oc2si2389868lbb.1.2015.05.15.21.51.13 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 May 2015 21:51:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by laat2 with SMTP id t2so149284243laa.1 for ; Fri, 15 May 2015 21:51:13 -0700 (PDT) X-Received: by 10.152.87.204 with SMTP id ba12mr9821543lab.35.1431751873666; Fri, 15 May 2015 21:51: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.112.108.230 with SMTP id hn6csp2472810lbb; Fri, 15 May 2015 21:51:12 -0700 (PDT) X-Received: by 10.70.43.176 with SMTP id x16mr24155015pdl.83.1431751871985; Fri, 15 May 2015 21:51:11 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ji4si5593593pbb.229.2015.05.15.21.51.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 May 2015 21:51:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YtU2B-0007t4-GJ; Sat, 16 May 2015 04:49:11 +0000 Received: from mail-pd0-f182.google.com ([209.85.192.182]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YtU0F-0006g0-1J for linux-arm-kernel@lists.infradead.org; Sat, 16 May 2015 04:47:11 +0000 Received: by pdeq5 with SMTP id q5so45166984pde.1 for ; Fri, 15 May 2015 21:46:53 -0700 (PDT) X-Received: by 10.66.121.101 with SMTP id lj5mr24025741pab.113.1431751613042; Fri, 15 May 2015 21:46:53 -0700 (PDT) Received: from localhost ([167.160.116.91]) by mx.google.com with ESMTPSA id ml6sm3368968pdb.69.2015.05.15.21.46.50 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 15 May 2015 21:46:52 -0700 (PDT) From: Zhichao Huang To: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, alex.bennee@linaro.org Subject: [PATCH 07/10] KVM: arm: add trap handlers for 64-bit debug registers Date: Sat, 16 May 2015 12:45:48 +0800 Message-Id: <1431751551-4788-8-git-send-email-zhichao.huang@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1431751551-4788-1-git-send-email-zhichao.huang@linaro.org> References: <1431751551-4788-1-git-send-email-zhichao.huang@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150515_214711_128864_9467968A X-CRM114-Status: UNSURE ( 9.87 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.182 listed in list.dnswl.org] -0.2 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.182 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record Cc: huangzhichao@huawei.com, Zhichao Huang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhichao.huang@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.215.44 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 Add handlers for all the 64-bit debug registers. There is an overlap between 32 and 64bit registers. Make sure that 64-bit registers preceding 32-bit ones. Signed-off-by: Zhichao Huang --- arch/arm/kvm/coproc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c index 3d7c09e..cba81ed 100644 --- a/arch/arm/kvm/coproc.c +++ b/arch/arm/kvm/coproc.c @@ -435,9 +435,17 @@ static const struct coproc_reg cp15_regs[] = { { CRn( 1), CRm((n)), Op1( 0), Op2( 1), is32, trap_raz_wi } /* + * Architected CP14 registers. + * * Trapped cp14 registers. We generally ignore most of the external * debug, on the principle that they don't really make sense to a * guest. Revisit this one day, whould this principle change. + * + * CRn denotes the primary register number, but is copied to the CRm in the + * user space API for 64-bit register access in line with the terminology used + * in the ARM ARM. + * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 and with 64-bit + * registers preceding 32-bit ones. */ static const struct coproc_reg cp14_regs[] = { /* DBGIDR */ @@ -445,10 +453,14 @@ static const struct coproc_reg cp14_regs[] = { /* DBGDTRRXext */ { CRn( 0), CRm( 0), Op1( 0), Op2( 2), is32, trap_raz_wi }, DBG_BCR_BVR_WCR_WVR(0), + /* DBGDRAR (64bit) */ + { CRn( 0), CRm( 1), Op1( 0), Op2( 0), is64, trap_raz_wi}, /* DBGDSCRint */ { CRn( 0), CRm( 1), Op1( 0), Op2( 0), is32, trap_dbgdscr, NULL, cp14_DBGDSCRext }, DBG_BCR_BVR_WCR_WVR(1), + /* DBGDSAR (64bit) */ + { CRn( 0), CRm( 2), Op1( 0), Op2( 0), is64, trap_raz_wi}, /* DBGDSCRext */ { CRn( 0), CRm( 2), Op1( 0), Op2( 2), is32, trap_debug32, NULL, cp14_DBGDSCRext },