From patchwork Tue Feb 19 19:33:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmauss, Erik" X-Patchwork-Id: 10820627 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 CC20F14E1 for ; Tue, 19 Feb 2019 19:37:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB67D2CEF5 for ; Tue, 19 Feb 2019 19:37:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B034A2CF00; Tue, 19 Feb 2019 19:37:13 +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 463052CEF5 for ; Tue, 19 Feb 2019 19:37:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726473AbfBSThM (ORCPT ); Tue, 19 Feb 2019 14:37:12 -0500 Received: from mga02.intel.com ([134.134.136.20]:46449 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbfBSThM (ORCPT ); Tue, 19 Feb 2019 14:37:12 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2019 11:37:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,388,1544515200"; d="scan'208";a="125652028" Received: from bartok.jf.intel.com ([10.54.75.137]) by fmsmga008.fm.intel.com with ESMTP; 19 Feb 2019 11:37:11 -0800 From: Erik Schmauss To: rjw@rjwysocki.net, linux-acpi@vger.kernel.org Cc: Bob Moore , Erik Schmauss Subject: [PATCH v2 02/15] ACPICA: Interpreter: Emit warning for creation of a zero-length op region Date: Tue, 19 Feb 2019 11:33:32 -0800 Message-Id: <20190219193345.10227-3-erik.schmauss@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190219193345.10227-1-erik.schmauss@intel.com> References: <20190219193345.10227-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 ACPICA commit 387c850c5d49d09d7c2e70b2711e584ad83956a1 Nothing can be done with such a region. Just emit a warning so as not to abort a table load or running method. Link: https://github.com/acpica/acpica/commit/387c850c Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss --- drivers/acpi/acpica/dsopcode.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c index cab14713e591..10f32b62608e 100644 --- a/drivers/acpi/acpica/dsopcode.c +++ b/drivers/acpi/acpica/dsopcode.c @@ -356,6 +356,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, union acpi_operand_object *operand_desc; struct acpi_namespace_node *node; union acpi_parse_object *next_op; + acpi_adr_space_type space_id; ACPI_FUNCTION_TRACE_PTR(ds_eval_region_operands, op); @@ -368,6 +369,7 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, /* next_op points to the op that holds the space_ID */ next_op = op->common.value.arg; + space_id = (acpi_adr_space_type)next_op->common.value.integer; /* next_op points to address op */ @@ -403,6 +405,15 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state, obj_desc->region.length = (u32) operand_desc->integer.value; acpi_ut_remove_reference(operand_desc); + /* A zero-length operation region is unusable. Just warn */ + + if (!obj_desc->region.length + && (space_id < ACPI_NUM_PREDEFINED_REGIONS)) { + ACPI_WARNING((AE_INFO, + "Operation Region [%4.4s] has zero length (SpaceId %X)", + node->name.ascii, space_id)); + } + /* * Get the address and save it * (at top of stack - 1)