From patchwork Fri Apr 1 15:49:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 8726191 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3393FC0553 for ; Fri, 1 Apr 2016 15:53:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FFB120145 for ; Fri, 1 Apr 2016 15:53:40 +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 62285203DC for ; Fri, 1 Apr 2016 15:53:39 +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 1am1M3-00054z-CN; Fri, 01 Apr 2016 15:51:23 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1am1M1-00052y-V3 for xen-devel@lists.xen.org; Fri, 01 Apr 2016 15:51:22 +0000 Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id 35/DE-03645-9F89EF65; Fri, 01 Apr 2016 15:51:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNIsWRWlGSWpSXmKPExsVyMfSOvu6PGf/ CDDa1qlks+biYxYHR4+ju30wBjFGsmXlJ+RUJrBnb+texFnTyVDTf/cHewPiEs4uRi0NIYCKj xOE571hAHBaBecwSy2+/BnI4OSQE+lklVs6EsmMktnzvZYWwyyWOP/sMFhcSUJNYdnghM8SkJ 4wSe55cYwRJsAnoSLyYtJOti5GDQ0TAQ2LPx1qQGmaBZUwS8zZNYgSJCwtESkw4xg1SziKgKn FjwRc2EJsXqHz+45/sELvkJM4f/8kMYnMCxSf/ewW1113i4axZ7BMYBRYwMqxi1ChOLSpLLdI 1NNJLKspMzyjJTczM0TU0NNHLTS0uTkxPzUlMKtZLzs/dxAgMLAYg2MF4dprzIUZJDiYlUV7D af/ChPiS8lMqMxKLM+KLSnNSiw8xynBwKEnwPpkOlBMsSk1PrUjLzAGGOExagoNHSYS3FiTNW 1yQmFucmQ6ROsVoybHl97W1TBxbFtwAktum3lvLJMSSl5+XKiXOexCkQQCkIaM0D24cLA4vMc pKCfMyAh0oxFOQWpSbWYIq/4pRnINRSZj3FcgUnsy8Eritr4AOYgI6qEMa7KCSRISUVAMj75Y o544brGYe62qeJmkUFZ99p2JzSDD+BMuvPQcZZhRMNkr25qu8lbV1Pd+dGo38EpmkPS/8rPfL nQufuqDw4lHGaI9rzpxNE35d+JWnxXej6rNK3OGdAgx+Xl2bromoXt0joWssX/2AffPWt+YK6 1ie8Bco+pnFLfqs9HbCjurAR1vdFKqVWIozEg21mIuKEwENIQvQvgIAAA== X-Env-Sender: shannon.zhao@linaro.org X-Msg-Ref: server-15.tower-27.messagelabs.com!1459525879!35086850!1 X-Originating-IP: [209.85.220.47] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23898 invoked from network); 1 Apr 2016 15:51:20 -0000 Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by server-15.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 1 Apr 2016 15:51:20 -0000 Received: by mail-pa0-f47.google.com with SMTP id td3so93497427pab.2 for ; Fri, 01 Apr 2016 08:51:20 -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=pBJayU8Ld1xjdP1tj71NmVKrPPyHd0jFVv1ewUKL9wA=; b=TLXsjMxlSrL3Gf/9omEF1IHRKLKuu5UVFs0YaQXv7UGn2r9jO0eWVmBbVTQ7gYDfUA db5xm0i6cn83qSpV5tSwjfnDTX2SqlkySExeIEjzIBvhxr5HohN8bgHTz7rGhNRTaOAL /x/d0fi+6pfdmVe62W81BDAW7aQCogo8YL3Q4= 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=pBJayU8Ld1xjdP1tj71NmVKrPPyHd0jFVv1ewUKL9wA=; b=GDfuJeZpxnVXWUA587SEHTwy+mOMv7jJUpvf7htGyIAnL6v0OcDe4BNllIcjpmhRKH UbqDFDHQqpcXuh35HhRYwBw8HA+uefGhQJ7VrDAFXHYL/joS6XJ3EnaWMiln+pcGFBPF 2leCB3VPdiY89EFtvt3b1qR00C98JWKML5mYi5oYBOxn6HsdmYO28kJr5OXymq+0HXaD SOfNRL9OlQgFHQGlv5erZ1E3oYwOaUsnFvKnpFCGPcA4H+Yzfg0p2AIn5DfcFZ1Z5gPm v+MArxQQUHsxCrEEhRSXIp1KxahYz7zCWy1cBvjpU4F6xlA4+4ql4DC8Ejs0wUrvsriP KWhQ== X-Gm-Message-State: AD7BkJIeap2OAK36J4K09PMtIwvIQvyEruHYTorf8C/V4eryHxuPUdOg8nKVQBPtsrdHRqbH X-Received: by 10.66.63.98 with SMTP id f2mr4274417pas.123.1459525878600; Fri, 01 Apr 2016 08:51:18 -0700 (PDT) Received: from localhost.localdomain ([167.160.116.218]) by smtp.gmail.com with ESMTPSA id yj1sm22536791pac.16.2016.04.01.08.51.11 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 01 Apr 2016 08:51:17 -0700 (PDT) From: Shannon Zhao To: linux-arm-kernel@lists.infradead.org, stefano.stabellini@citrix.com Date: Fri, 1 Apr 2016 23:49:10 +0800 Message-Id: <1459525755-36968-13-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459525755-36968-1-git-send-email-shannon.zhao@linaro.org> References: <1459525755-36968-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, david.vrabel@citrix.com, zhaoshenglong@huawei.com, xen-devel@lists.xen.org, shannon.zhao@linaro.org Subject: [Xen-devel] [PATCH v10 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 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c index d1ce8e2..57ee317 100644 --- a/arch/arm64/kernel/acpi.c +++ b/arch/arm64/kernel/acpi.c @@ -67,10 +67,15 @@ 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 with compatible + * string "xen,xen". */ - if (depth == 1 && (strcmp(uname, "chosen") != 0)) - return 1; + if (depth == 1 && (strcmp(uname, "chosen") != 0)) { + if (strcmp(uname, "hypervisor") != 0 || + !of_flat_dt_is_compatible(node, "xen,xen")) + return 1; + } + return 0; } @@ -184,7 +189,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 ||