From patchwork Mon Feb 16 14:50:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 44706 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6ACFD21544 for ; Mon, 16 Feb 2015 14:52:35 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id h11sf16003662wiw.1 for ; Mon, 16 Feb 2015 06:52:34 -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=Nn2jd1CD/I/HM6EPxI/GnwJWKBxl2aMb6m0swRfnaH+deaqzuTXj900TlCA80qH0D3 2agnqZcLTlsIamOlNIWfdtHUK3G0pYddFhNMz+MpIwGnRJvNAcd44oLWdpUKkUhdshRs m9/GrEYCFt24RkOxV+3gsBCcxul8km1QV/8BpY0mpBYusaFwEk1b9pguVJL/GvrsYkwb QzOLqFNvaBYZUXGkDVYh8rBRwYn8koXBuxxPy5jzQox1z/y4YEAaR8F1fygLOHLjbGJ9 ZrTOdmIXzeRjcf8+tuJPXt1GHVVaMy/UW27zRabi+3PiykTetr9SOCbifqfXwNYyR046 ih+g== X-Gm-Message-State: ALoCoQlLK5HPTCXnUdNuQjozXn6f3/0dWOoSdvtkwRigXUdwwjZgxhK5h0m48cPJNWiWE4lUfLQO X-Received: by 10.194.239.41 with SMTP id vp9mr2987757wjc.5.1424098354647; Mon, 16 Feb 2015 06:52:34 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.4 with SMTP id u4ls518262laj.88.gmail; Mon, 16 Feb 2015 06:52:34 -0800 (PST) X-Received: by 10.112.135.196 with SMTP id pu4mr22638140lbb.41.1424098354421; Mon, 16 Feb 2015 06:52:34 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id cf4si7580334lbb.33.2015.02.16.06.52.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 06:52:34 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by labhz20 with SMTP id hz20so29148335lab.0 for ; Mon, 16 Feb 2015 06:52:34 -0800 (PST) X-Received: by 10.112.40.201 with SMTP id z9mr22512858lbk.117.1424098354292; Mon, 16 Feb 2015 06:52:34 -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 h5csp1629318lbj; Mon, 16 Feb 2015 06:52:33 -0800 (PST) X-Received: by 10.220.132.204 with SMTP id c12mr10567894vct.5.1424098352536; Mon, 16 Feb 2015 06:52:32 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id p18si3752772vct.106.2015.02.16.06.52.31 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Feb 2015 06:52:32 -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 1YNN1T-0001jl-3n; Mon, 16 Feb 2015 14:51:43 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YNN1R-0001gm-89 for xen-devel@lists.xenproject.org; Mon, 16 Feb 2015 14:51:41 +0000 Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id 67/24-02753-CF302E45; Mon, 16 Feb 2015 14:51:40 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-7.tower-27.messagelabs.com!1424098299!13727707!1 X-Originating-IP: [74.125.82.180] 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 13386 invoked from network); 16 Feb 2015 14:51:39 -0000 Received: from mail-we0-f180.google.com (HELO mail-we0-f180.google.com) (74.125.82.180) by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 16 Feb 2015 14:51:39 -0000 Received: by mail-we0-f180.google.com with SMTP id k11so29643144wes.11 for ; Mon, 16 Feb 2015 06:51:39 -0800 (PST) X-Received: by 10.194.63.206 with SMTP id i14mr51735234wjs.107.1424098299347; Mon, 16 Feb 2015 06:51:39 -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.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Feb 2015 06:51:38 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 16 Feb 2015 14:50:50 +0000 Message-Id: <1424098255-22490-11-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 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.215.47 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;