From patchwork Fri Mar 25 13:48:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 64484 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp183718lbc; Fri, 25 Mar 2016 06:51:50 -0700 (PDT) X-Received: by 10.194.189.231 with SMTP id gl7mr15169880wjc.162.1458913909146; Fri, 25 Mar 2016 06:51:49 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id pi3si14457493wjb.134.2016.03.25.06.51.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Mar 2016 06:51:49 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=neutral (google.com: 192.237.175.120 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 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajS8S-0002OT-Gm; Fri, 25 Mar 2016 13:50:44 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ajS8R-0002NL-IU for xen-devel@lists.xen.org; Fri, 25 Mar 2016 13:50:43 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id 3E/35-07120-23245F65; Fri, 25 Mar 2016 13:50:42 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-6.tower-21.messagelabs.com!1458913841!5873165!1 X-Originating-IP: [209.85.192.170] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 65272 invoked from network); 25 Mar 2016 13:50:42 -0000 Received: from mail-pf0-f170.google.com (HELO mail-pf0-f170.google.com) (209.85.192.170) by server-6.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 25 Mar 2016 13:50:42 -0000 Received: by mail-pf0-f170.google.com with SMTP id n5so83058168pfn.2 for ; Fri, 25 Mar 2016 06:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ruBQmuoO11cma2sqLKsPlnOZPzS955Asb3CjJ7OgZug=; b=adL1mCgBYG9rUAtpE9UCHNoaoTaR7EBM1UcvWm/ZOmaGoZMcC18o9q9NyFVqSSbEb3 +LDuHejdDmkfEI3B4lLRZ0dEtz3MEve1ghcDswBDx9TrA0EQHCDcwRK0VZHrG4Vvxsaj 2jVa6yaOkC4xen+Zj/RCg89dLg7W9JS+TmGEA= 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=ruBQmuoO11cma2sqLKsPlnOZPzS955Asb3CjJ7OgZug=; b=M+uW5ywsFFRAPq00BckU8Wb+Bj9PZgbPjls91JxSDbY0InDYMS0TwvkFHEXxSbhTvy GIn23xrooBAcEYvtMSBpG1vcgR7GgJ7Ynbly0BZf48vhXyo+AwJUerAaXMx48Y2jGU+W qfatJkwrYe4q2/a6klqYTnjQNK4auKzHjcX73zEusPp2KLIb9HYCwi8jOg4mj1gTjTfD u53YkhgSasqk/RLse125avKesL85prMci92N1/akbkdMBd0obKJ5kb3WGyrwA3i8l/07 X2f2C8wDI0XknCQna3MZZIzT1BXS57II65zJF9OjUK8/A37zAEAap+wBwTBHkM2SKN0r p1Gg== X-Gm-Message-State: AD7BkJI2DGjmkWbC2ctOwdT9h2anvfE4utNt057KkhQY4KqGFCS0EfiixL52E+9rEodlI9pT X-Received: by 10.98.70.197 with SMTP id o66mr21261473pfi.84.1458913840715; Fri, 25 Mar 2016 06:50:40 -0700 (PDT) Received: from localhost.localdomain ([45.56.152.2]) by smtp.gmail.com with ESMTPSA id w20sm16744178pfi.31.2016.03.25.06.50.36 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Mar 2016 06:50:39 -0700 (PDT) From: Shannon Zhao To: xen-devel@lists.xen.org Date: Fri, 25 Mar 2016 21:48:53 +0800 Message-Id: <1458913735-2678-21-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458913735-2678-1-git-send-email-shannon.zhao@linaro.org> References: <1458913735-2678-1-git-send-email-shannon.zhao@linaro.org> Cc: julien.grall@arm.com, shannon.zhao@linaro.org, stefano.stabellini@citrix.com, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com Subject: [Xen-devel] [PATCH v7 20/22] xen/acpi: Fix event-channel interrupt when booting with ACPI X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" 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 Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- xen/arch/arm/domain_build.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index f004d92..d9bc3de 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -2047,6 +2047,7 @@ static void initrd_load(struct kernel_info *kinfo) static void evtchn_fixup(struct domain *d, struct kernel_info *kinfo) { int res, node; + u64 val; gic_interrupt_t intr; /* @@ -2062,6 +2063,19 @@ static void evtchn_fixup(struct domain *d, struct kernel_info *kinfo) printk("Allocating PPI %u for event channel interrupt\n", d->arch.evtchn_irq); + /* Set the value of domain param HVM_PARAM_CALLBACK_IRQ */ + val = (u64)HVM_PARAM_CALLBACK_TYPE_PPI << 56; + val |= (2 << 8); /* Active-low level-sensitive */ + val |= d->arch.evtchn_irq & 0xff; + d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ] = val; + + /* + * When booting Dom0 using ACPI, Dom0 can only get the event channel + * interrupt via hypercall. + */ + if ( !acpi_disabled ) + return; + /* Fix up "interrupts" in /hypervisor node */ node = fdt_path_offset(kinfo->fdt, "/hypervisor"); if ( node < 0 )