From patchwork Tue Nov 17 09:40:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 7635061 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CE13CBF90C for ; Tue, 17 Nov 2015 10:12:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1AB4204D6 for ; Tue, 17 Nov 2015 10:12:25 +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 2246620411 for ; Tue, 17 Nov 2015 10:12:25 +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 1ZydD6-0003F3-JQ; Tue, 17 Nov 2015 10:10:00 +0000 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyctX-0004NG-VL for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 09:50:05 +0000 Received: by wmww144 with SMTP id w144so145786398wmw.1 for ; Tue, 17 Nov 2015 01:49:26 -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=vA3Yjb5ow/HyXjbpNSftNkwafGKlUYo9Z3r2RYdiZCw=; b=SU77aaZSq58UMV1ZOy5XmQ94EVqQSWOY+4FPRZHwbLZDvtqfSXDV0akD7du/5r92Pc p07ACYfgMcszoyzeuK5dsi3O7cK566siqsYK12GGBsxcor5bYimahOvdtdiBlC5gJ0Zn bYR9IX5AzXyq17zbuSClO+suRfa9f3H+n5OMwVIvLZJeJYES5pyKDbtd9vKNyZ1KaAKW bVRBw0Sp8zpa5RNLAKIm2ow5P9zKaHbgZ93xR7/YSKSccmIsgaKnuh1w3NXJ4UZwGpfp 87UFWhy2vpSzJg9hmvpHslBxLwgRlq2ttuylplLmyBHmaoNw0Ium7zTDC/EEvWysuQTY 9XuA== 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=vA3Yjb5ow/HyXjbpNSftNkwafGKlUYo9Z3r2RYdiZCw=; b=f0LvwbnrHKrBq3oQFGFiyI70dSBW7dpNwIFaWR+wCDOUzKoM79ONzAlAMcqwp2JnRy OTxRcm3LSkFUmWrTB3Zh31PLf+iUh6Q7nqgXOBJtdDiXP77xBUxJJKgcfrlslf8Wtf3k 80Z7VGm4oV4hR7N4Xk5AeHuEAra6yJPS+/Owt5DDlwrQP+meCdp0N83WSiffd8SQW6eh sNcHR2T5OD4H8+1VZI3WsaiMTW5AdjX7/TjgAcJJN1Erip0U1PI4uuBt0qlUKo3+EzFy nG4zTfVXPUSXD0gOWnIDi3ITSGuvx9zFMJMoL0vOwyy5Fh1aniBBrGpLaDwVTGvrO1x6 8eWA== X-Gm-Message-State: ALoCoQmhjCjT5Upw7JtZD/cJ/BpKlm4i/K58eJVsUYHHcuGMpylpxTSly9jb8hXw+lm5hjhqdFj/ X-Received: by 10.28.30.3 with SMTP id e3mr1537237wme.78.1447753766450; Tue, 17 Nov 2015 01:49:26 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id cv3sm37649775wjc.20.2015.11.17.01.49.24 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:49:25 -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 58/62] xen/acpi: Fix event-channel interrupt when booting with ACPI Date: Tue, 17 Nov 2015 17:40:57 +0800 Message-Id: <1447753261-7552-59-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_014948_692618_67B21749 X-CRM114-Status: GOOD ( 13.79 ) 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=unavailable 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: Shannon Zhao When booting with ACPI, store the event-channel interrupt number and flag in HVM parameter HVM_PARAM_CALLBACK_IRQ. Then Dom0 could get it through hypercall HVMOP_get_param. Signed-off-by: Shannon Zhao --- xen/arch/arm/domain_build.c | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 9532807..36917be 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -2067,23 +2067,34 @@ static void evtchn_fixup(struct domain *d, struct kernel_info *kinfo) printk("Allocating PPI %u for event channel interrupt\n", d->arch.evtchn_irq); - /* Fix up "interrupts" in /hypervisor node */ - node = fdt_path_offset(kinfo->fdt, "/hypervisor"); - if ( node < 0 ) - panic("Cannot find the /hypervisor node"); - - /* Interrupt event channel upcall: - * - Active-low level-sensitive - * - All CPUs - * - * TODO: Handle properly the cpumask - */ - set_interrupt_ppi(intr, d->arch.evtchn_irq, 0xf, - DT_IRQ_TYPE_LEVEL_LOW); - res = fdt_setprop_inplace(kinfo->fdt, node, "interrupts", - &intr, sizeof(intr)); - if ( res ) - panic("Cannot fix up \"interrupts\" property of the hypervisor node"); + if ( acpi_disabled ) + { + /* Fix up "interrupts" in /hypervisor node */ + node = fdt_path_offset(kinfo->fdt, "/hypervisor"); + if ( node < 0 ) + panic("Cannot find the /hypervisor node"); + + /* Interrupt event channel upcall: + * - Active-low level-sensitive + * - All CPUs + * + * TODO: Handle properly the cpumask + */ + set_interrupt_ppi(intr, d->arch.evtchn_irq, 0xf, + DT_IRQ_TYPE_LEVEL_LOW); + res = fdt_setprop_inplace(kinfo->fdt, node, "interrupts", + &intr, sizeof(intr)); + if ( res ) + panic("Cannot fix up \"interrupts\" property of the hypervisor node"); + } + else + { + int type = 3; + int flag = 2; /* Active-low level-sensitive */ + d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ] = (u64)type << 56 + | flag << 8 + | d->arch.evtchn_irq; + } } static void __init find_gnttab_region(struct domain *d,