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: 8661751 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 12E909F36E for ; Thu, 24 Mar 2016 14:50:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45BE22017D for ; Thu, 24 Mar 2016 14:50:18 +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 64B7A201FE for ; Thu, 24 Mar 2016 14:50:14 +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 1aj6YM-0003VJ-UX; Thu, 24 Mar 2016 14:48:02 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aj6YK-0003TW-V2 for xen-devel@lists.xen.org; Thu, 24 Mar 2016 14:48:01 +0000 Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id 85/0B-03301-02EF3F65; Thu, 24 Mar 2016 14:48:00 +0000 X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-11.tower-27.messagelabs.com!1458830878!25037535!1 X-Originating-IP: [209.85.220.42] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2382 invoked from network); 24 Mar 2016 14:47:59 -0000 Received: from mail-pa0-f42.google.com (HELO mail-pa0-f42.google.com) (209.85.220.42) by server-11.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 24 Mar 2016 14:47:59 -0000 Received: by mail-pa0-f42.google.com with SMTP id td3so23737773pab.2 for ; Thu, 24 Mar 2016 07:47:59 -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=L9+wxjvElU4kRiutKrvTcsl8XbnGWCXKhb33CiEya2v5gtFmTL6eCtuX6kjEc/vtNg NtsCw5DtzdESQJEs7u8Yi5737tDJIe5KzRnUcpSasrOfGO3ECgvTFVs/CrRgvUKPn63A uBxevQQwKhd3OOtrEY+lkNrNIFBw1wldU5J34wzWJYvPtQnWCgXmpyxnZKd9bnmu4KKJ b4447cD0eJ9slUxjfErBkZ4+KAY4acd1hqQI6W/9zezNJQ2dWrINTSlI+Jh5c8YirqwF VvqUE/xHwiN1TI14pn3SammdfXbzhCCEnkLOvRzdN68TxA3s7A9p0pU251aDvSTPG3UB RP7w== X-Gm-Message-State: AD7BkJJzSlt5txk3KX9K6k8CS/mx+naNHF+3/83aPI2s2N6h8iWw0k6eD39QZRuUdi1RoleB 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 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> 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 Subject: [Xen-devel] [PATCH v7 12/17] ARM64: ACPI: Check if it runs on Xen to enable or disable 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 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 ||