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: 56755 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1828152lbb; Tue, 17 Nov 2015 01:50:35 -0800 (PST) X-Received: by 10.140.217.138 with SMTP id n132mr40354206qhb.26.1447753835073; Tue, 17 Nov 2015 01:50:35 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [50.57.142.19]) by mx.google.com with ESMTPS id o73si29230044qkl.8.2015.11.17.01.50.34 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:50:35 -0800 (PST) Received-SPF: neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=50.57.142.19; Authentication-Results: mx.google.com; spf=neutral (google.com: 50.57.142.19 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZyctF-0000GW-1x; Tue, 17 Nov 2015 09:49:29 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZyctE-0000FC-12 for xen-devel@lists.xen.org; Tue, 17 Nov 2015 09:49:28 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id EC/F9-03819-728FA465; Tue, 17 Nov 2015 09:49:27 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-14.tower-206.messagelabs.com!1447753766!4244561!1 X-Originating-IP: [74.125.82.53] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.19.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15031 invoked from network); 17 Nov 2015 09:49:26 -0000 Received: from mail-wm0-f53.google.com (HELO mail-wm0-f53.google.com) (74.125.82.53) by server-14.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Nov 2015 09:49:26 -0000 Received: by wmvv187 with SMTP id v187so218016150wmv.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=THAv2f/Us9Gmm6JzTvEMP7NoxteEbRyEsxpDb6rzUa+IsUMjhdgWYkSS93KWraJW+C gncrjWJyLnB2CBVfS7p+E93JFlp13bM/oBe37TTxUcUg40ySxz/Yc7/wiPByTzS/keQp C1H4vH7RUUcDUU1gcySJ3ryjfy+SwkUQ226Rwyv6NsT2TzzLbIrn81wFKiaJWB01rZIR +2KcDm2JatQtHZo7KOeH4IDSCv4IDbq+ZZJ/+TmfG1oVWBtvD+O5ikHPUyXt95yHgIFo 1/iCPArKSpevYkQeZDHT/DAaOhrkTm0vAOfMT6mN6r0cHW+NTRSlSsqPKfgC74kQlxLH KkVw== X-Gm-Message-State: ALoCoQlP2RkiuDgryCiVhqByfwwunXGyf6PTEqU1I364U8vIOjnV47mVW7A6+v7pYCKXTYaTZanH 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 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> 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 Subject: [Xen-devel] [PATCH v3 58/62] xen/acpi: Fix event-channel interrupt when booting with ACPI X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion 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 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(-) -- 2.1.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel 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,