From patchwork Mon Jun 22 10:41:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Huang X-Patchwork-Id: 6654711 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 693C0C05AC for ; Mon, 22 Jun 2015 10:42:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE70B20411 for ; Mon, 22 Jun 2015 10:42:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 160E32040F for ; Mon, 22 Jun 2015 10:42:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933170AbbFVKmU (ORCPT ); Mon, 22 Jun 2015 06:42:20 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:35500 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932995AbbFVKmS (ORCPT ); Mon, 22 Jun 2015 06:42:18 -0400 Received: by pacyo7 with SMTP id yo7so28385899pac.2 for ; Mon, 22 Jun 2015 03:42:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SB/XcO485d9PKbtq1tLUWzR5zsw4eYyA1xA/mgRiebE=; b=JaFm/Yle4skpmkaxhE1OK27EkHEhdhbmqSGFqxaUblgSALNUjH7hogyDm/3AgftnHD kcFaVfDDZ8Zz4occVHj9oJuvo7UD7ynL9YrTkO49ZlQKjyiHUn4SVpfF6Dhn5UsHI3aY Vk/Ei4XfpvwY71SleSr90eBPJyOi2cWLD5MtflXAYKs8aTfVem7hRaFrETADbGokf8aw zvSpLQBXZyjc1AMEJ+1SITkUvZazr5CJqfL4L5J1TGseMqoqlkWy6PKRPWb8aWZP/oQA Nq3ky9PAEw9vUPQiPbdNrmcxj7u02lYSAxI5+KsqtHkFNu83uoR/Gd1vQVHl2X8ONQT7 gWjQ== X-Gm-Message-State: ALoCoQmMYo18BO7P15Rl803U5m5Glasyzz/x3pHqC5gAIf6Z55XdhbjMbcwWzVnmcn+r9hwXg3b8 X-Received: by 10.68.69.37 with SMTP id b5mr58206631pbu.35.1434969738061; Mon, 22 Jun 2015 03:42:18 -0700 (PDT) Received: from localhost ([104.207.83.42]) by mx.google.com with ESMTPSA id dd3sm19611737pad.45.2015.06.22.03.42.16 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 22 Jun 2015 03:42:16 -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 Cc: huangzhichao@huawei.com, Zhichao Huang Subject: [PATCH v3 07/11] KVM: arm: add trap handlers for 64-bit debug registers Date: Mon, 22 Jun 2015 18:41:30 +0800 Message-Id: <1434969694-7432-8-git-send-email-zhichao.huang@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1434969694-7432-1-git-send-email-zhichao.huang@linaro.org> References: <1434969694-7432-1-git-send-email-zhichao.huang@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Christoffer Dall --- 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 },