From patchwork Thu Jan 29 18:25:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 43958 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5A59224134 for ; Thu, 29 Jan 2015 18:28:01 +0000 (UTC) Received: by mail-lb0-f200.google.com with SMTP id u10sf22955277lbd.3 for ; Thu, 29 Jan 2015 10:28:00 -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=JraIuqefZ2yHFYK61Nk2ZH/+cF7lvg4L3zseqFS82Ashd0jtKkjLRassv9HjImbEi5 c35KzD9uAEYqiG1Tz5iEbMZZqwXVxWby+vMCw4TH55OtSnkwOAM8iZPAMMx1LXqTGld0 FGfTpRv8gXRgHjzaRgMJnyGnIJXsvgPnSJRd0+IpQDc045C5+qzmUpk6BVlM1cFPxNWQ 71KzRbb5U122zRAVQnuiL33BDQeEHgcAWNkL2PoZ1UA3v6Y53pd+HZa+TCs4jChFODtZ PKBqV0LhAdPCTjJwt3Li5WvbSJy1My5JdmUbnu/4DQpLfctP6Xe/pimKTJUmXc50yOvK cQ8w== X-Gm-Message-State: ALoCoQlZEOJH302nfmENUruLU/WHdgvqo9PYEVnyGsDhCwaSj0HTWxL0w5iO74ZBAEYFDejjF7pT X-Received: by 10.152.5.98 with SMTP id r2mr306376lar.6.1422556080293; Thu, 29 Jan 2015 10:28:00 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.97 with SMTP id z1ls342107laz.35.gmail; Thu, 29 Jan 2015 10:28:00 -0800 (PST) X-Received: by 10.152.22.129 with SMTP id d1mr2673010laf.22.1422556079988; Thu, 29 Jan 2015 10:27:59 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id c7si2052479lae.46.2015.01.29.10.27.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 10:27:59 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id p9so31292770lbv.4 for ; Thu, 29 Jan 2015 10:27:59 -0800 (PST) X-Received: by 10.112.98.99 with SMTP id eh3mr2601984lbb.32.1422556079813; Thu, 29 Jan 2015 10:27:59 -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 h5csp34177lbj; Thu, 29 Jan 2015 10:27:59 -0800 (PST) X-Received: by 10.194.8.2 with SMTP id n2mr3807389wja.46.1422556077973; Thu, 29 Jan 2015 10:27:57 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id gl1si4633965wib.61.2015.01.29.10.27.56 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Jan 2015 10:27:57 -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 1YGtnu-0004pD-KC; Thu, 29 Jan 2015 18:26:58 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YGtnr-0004j0-RR for xen-devel@lists.xenproject.org; Thu, 29 Jan 2015 18:26:55 +0000 Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id 51/78-03168-F6B7AC45; Thu, 29 Jan 2015 18:26:55 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-13.tower-27.messagelabs.com!1422556014!12411161!1 X-Originating-IP: [209.85.212.172] 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 9368 invoked from network); 29 Jan 2015 18:26:54 -0000 Received: from mail-wi0-f172.google.com (HELO mail-wi0-f172.google.com) (209.85.212.172) by server-13.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 29 Jan 2015 18:26:54 -0000 Received: by mail-wi0-f172.google.com with SMTP id h11so30032561wiw.5 for ; Thu, 29 Jan 2015 10:26:54 -0800 (PST) X-Received: by 10.180.210.234 with SMTP id mx10mr2467762wic.37.1422556014021; Thu, 29 Jan 2015 10:26:54 -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.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 10:26:53 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Thu, 29 Jan 2015 18:25:47 +0000 Message-Id: <1422555950-31821-13-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 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.217.173 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 */