From patchwork Mon Feb 16 14:50:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 44716 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f199.google.com (mail-we0-f199.google.com [74.125.82.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 18D0421544 for ; Mon, 16 Feb 2015 14:53:28 +0000 (UTC) Received: by mail-we0-f199.google.com with SMTP id q59sf19773500wes.2 for ; Mon, 16 Feb 2015 06:53:27 -0800 (PST) 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:cc:subject:precedence:list-id:list-unsubscribe: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:list-archive; bh=ZsmhbVPuakTrvCcoc9giGEp6aVuWszFdFYjbi4ZEhIY=; b=lc7+9+QLE4YYL+/FVQm7Jyji4RbofboH1m7/PrfC6hGYaS4hgb2EdSgEe1Q01yMx6T ty7BIg3+YTwf7qMdBKyQKPymzYZJsqKtTSaCU6Z854FrNeAv19oHwPLaQQs8YHCAVmtQ khDgJNiLduV8OKW0hyk6kJdQhHz5U+bgcPzGr7LIOf27darzvA/UQAwCpAXEjBHbBbC8 tg6+UPpd1DQhLcR+4f/7oQ0R75GCrZHQRsaprX/q550iTIzSpT91Q48wQ6r/O0RLwJBZ ciyOH4ldegp/ZYGAl20A28Wkn2pSPe+xsyYmzz0hIzMH7sVWTyCifpWjLJ+omdYjdHe+ NOkg== X-Gm-Message-State: ALoCoQnxuf/38zdgqTx3RXp2seH43RuNF9yV9MOgRGvLi8Qa0o19DQjcR8VDq+B6O8XLoeryjLLD X-Received: by 10.112.46.106 with SMTP id u10mr2949791lbm.3.1424098407409; Mon, 16 Feb 2015 06:53:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.39 with SMTP id kv7ls507661lac.76.gmail; Mon, 16 Feb 2015 06:53:27 -0800 (PST) X-Received: by 10.152.170.233 with SMTP id ap9mr20167355lac.47.1424098407265; Mon, 16 Feb 2015 06:53:27 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id ur4si9815138lbc.55.2015.02.16.06.53.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 06:53:27 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labgf13 with SMTP id gf13so29265560lab.9 for ; Mon, 16 Feb 2015 06:53:27 -0800 (PST) X-Received: by 10.112.161.34 with SMTP id xp2mr22680438lbb.73.1424098407082; Mon, 16 Feb 2015 06:53:27 -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.112.35.133 with SMTP id h5csp1629792lbj; Mon, 16 Feb 2015 06:53:26 -0800 (PST) X-Received: by 10.52.10.229 with SMTP id l5mr13339560vdb.52.1424098403507; Mon, 16 Feb 2015 06:53:23 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ep5si7259541vdb.85.2015.02.16.06.53.22 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Feb 2015 06:53:23 -0800 (PST) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YNN1S-0001iV-GX; Mon, 16 Feb 2015 14:51:42 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YNN1Q-0001gF-JU for xen-devel@lists.xenproject.org; Mon, 16 Feb 2015 14:51:40 +0000 Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id 76/8C-10964-BF302E45; Mon, 16 Feb 2015 14:51:39 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-14.tower-27.messagelabs.com!1424098298!13772183!1 X-Originating-IP: [209.85.212.182] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18909 invoked from network); 16 Feb 2015 14:51:38 -0000 Received: from mail-wi0-f182.google.com (HELO mail-wi0-f182.google.com) (209.85.212.182) by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 16 Feb 2015 14:51:38 -0000 Received: by mail-wi0-f182.google.com with SMTP id l15so25999837wiw.3 for ; Mon, 16 Feb 2015 06:51:37 -0800 (PST) X-Received: by 10.180.74.206 with SMTP id w14mr38084517wiv.71.1424098297870; Mon, 16 Feb 2015 06:51:37 -0800 (PST) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id dj5sm23172398wjb.28.2015.02.16.06.51.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Feb 2015 06:51:37 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 16 Feb 2015 14:50:49 +0000 Message-Id: <1424098255-22490-10-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1424098255-22490-1-git-send-email-julien.grall@linaro.org> References: <1424098255-22490-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Vijaya.Kumar@caviumnetworks.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v3 09/15] xen/arm: vgic-v3: Clarify which distributor is used in the common emulation X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@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.50 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 List-Archive: The messages in the common emulation doesn't specify which distributor (redistributor or distributor) is used. This make difficult to find the correct registers. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- Changes in v3: - Add Ian's ack Changes in v2: - Patch added --- xen/arch/arm/vgic-v3.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c index 97249db..609e3c8 100644 --- a/xen/arch/arm/vgic-v3.c +++ b/xen/arch/arm/vgic-v3.c @@ -275,8 +275,8 @@ write_ignore_32: return 1; } -static int __vgic_v3_distr_common_mmio_read(struct vcpu *v, mmio_info_t *info, - uint32_t reg) +static int __vgic_v3_distr_common_mmio_read(const char *name, struct vcpu *v, + mmio_info_t *info, uint32_t reg) { struct hsr_dabt dabt = info->dabt; struct cpu_user_regs *regs = guest_cpu_user_regs(); @@ -360,15 +360,14 @@ static int __vgic_v3_distr_common_mmio_read(struct vcpu *v, mmio_info_t *info, return 1; default: printk(XENLOG_G_ERR - "%pv: vGICD/vGICR: unhandled read r%d offset %#08x\n", - v, dabt.reg, reg); + "%pv: %s: unhandled read r%d offset %#08x\n", + v, name, dabt.reg, reg); return 0; } bad_width: - printk(XENLOG_G_ERR - "%pv: vGICD/vGICR: bad read width %d r%d offset %#08x\n", - v, dabt.size, dabt.reg, reg); + printk(XENLOG_G_ERR "%pv: %s: bad read width %d r%d offset %#08x\n", + v, name, dabt.size, dabt.reg, reg); domain_crash_synchronous(); return 0; @@ -377,8 +376,8 @@ read_as_zero: return 1; } -static int __vgic_v3_distr_common_mmio_write(struct vcpu *v, mmio_info_t *info, - uint32_t reg) +static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v, + mmio_info_t *info, uint32_t reg) { struct hsr_dabt dabt = info->dabt; struct cpu_user_regs *regs = guest_cpu_user_regs(); @@ -473,15 +472,15 @@ static int __vgic_v3_distr_common_mmio_write(struct vcpu *v, mmio_info_t *info, return 1; default: printk(XENLOG_G_ERR - "%pv: vGICD/vGICR: unhandled write r%d=%"PRIregister" offset %#08x\n", - v, dabt.reg, *r, reg); + "%pv: %s: unhandled write r%d=%"PRIregister" offset %#08x\n", + v, name, dabt.reg, *r, reg); return 0; } bad_width: printk(XENLOG_G_ERR - "%pv: vGICD/vGICR: bad write width %d r%d=%"PRIregister" offset %#08x\n", - v, dabt.size, dabt.reg, *r, reg); + "%pv: %s: bad write width %d r%d=%"PRIregister" offset %#08x\n", + v, name, dabt.size, dabt.reg, *r, reg); domain_crash_synchronous(); return 0; @@ -516,7 +515,8 @@ static int vgic_v3_rdistr_sgi_mmio_read(struct vcpu *v, mmio_info_t *info, * Above registers offset are common with GICD. * So handle in common with GICD handling */ - return __vgic_v3_distr_common_mmio_read(v, info, gicr_reg); + return __vgic_v3_distr_common_mmio_read("vGICR: SGI", v, info, + gicr_reg); case GICR_ISPENDR0: if ( dabt.size != DABT_WORD ) goto bad_width; rank = vgic_rank_offset(v, 1, gicr_reg - GICR_ISPENDR0, DABT_WORD); @@ -581,7 +581,8 @@ static int vgic_v3_rdistr_sgi_mmio_write(struct vcpu *v, mmio_info_t *info, * Above registers offset are common with GICD. * So handle common with GICD handling */ - return __vgic_v3_distr_common_mmio_write(v, info, gicr_reg); + return __vgic_v3_distr_common_mmio_write("vGICR: SGI", v, + info, gicr_reg); case GICR_ISPENDR0: if ( dabt.size != DABT_WORD ) goto bad_width; rank = vgic_rank_offset(v, 1, gicr_reg - GICR_ISACTIVER0, DABT_WORD); @@ -777,7 +778,7 @@ static int vgic_v3_distr_mmio_read(struct vcpu *v, mmio_info_t *info) * Above all register are common with GICR and GICD * Manage in common */ - return __vgic_v3_distr_common_mmio_read(v, info, gicd_reg); + return __vgic_v3_distr_common_mmio_read("vGICD", v, info, gicd_reg); case GICD_IROUTER ... GICD_IROUTER31: /* SGI/PPI is RES0 */ goto read_as_zero_64; @@ -942,7 +943,7 @@ static int vgic_v3_distr_mmio_write(struct vcpu *v, mmio_info_t *info) case GICD_ICFGR ... GICD_ICFGRN: /* Above registers are common with GICR and GICD * Manage in common */ - return __vgic_v3_distr_common_mmio_write(v, info, gicd_reg); + return __vgic_v3_distr_common_mmio_write("vGICD", v, info, gicd_reg); case GICD_IROUTER ... GICD_IROUTER31: /* SGI/PPI is RES0 */ goto write_ignore_64;