From patchwork Thu Mar 24 14:44:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8661891 Return-Path: X-Original-To: patchwork-linux-arm@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 D7CA59F36E for ; Thu, 24 Mar 2016 14:52:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 073ED2017D for ; Thu, 24 Mar 2016 14:52:08 +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 2F429203B5 for ; Thu, 24 Mar 2016 14:52:06 +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 1aj6ae-0000wz-DF; Thu, 24 Mar 2016 14:50:24 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aj6Yc-0006yI-OS for linux-arm-kernel@lists.infradead.org; Thu, 24 Mar 2016 14:48:21 +0000 Received: by mail-pa0-x232.google.com with SMTP id tt10so24009217pab.3 for ; Thu, 24 Mar 2016 07:47:58 -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=lX1+wpZyWUpcRkrkLFXM9Im7UQffEy29m3908BxOtZE=; b=CixW/7tchmCHAumlULy4NxLZwXMI33Ygzxc4iN6R20MoL/1RsfFxQPZgvNzR4VvW3l URQatHvUheafiivDzLwuL4iEZ3MymIT6qULVWxA2toY/1BX+P9Lg9psC5Spdx/xngWAP KE7y2cs0dbz3MELwoUlkU76S0/1SOSlybq7D4= 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=lX1+wpZyWUpcRkrkLFXM9Im7UQffEy29m3908BxOtZE=; b=jKNUHusfW1kE97rPrOXEbmYGoakj/CA/9MDgoUmWGaqob5tNpbJ3oryc9GunQN4167 QAX0ILpDgvfz3O+wmX8F/CVmrDKNqFbpMQ/63RCprywhIbN0i5Ys04s5bO8ND/B/8eqN 7D9SQDDJGqkaqFc1qGJmPe3FahgNDbbX4MN5OgiMyw5lJOPYh9EuQdJ+4gVYW4oX0JlU t/sYn7PAXJVI6sCeOBGN6ClqhSCg7rZFksxlwstHY5Ec6bRxYVI+X5DxIqNnelObHAWR hoVIJ82fWhE0Qi+LT9uVPtUyDRnB/kw6LrqnHSxZ43fkIPpye3Tv3PjvH5OmEru5yuWd mg7Q== X-Gm-Message-State: AD7BkJI+oUv5RL+UKWiv2lTRvC3tsz75cvQEKF92cPFA41rXWRnK6idIT/AMhEOvg0C8zrm5 X-Received: by 10.66.248.168 with SMTP id yn8mr13373673pac.24.1458830877837; Thu, 24 Mar 2016 07:47:57 -0700 (PDT) Received: from localhost.localdomain ([104.238.45.135]) by smtp.gmail.com with ESMTPSA id lq10sm10780673pab.36.2016.03.24.07.47.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2016 07:47:56 -0700 (PDT) From: Shannon Zhao To: linux-arm-kernel@lists.infradead.org, stefano.stabellini@citrix.com, david.vrabel@citrix.com Subject: [PATCH v7 12/17] ARM64: ACPI: Check if it runs on Xen to enable or disable ACPI Date: Thu, 24 Mar 2016 22:44:31 +0800 Message-Id: <1458830676-27075-13-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458830676-27075-1-git-send-email-shannon.zhao@linaro.org> References: <1458830676-27075-1-git-send-email-shannon.zhao@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160324_074819_041561_0E10F900 X-CRM114-Status: GOOD ( 14.08 ) X-Spam-Score: -2.7 (--) 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: devicetree@vger.kernel.org, linux-efi@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, peter.huangpeng@huawei.com, julien.grall@arm.com, shannon.zhao@linaro.org, zhaoshenglong@huawei.com, xen-devel@lists.xen.org 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 When it's a Xen domain0 booting with ACPI, it will supply a /chosen and a /hypervisor node in DT. So check if it needs to enable ACPI. Signed-off-by: Shannon Zhao Reviewed-by: Stefano Stabellini Acked-by: Hanjun Guo --- arch/arm64/kernel/acpi.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index d1ce8e2..4e92be0 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -67,10 +67,13 @@ static int __init dt_scan_depth1_nodes(unsigned long node, { /* * Return 1 as soon as we encounter a node at depth 1 that is - * not the /chosen node. + * not the /chosen node, or /hypervisor node when running on Xen. */ - if (depth == 1 && (strcmp(uname, "chosen") != 0)) - return 1; + if (depth == 1 && (strcmp(uname, "chosen") != 0)) { + if (!xen_initial_domain() || (strcmp(uname, "hypervisor") != 0)) + return 1; + } + return 0; } @@ -184,7 +187,8 @@ void __init acpi_boot_table_init(void) /* * Enable ACPI instead of device tree unless * - ACPI has been disabled explicitly (acpi=off), or - * - the device tree is not empty (it has more than just a /chosen node) + * - the device tree is not empty (it has more than just a /chosen node, + * and a /hypervisor node when running on Xen) * and ACPI has not been force enabled (acpi=force) */ if (param_acpi_off ||