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: 8671811 Return-Path: X-Original-To: patchwork-xen-devel@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 7E3DE9F36E for ; Fri, 25 Mar 2016 13:52:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0759201E4 for ; Fri, 25 Mar 2016 13:52:52 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3EA0200E7 for ; Fri, 25 Mar 2016 13:52:51 +0000 (UTC) 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" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, 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 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 )