From patchwork Mon Jun 5 08:41:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lv Zheng X-Patchwork-Id: 9765861 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CEE0860364 for ; Mon, 5 Jun 2017 08:41:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDAEA2621D for ; Mon, 5 Jun 2017 08:41:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B291B27F85; Mon, 5 Jun 2017 08:41:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 542ED2621D for ; Mon, 5 Jun 2017 08:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751733AbdFEIlv (ORCPT ); Mon, 5 Jun 2017 04:41:51 -0400 Received: from mga14.intel.com ([192.55.52.115]:5896 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563AbdFEIlv (ORCPT ); Mon, 5 Jun 2017 04:41:51 -0400 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jun 2017 01:41:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,300,1493708400"; d="scan'208";a="110463694" Received: from lvzheng-moblsp3.sh.intel.com ([10.239.159.181]) by fmsmga005.fm.intel.com with ESMTP; 05 Jun 2017 01:41:43 -0700 From: Lv Zheng To: "Rafael J . Wysocki" , "Rafael J . Wysocki" , Len Brown Cc: Lv Zheng , Lv Zheng , linux-acpi@vger.kernel.org, Erik Schmauss , Bob Moore Subject: [PATCH 45/53] ACPICA: Disassembler: prevent external op's from opening a new scope Date: Mon, 5 Jun 2017 16:41:43 +0800 Message-Id: <53cf38a20fdde106b46165a7122de111600b2190.1496650343.git.lv.zheng@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Erik Schmauss ACPICA commit c512c2bfcce65b8e8f37d549ac2fa4a1e0182e46 Since Externals could be of ACPI_TYPE_METHOD, there is a possibility that the acpi_ns_lookup may cause a new scope to be opened. Therefore, disable opening the scope for all acpi_ns_lookup invocations that deal with externals. Link: https://github.com/acpica/acpica/commit/c512c2bf Signed-off-by: Erik Schmauss Signed-off-by: Bob Moore Signed-off-by: Lv Zheng --- drivers/acpi/acpica/dswload2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c index 8d510c7..ab5d318 100644 --- a/drivers/acpi/acpica/dswload2.c +++ b/drivers/acpi/acpica/dswload2.c @@ -310,6 +310,16 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, flags |= ACPI_NS_TEMPORARY; } } +#ifdef ACPI_ASL_COMPILER + + /* + * Do not open a scope. This could be an external method + * and open a scope. + */ + if (walk_state->opcode == AML_EXTERNAL_OP) { + flags |= ACPI_NS_DONT_OPEN_SCOPE; + } +#endif /* Add new entry or lookup existing entry */