From patchwork Sun May 31 04:27:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Huang X-Patchwork-Id: 49263 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B853824588 for ; Sun, 31 May 2015 04:33:25 +0000 (UTC) Received: by wiam3 with SMTP id m3sf3600757wia.3 for ; Sat, 30 May 2015 21:33: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: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=b9vRYZMhp67CYUl92idgxxvaftGdpIH/Ftotwgoj1jY=; b=lENztYsWjU6gUPvTjU9OgiOq6GMJKgcW0d+zykUszOatPHRMO+91pHNBmjaHgTEvnL r71ky/Cm4Le9ANO6nSyT+itkLW69zlxHIFpt3n5Nxx379WB70zJso871EQhdg2f01vsy rriyKxpi6NwGXSvYZPLzuzfgS9fAYiA50hTo5vpcyZzvVDK071i5YHpndnX0KEBfgqqn H6PPZlYG+loKHNHVcGLAZB3UqGUYQDCTxRh3uAOCpNd+jOVJ/XXB8uaq0m+6nUX2B6Hk QxhQ6rqoqklx5w/R4QeJIxlODa2+ch3iC+BqnhO3pU4DomvGZzhC3i1C5HHVV0H0MBGC nRzw== X-Gm-Message-State: ALoCoQn1WGCjhaSvB5Ip7AeM5a/TwrpmaCnLLqe0jOFCSnO5L9tufTbvotdQVQ+iR6B/Zvk2d+am X-Received: by 10.112.142.170 with SMTP id rx10mr14541351lbb.12.1433046804708; Sat, 30 May 2015 21:33:24 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.205.99 with SMTP id lf3ls303764lac.54.gmail; Sat, 30 May 2015 21:33:24 -0700 (PDT) X-Received: by 10.152.42.200 with SMTP id q8mr4190498lal.53.1433046804569; Sat, 30 May 2015 21:33:24 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id f2si8888882laa.43.2015.05.30.21.33.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 May 2015 21:33:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by labpy14 with SMTP id py14so68859987lab.0 for ; Sat, 30 May 2015 21:33:24 -0700 (PDT) X-Received: by 10.152.2.133 with SMTP id 5mr13795652lau.36.1433046804128; Sat, 30 May 2015 21:33: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.112.108.230 with SMTP id hn6csp1397428lbb; Sat, 30 May 2015 21:33:23 -0700 (PDT) X-Received: by 10.70.15.68 with SMTP id v4mr29024326pdc.64.1433046802397; Sat, 30 May 2015 21:33:22 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ez11si15550176pac.113.2015.05.30.21.33.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 May 2015 21:33:22 -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 1YyuuN-00080f-SI; Sun, 31 May 2015 04:31:35 +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 1YyusC-0005Rj-5e for linux-arm-kernel@lists.infradead.org; Sun, 31 May 2015 04:29:20 +0000 Received: by pdbki1 with SMTP id ki1so83102687pdb.1 for ; Sat, 30 May 2015 21:28:59 -0700 (PDT) X-Received: by 10.70.0.67 with SMTP id 3mr28670952pdc.152.1433046539555; Sat, 30 May 2015 21:28:59 -0700 (PDT) Received: from localhost ([167.160.116.87]) by mx.google.com with ESMTPSA id t2sm578270pdo.81.2015.05.30.21.28.56 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 30 May 2015 21:28:58 -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, will.deacon@arm.com Subject: [PATCH v2 07/11] KVM: arm: add trap handlers for 64-bit debug registers Date: Sun, 31 May 2015 12:27:08 +0800 Message-Id: <1433046432-1824-8-git-send-email-zhichao.huang@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1433046432-1824-1-git-send-email-zhichao.huang@linaro.org> References: <1433046432-1824-1-git-send-email-zhichao.huang@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150530_212920_300847_22C9DA1A X-CRM114-Status: UNSURE ( 9.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.8 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.0 SPF_PASS SPF: sender matches SPF record -1.1 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.182 listed in wl.mailspike.net] 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.43 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 59b65b7..eeee648 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, reset_val, cp14_DBGDSCRext, 0 },