From patchwork Fri Nov 21 14:31:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 41323 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 50D6A244B0 for ; Fri, 21 Nov 2014 14:34:22 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id y19sf3049959wgg.7 for ; Fri, 21 Nov 2014 06:34:19 -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 :mime-version:cc:subject:precedence:list-id:list-unsubscribe :list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=P8X/BXAx5h4nia083zVOiSY/bA5tYN2R7gOYGbI1+c4=; b=YYQbakT7ePcX2h1qYCsq7J1X2Rh3RySp8Xr1rqJA1tuM5PUBvSGJNyyx+VLFp3cImM CGDy/ejCTA4rAGf6Y9EferceB5JqHpOjvs2gaF866GKd19syjfEagrdb7oL2yFwS/zFz Us+py/dM05FxsxEHdhjlKZlAIRq3I/VpXXj3+LcGVoM/rOKv+wosB8Rwr5Bqr5KyHet7 rs0f/K2EwdZLo/V8WxRbFCVVaSxyTCLCYmRGwI5Zuu32ZVeKfu2RhB2avkRpfs8fTBzG 5JHj3qiLd5cGy8UedfnL+X7A4pMRW03w0ilWuEi8QH126Axak0GcOpJHeNuJND+TccHq 1uXw== X-Gm-Message-State: ALoCoQns3cmQzkf0t77vKCWtlnxVePW1FOiEbN51gmh/nzSS468Bb2IIJ/MjFj6frlwXz/1r3BtJ X-Received: by 10.152.6.4 with SMTP id w4mr1651377law.7.1416580459564; Fri, 21 Nov 2014 06:34:19 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.193 with SMTP id l1ls223489laa.79.gmail; Fri, 21 Nov 2014 06:34:19 -0800 (PST) X-Received: by 10.153.11.133 with SMTP id ei5mr5044578lad.75.1416580459205; Fri, 21 Nov 2014 06:34:19 -0800 (PST) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id 9si5721606lai.28.2014.11.21.06.34.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Nov 2014 06:34:17 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id mc6so4358804lab.10 for ; Fri, 21 Nov 2014 06:34:17 -0800 (PST) X-Received: by 10.153.7.170 with SMTP id dd10mr5093332lad.44.1416580457075; Fri, 21 Nov 2014 06:34:17 -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.184.201 with SMTP id ew9csp101466lbc; Fri, 21 Nov 2014 06:34:16 -0800 (PST) X-Received: by 10.52.167.234 with SMTP id zr10mr4042663vdb.64.1416580455744; Fri, 21 Nov 2014 06:34:15 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id gv2si2464710vdc.43.2014.11.21.06.34.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Nov 2014 06:34:15 -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 1XrpFc-0003Vr-O1; Fri, 21 Nov 2014 14:31:56 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XrpFa-0003Vm-Kz for xen-devel@lists.xensource.com; Fri, 21 Nov 2014 14:31:54 +0000 Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id B2/51-22777-9DC4F645; Fri, 21 Nov 2014 14:31:53 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-8.tower-206.messagelabs.com!1416580311!12673256!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.12.4; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20992 invoked from network); 21 Nov 2014 14:31:52 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 21 Nov 2014 14:31:52 -0000 X-IronPort-AV: E=Sophos;i="5.07,431,1413244800"; d="scan'208";a="193722603" Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.3.181.6; Fri, 21 Nov 2014 09:31:32 -0500 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1XrpFE-0004WM-EL; Fri, 21 Nov 2014 14:31:32 +0000 From: Stefano Stabellini To: Date: Fri, 21 Nov 2014 14:31:30 +0000 Message-ID: <1416580290-4615-1-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-DLP: MIA1 Cc: stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH v3 for-4.5] xen/arm: clear UIE on hypervisor entry 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: , 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: stefano.stabellini@eu.citrix.com 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.51 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: UIE being set can cause maintenance interrupts to occur when Xen writes to one or more LR registers. The effect is a busy loop around the interrupt handler in Xen (http://marc.info/?l=xen-devel&m=141597517132682): everything gets stuck. Signed-off-by: Stefano Stabellini Acked-by: Ian Campbell Reported-and-Tested-by: Andrii Tseglytskyi Tested-by: Julien Grall Release-acked-by: Konrad Rzeszutek Wilk --- xen/arch/arm/gic.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 70d10d6..e7a1af5 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -403,6 +403,8 @@ void gic_clear_lrs(struct vcpu *v) if ( is_idle_vcpu(v) ) return; + gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 0); + spin_lock_irqsave(&v->arch.vgic.lock, flags); while ((i = find_next_bit((const unsigned long *) &this_cpu(lr_mask), @@ -527,8 +529,6 @@ void gic_inject(void) if ( !list_empty(¤t->arch.vgic.lr_pending) && lr_all_full() ) gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 1); - else - gic_hw_ops->update_hcr_status(GICH_HCR_UIE, 0); } static void do_sgi(struct cpu_user_regs *regs, enum gic_sgi sgi) @@ -598,6 +598,11 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r * Receiving the interrupt is going to cause gic_inject to be called * on return to guest that is going to clear the old LRs and inject * new interrupts. + * + * Do not add code here: maintenance interrupts caused by setting + * GICH_HCR_UIE, might read as spurious interrupts (1023) because + * GICH_HCR_UIE is cleared before reading GICC_IAR. As a consequence + * this handler is not called. */ }