From patchwork Tue Nov 17 09:57:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 56779 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1831507lbb; Tue, 17 Nov 2015 01:59:07 -0800 (PST) X-Received: by 10.67.23.166 with SMTP id ib6mr37491914pad.82.1447754347103; Tue, 17 Nov 2015 01:59:07 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rf5si8652772pbc.205.2015.11.17.01.59.06; Tue, 17 Nov 2015 01:59:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753093AbbKQJ7G (ORCPT + 6 others); Tue, 17 Nov 2015 04:59:06 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35605 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751903AbbKQJ7C (ORCPT ); Tue, 17 Nov 2015 04:59:02 -0500 Received: by wmdw130 with SMTP id w130so147217158wmd.0 for ; Tue, 17 Nov 2015 01:59:01 -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=YcZMJWbhJcbB1wjO2UFxobhapiJIs2B6o79Fn8tw+uw=; b=v7xDZ1Sj642x4SF1RBc6plB6Y2cVRDWtiELcSwtSX77vTUUiBPkepTlaqAc54Ysu/G Niz2C8oZX0QHEaskdd/r2gjsyTAZda5bt0bmOvcGqFxdAZV3To4D97kYiWcLuMWxkLFC zmPqENwN027zzrQDFpAwnwIIXUNqYhsenS6jCTUFdMBTtsb0XQyRs4h8ctstqtGU94XL Ro0tBPR2xBA6qk1kE8MtfqLP0ZZSVJHmh1fb0Skfhh/YZbytIk+PEIPn4xGcf742Y55o T/arlx5SJyWM/1EbiICVzHRWyKmmUnBBWpEH97BAO+KoKl8K5qoQNe2GocJwHduspBqb No3w== 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=YcZMJWbhJcbB1wjO2UFxobhapiJIs2B6o79Fn8tw+uw=; b=ctzjdhmYmm4DUNlYUyXghA7F0Pzdzw+TWy7KvDJVHUtufvxsH0Lu4sBivMITmzvNM8 b/B1yNI3epvVqxXEqqsviETO9xlBG8JZ/q2f12idbfRfCHGsD2gc3SFFV0LeSx8MWAL2 /qMyhSMwAR54jVsg0oRnroHI/kpLibO574ViWjPrCWtU4+wxeUFtz6o4RZ3N1l6phb0j t2LTuWtDx3Jskl0Y8vJWIURZI4DjvFR2bfaDjCUwPNzI7xpS2ndUpv4e3Agam3Uyls9t wKK6uwa3c60ZCJBLbhvZ9pWWjHzKMAeETe/z9YGYfqBaAzAWRd15X5jqIl00hYafUnV5 nK7A== X-Gm-Message-State: ALoCoQn6KsVhhRAyzUscJlSKgDbT81eW8AxXptD3WAOZEHitebc0iS/058BhKYVZU3apunDDCAhs X-Received: by 10.28.143.1 with SMTP id r1mr1626260wmd.80.1447754340983; Tue, 17 Nov 2015 01:59:00 -0800 (PST) Received: from localhost ([78.129.251.54]) by smtp.gmail.com with ESMTPSA id z131sm23110978wme.7.2015.11.17.01.58.58 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Nov 2015 01:59:00 -0800 (PST) From: shannon.zhao@linaro.org To: ian.campbell@citrix.com, stefano.stabellini@citrix.com, catalin.marinas@arm.com, will.deacon@arm.com, julien.grall@citrix.com, ard.biesheuvel@linaro.org, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Cc: xen-devel@lists.xen.org, christoffer.dall@linaro.org, devicetree@vger.kernel.org, linux-efi@vger.kernel.org, peter.huangpeng@huawei.com, shannon.zhao@linaro.org, zhaoshenglong@huawei.com, hangaohuai@huawei.com Subject: [PATCH 12/13] arm/xen: Get event-channel irq through HVM_PARAM when booting with ACPI Date: Tue, 17 Nov 2015 17:57:10 +0800 Message-Id: <1447754231-7772-13-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1447754231-7772-1-git-send-email-shannon.zhao@linaro.org> References: <1447754231-7772-1-git-send-email-shannon.zhao@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Shannon Zhao When booting with ACPI, it could get the event-channel irq through HVM_PARAM_CALLBACK_IRQ. Signed-off-by: Shannon Zhao --- arch/arm/xen/enlighten.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 1373d6d..b8e9db8 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -190,10 +191,24 @@ static int __init xen_guest_init(void) if (!xen_domain()) return 0; - xen_events_irq = irq_of_parse_and_map(xen_node, 0); - if (!xen_events_irq) { - pr_err("Xen event channel interrupt not found\n"); - return -ENODEV; + if (!acpi_disabled) { + struct xen_hvm_param a; + + a.domid = DOMID_SELF; + a.index = HVM_PARAM_CALLBACK_IRQ; + if (HYPERVISOR_hvm_op(HVMOP_get_param, &a)) { + if ((a.value >> 56) != 3) { + pr_err("Can't get Xen event-channel irq\n"); + return -ENODEV; + } + } + xen_events_irq = a.value & 0xff; + } else { + xen_events_irq = irq_of_parse_and_map(xen_node, 0); + if (!xen_events_irq) { + pr_err("Xen event channel interrupt not found\n"); + return -ENODEV; + } } shared_info_page = (struct shared_info *)get_zeroed_page(GFP_KERNEL);