From patchwork Mon Feb 16 14:50:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 44705 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AFE9721544 for ; Mon, 16 Feb 2015 14:52:22 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id y19sf19610889wgg.1 for ; Mon, 16 Feb 2015 06:52:22 -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=1jn1OQ7SBI4dKTPQbk0GQyOn2V8NSxFEFOvjlFfqQ3c=; b=VYHpucxHsObxg494DPHKh01f9/KnPwymdxeVY+IasyidXRRnMMEjj8Oo1Ywwpskfiy tINc/DaEssFg57S5gWfTqaz/9/oOfy2hf5eW6nZc8CPHRZy0k4MQv0LRl7F8VumW1+OM puIgmJrD0j8oZrL+1pqJDkhiLcAGMrGMKxXyKbWyQtUaYfggimYc9LA5PSREw5i9sNGK p96hNFPueohZIiVScZ/ob8wrNgMTTfbWjHPW+oBkgZaOiPYTI3zbcCyCxz97hB51I4PJ Vh5XyQ2OCoJymF1BaeOlHBKgKvU/p6hCJ+yyewhO0KPJ8uS8cHa3jN3ijciSU03ZmWMN 67vg== X-Gm-Message-State: ALoCoQl/EXZ6Y+wGjr4o8Le7yrXoaCE9c3j66b94h97u2H11id4svB2Q7liCuRkqhBl31Ev8iZ7w X-Received: by 10.180.101.101 with SMTP id ff5mr2781207wib.5.1424098342026; Mon, 16 Feb 2015 06:52:22 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.6 with SMTP id i6ls574646lam.10.gmail; Mon, 16 Feb 2015 06:52:21 -0800 (PST) X-Received: by 10.152.22.39 with SMTP id a7mr22689334laf.119.1424098341866; Mon, 16 Feb 2015 06:52:21 -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 p6si9808720lap.37.2015.02.16.06.52.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 06:52:21 -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 labgm9 with SMTP id gm9so29375252lab.2 for ; Mon, 16 Feb 2015 06:52:21 -0800 (PST) X-Received: by 10.112.188.165 with SMTP id gb5mr6722696lbc.35.1424098341730; Mon, 16 Feb 2015 06:52:21 -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 h5csp1629219lbj; Mon, 16 Feb 2015 06:52:21 -0800 (PST) X-Received: by 10.140.202.144 with SMTP id x138mr880549qha.14.1424098340333; Mon, 16 Feb 2015 06:52:20 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id j1si14285843qco.32.2015.02.16.06.52.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 16 Feb 2015 06:52:20 -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 1YNN1c-0001xG-5g; Mon, 16 Feb 2015 14:51:52 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YNN1Z-0001tL-Rr for xen-devel@lists.xenproject.org; Mon, 16 Feb 2015 14:51:50 +0000 Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id 24/A9-03004-50402E45; Mon, 16 Feb 2015 14:51:49 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-2.tower-21.messagelabs.com!1424098303!4152638!1 X-Originating-IP: [74.125.82.179] 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 27425 invoked from network); 16 Feb 2015 14:51:48 -0000 Received: from mail-we0-f179.google.com (HELO mail-we0-f179.google.com) (74.125.82.179) by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 16 Feb 2015 14:51:48 -0000 Received: by mail-we0-f179.google.com with SMTP id u56so29615764wes.10 for ; Mon, 16 Feb 2015 06:51:43 -0800 (PST) X-Received: by 10.180.221.73 with SMTP id qc9mr37901841wic.8.1424098302177; Mon, 16 Feb 2015 06:51:42 -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.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Feb 2015 06:51:41 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 16 Feb 2015 14:50:52 +0000 Message-Id: <1424098255-22490-13-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 12/15] xen/arm: vgic-v2: Take the lock when writing into GICD_CTLR 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: This register is shared between every vCPUs and the lock was already taken for read. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- This patch should be backported to Xen 4.4 and Xen 4.5. Although, it won't apply directly for Xen 4.4. Changes in v2: - Add Ian's ack --- xen/arch/arm/vgic-v2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c index 6530ecc..e7cdf9e 100644 --- a/xen/arch/arm/vgic-v2.c +++ b/xen/arch/arm/vgic-v2.c @@ -281,7 +281,10 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info) case GICD_CTLR: if ( dabt.size != DABT_WORD ) goto bad_width; /* Ignore all but the enable bit */ + vgic_lock(v); v->domain->arch.vgic.ctlr = (*r) & GICD_CTL_ENABLE; + vgic_unlock(v); + return 1; /* R/O -- write ignored */