From patchwork Thu Dec 13 20:30:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmauss, Erik" X-Patchwork-Id: 10729881 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-2.web.codeaurora.org (Postfix) with ESMTP id 43E3D91E for ; Thu, 13 Dec 2018 20:36:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 367D228F4A for ; Thu, 13 Dec 2018 20:36:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3502B28F5A; Thu, 13 Dec 2018 20:36:09 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 D9AD129D73 for ; Thu, 13 Dec 2018 20:36:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727647AbeLMUgI (ORCPT ); Thu, 13 Dec 2018 15:36:08 -0500 Received: from mga18.intel.com ([134.134.136.126]:49812 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726813AbeLMUgH (ORCPT ); Thu, 13 Dec 2018 15:36:07 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Dec 2018 12:36:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,349,1539673200"; d="scan'208";a="301988700" Received: from bartok.jf.intel.com ([10.54.75.137]) by fmsmga006.fm.intel.com with ESMTP; 13 Dec 2018 12:36:06 -0800 From: Erik Schmauss To: rjw@rjwysocki.net, linux-acpi@vger.kernel.org Cc: Bob Moore , Erik Schmauss Subject: [PATCH 05/10] ACPICA: Expressions in package elements are not supported Date: Thu, 13 Dec 2018 12:30:30 -0800 Message-Id: <20181213203035.12387-6-erik.schmauss@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181213203035.12387-1-erik.schmauss@intel.com> References: <20181213203035.12387-1-erik.schmauss@intel.com> 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: Bob Moore Return AE_SUPPORT if encountered, fixes a previous fault if encountered. Note: Other ACPI implementations do not support this type of construct. Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss --- drivers/acpi/acpica/dspkginit.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/acpi/acpica/dspkginit.c b/drivers/acpi/acpica/dspkginit.c index d703a5594a02..584853385268 100644 --- a/drivers/acpi/acpica/dspkginit.c +++ b/drivers/acpi/acpica/dspkginit.c @@ -152,6 +152,32 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state, */ for (i = 0; arg && (i < element_count); i++) { if (arg->common.aml_opcode == AML_INT_RETURN_VALUE_OP) { + if (!arg->common.node) { + /* + * This is the case where an expression has returned a value. + * The use of expressions (term_args) within individual + * package elements is not supported by the AML interpreter, + * even though the ASL grammar supports it. Example: + * + * Name (INT1, 0x1234) + * + * Name (PKG3, Package () { + * Add (INT1, 0xAAAA0000) + * }) + * + * 1) No known AML interpreter supports this type of construct + * 2) This fixes a fault if the construct is encountered + */ + ACPI_EXCEPTION((AE_INFO, AE_SUPPORT, + "Expressions within package elements are not supported")); + + /* Cleanup the return object, it is not needed */ + + acpi_ut_remove_reference(walk_state->results-> + results.obj_desc[0]); + return_ACPI_STATUS(AE_SUPPORT); + } + if (arg->common.node->type == ACPI_TYPE_METHOD) { /* * A method reference "looks" to the parser to be a method