From patchwork Thu Jan 29 18:25:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 43968 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CA5EC24128 for ; Thu, 29 Jan 2015 18:28:53 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id l4sf22925615lbv.1 for ; Thu, 29 Jan 2015 10:28:51 -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=hO5rGHn+FtI4P9vxKJeftZ29JeU1TRJa7IvsSZHUu9M=; b=Zy4BEP+geUq/70A+/CVuXly+P2052dnid9WSwuVW9UJoScR2rplPfMyM6rWq4/zsOQ kyzR9wY9XVpoEEnao3TXfe6TInmkphA4W3NuyjRg1Sz0sMuG8opSmyf7+VQAcp7PHeJF HVRmive+h55SJ2/gdYudTtQeaRRZK+V+MRnvpjfv+RzKzSCAN0nbxgjnq9LA/E1jmMgq SMWGOLEad1LHkYR7eaj9F14T07QKvIbPMb/s6hXBiHix9h1rLtWUw+Eq15qKYmP4Cb80 vHL0ge3nrYtoCgag8BaOkQR/jVhzfgmUuVD6lifLTRKxRpL1t4b9L4dxt10r8+9257xj JP1Q== X-Gm-Message-State: ALoCoQlcenX8Enk8CPx6+ytv2H2ro+u052g7OD52HXD0MCpNllSBKpZEA9tAi/pzfKBZVxU+3Kzq X-Received: by 10.152.2.40 with SMTP id 8mr300764lar.7.1422556131818; Thu, 29 Jan 2015 10:28:51 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.42 with SMTP id x10ls184225lax.96.gmail; Thu, 29 Jan 2015 10:28:51 -0800 (PST) X-Received: by 10.112.8.41 with SMTP id o9mr2604987lba.40.1422556131628; Thu, 29 Jan 2015 10:28:51 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id rb6si8233532lbb.8.2015.01.29.10.28.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 10:28:51 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id p9so31225696lbv.8 for ; Thu, 29 Jan 2015 10:28:51 -0800 (PST) X-Received: by 10.112.164.101 with SMTP id yp5mr2539832lbb.82.1422556131545; Thu, 29 Jan 2015 10:28:51 -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 h5csp34408lbj; Thu, 29 Jan 2015 10:28:50 -0800 (PST) X-Received: by 10.221.64.73 with SMTP id xh9mr1099471vcb.71.1422556127490; Thu, 29 Jan 2015 10:28:47 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id tg8si3908182vcb.74.2015.01.29.10.28.46 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 10:28:47 -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 1YGtnq-0004hw-Kt; Thu, 29 Jan 2015 18:26:54 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YGtno-0004fJ-QS for xen-devel@lists.xenproject.org; Thu, 29 Jan 2015 18:26:52 +0000 Received: from [193.109.254.147] by server-3.bemta-14.messagelabs.com id 74/DE-10964-C6B7AC45; Thu, 29 Jan 2015 18:26:52 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-2.tower-27.messagelabs.com!1422556011!12405888!1 X-Originating-IP: [209.85.212.173] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.5; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31123 invoked from network); 29 Jan 2015 18:26:51 -0000 Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com) (209.85.212.173) by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 29 Jan 2015 18:26:51 -0000 Received: by mail-wi0-f173.google.com with SMTP id r20so30239226wiv.0 for ; Thu, 29 Jan 2015 10:26:51 -0800 (PST) X-Received: by 10.180.198.209 with SMTP id je17mr2549240wic.17.1422556011140; Thu, 29 Jan 2015 10:26:51 -0800 (PST) Received: from chilopoda.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id x18sm3518503wia.12.2015.01.29.10.26.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 10:26:50 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 29 Jan 2015 18:25:45 +0000 Message-Id: <1422555950-31821-11-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1422555950-31821-1-git-send-email-julien.grall@linaro.org> References: <1422555950-31821-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 v2 10/15] xen/arm: vgic-v2: Correctly set GICD_TYPER.CPUNumber 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.217.177 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 number of implemented CPU interfaces is one more than the value of this field. Also avoid hardcoding the shift and remove useless mask. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- This patch should be backported to Xen 4.4 and Xen 4.5. Although this patch won't apply directly for Xen 4.4 and may require to define GICD_TYPE_CPUS_SHIFT if "xen/arm: vgic-v3: Correctly set GICD_TYPER.CPUNumber" is not backported. Changes in v2: - Add Ian's ack - Fix typoes --- xen/arch/arm/vgic-v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c index 515faf7..5faef12 100644 --- a/xen/arch/arm/vgic-v2.c +++ b/xen/arch/arm/vgic-v2.c @@ -55,7 +55,7 @@ static int vgic_v2_distr_mmio_read(struct vcpu *v, mmio_info_t *info) if ( dabt.size != DABT_WORD ) goto bad_width; /* No secure world support for guests. */ vgic_lock(v); - *r = ( (v->domain->max_vcpus << 5) & GICD_TYPE_CPUS ) + *r = ( ((v->domain->max_vcpus - 1) << GICD_TYPE_CPUS_SHIFT) ) |( ((v->domain->arch.vgic.nr_spis / 32)) & GICD_TYPE_LINES ); vgic_unlock(v); return 1;