From patchwork Tue Nov 17 09:40:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 7635081 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A811D9F1D3 for ; Tue, 17 Nov 2015 10:13:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B9B84204D6 for ; Tue, 17 Nov 2015 10:13:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DEAA920411 for ; Tue, 17 Nov 2015 10:13:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZydE7-0005Yx-A5; Tue, 17 Nov 2015 10:11:03 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyctk-0004g7-VP for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 09:50:10 +0000 Received: by wmdw130 with SMTP id w130so146884198wmd.0 for ; Tue, 17 Nov 2015 01:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BbFCwJtQPrIllPiKtGT+Ze0o3ARxqvoHB/k2zXoBE2Q=; b=Z86tOsNQHsMLa3bKYhgjGqt2/QUq2zU3y3MhUmx3K3pF4E+Q3Cx6ZPjOoULM3zbGt+ dm/JZfS8/qVFZA/jMT7YVjF7Cw3spi1QX//DUG+9poYmKgElo826PKjAzhiNJ+Ha95EV bWvvm3pASq/OsRBN+3V33m/YNVQQJ0bBAF/IV0fXq+J05nu7OMWEUOFQfgjks2XNIE/J iau55ijc+bBrN/JB8ynPn5I/IFVm3MDqPny3wBahLdi0Sp0QGY2FiubwQA8aTbggWIMI 9cX9rvd+cXKz6UiIZbyyRIQJvVVRaiQMSX2400xnEHJbtK6VB0YmmTpH5rBWvhuc3XWG wgxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BbFCwJtQPrIllPiKtGT+Ze0o3ARxqvoHB/k2zXoBE2Q=; b=LciM3najPFRWUi92j6SXdGLKO1j3MENDBxuo73VxLUsOx1/Cm5jpDBfYAnFoF6wZge hn2CuIMvLjTd476AhEt4G1L4onoRwy8IpxYOWAn1yAlW0HJpMOMCIOuN4AfelIZCG6i7 VKVtciZB5prw29CTRwhyV7p5foYVkLFDABgCuE6C0hBL+TpXX3rSrn0HbPpjCJ2TuWEg fsBMFZkP94r0MUv5P82G4PTBS3iykL+EaFtmYBEePM20vMgIU3vE6EN8zKCfmXAbQkZy K0CO7EVlIfF/bf6r7Sv/g4mG1e+rg2XZVUg3nzx0MrZ2JBpx2Jp+MpXE4ibHTDbprVCW hD8A== X-Gm-Message-State: ALoCoQnri5PX6XsLhNBAbDSDM2jKPdhoctVoFlHiU/ZMD0G6+qV3ow/l0P0G6/R9DSmVAVlSXjBr X-Received: by 10.28.18.9 with SMTP id 9mr1452227wms.96.1447753781677; Tue, 17 Nov 2015 01:49:41 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id s189sm23049761wmf.16.2015.11.17.01.49.39 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:49:41 -0800 (PST) From: shannon.zhao@linaro.org To: ian.campbell@citrix.com, stefano.stabellini@citrix.com, keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, julien.grall@citrix.com, xen-devel@lists.xen.org Subject: [PATCH v3 60/62] arm/acpi: Configure interrupts dynamically Date: Tue, 17 Nov 2015 17:40:59 +0800 Message-Id: <1447753261-7552-61-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> References: <1447753261-7552-1-git-send-email-shannon.zhao@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_015001_886876_2AF960F4 X-CRM114-Status: GOOD ( 11.34 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, hangaohuai@huawei.com, ard.biesheuvel@linaro.org, shannon.zhao@linaro.org, christoffer.dall@linaro.org, peter.huangpeng@huawei.com, david.vrabel@citrix.com, zhaoshenglong@huawei.com, linux-arm-kernel@lists.infradead.org, roger.pau@citrix.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Parth Dixit Interrupt information is described in DSDT and is not available at the time of booting. Configure the interrupts dynamically when requested by Dom0 Signed-off-by: Parth Dixit Signed-off-by: Shannon Zhao --- xen/arch/arm/vgic.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c index 7bb4570..d05abde 100644 --- a/xen/arch/arm/vgic.c +++ b/xen/arch/arm/vgic.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -310,6 +311,8 @@ void vgic_disable_irqs(struct vcpu *v, uint32_t r, int n) } } +#define VGIC_ICFG_MASK(intr) ( 1 << ( ( 2 * ( intr % 16 ) ) + 1 ) ) + void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n) { struct domain *d = v->domain; @@ -321,7 +324,23 @@ void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n) struct vcpu *v_target; while ( (i = find_next_bit(&mask, 32, i)) < 32 ) { +#ifdef CONFIG_ACPI + struct vgic_irq_rank *vr = vgic_get_rank(v, n); + uint32_t tr; + irq = i + (32 * n); + if( ( !acpi_disabled ) && ( n != 0 ) && is_hardware_domain(d) ) + { + tr = vr->icfg[i >> 4] ; + + if( ( tr & VGIC_ICFG_MASK(i) ) ) + irq_set_type(irq, ACPI_IRQ_TYPE_EDGE_BOTH); + else + irq_set_type(irq, ACPI_IRQ_TYPE_LEVEL_MASK); + } +#else + irq = i + (32 * n); +#endif v_target = d->arch.vgic.handler->get_target_vcpu(v, irq); p = irq_to_pending(v_target, irq); set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);