Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3516759pxb; Mon, 1 Mar 2021 12:03:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJylYQrINDVX4BgeXA4gAxUG7Q0FTJkSYteUQS2roi5uHAb6kygFdS41G/nYzMYi/d9Bm6bP X-Received: by 2002:aa7:da97:: with SMTP id q23mr11097202eds.180.1614628994964; Mon, 01 Mar 2021 12:03:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614628994; cv=none; d=google.com; s=arc-20160816; b=cUg4efrUG0viu8v4Q3wO6pYdJg/eKDkEbJXgHCTPUbA+JKcFy1hEApZx4ECvfX7/a6 d2UmhQnDYON1q29ltMIBVzjI8MfjM+wVKAkdez2XsZYqW4qyuy24ATE7x3q1hNl6eP+x p4pVqq5NWg7e38lpSWRDp5r5Zh6n+SrsgVlYDyN/Asnwv9g2NtLe4sNzMEKZ+fFZ9lKL lWVNcQeQQepg2GoCMUbDK3zYryV2QhJPX30kyjkULENZr1VRHf7QyCwUCh85WQ3/O1vQ oLP06mdGVmJZKFh4vC8q8y8FVqKAsNTJ65evQFQ88lfw9XpENOeXiByq4Cd9kbtduKr4 e/ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VJ/z7vF2OCoMGnrpxlHMx0IM7UrTLpUAeuCt6y3+Yq0=; b=jPyGSFqXrdoa1OC5APWStBXNmU7cwh7xF1IqL3b33zfTZcAqCZqaEfAaxpn47tEceg QT0NLXU9UGrHh8w4569nD03qaPkJgg5w1rIrlS9YOA7aIYqJfxKDKg/kM3lK/BeWUvgh GsgMLcukcysKKf4x0Ov/yjAXxBUiiKXQGl1Pp2oDRSpbrJvy6pK647lmwBcus0E/DhIn 3wZzBqZVlUp9Rs0sbmM/KtPMtTxt1Q+jJ9rJoUVuo/nDz5JaFw/7+vJV03AP4Kjm6G5A S3WmcnRNiKHbccXEhwMIMjyIDgHPRPWDRx5IzWDk3/5p1O5ch/m4At3G4VDK6D7mD/8q OdDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zm83aXTC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b2si12135461ejk.68.2021.03.01.12.02.50; Mon, 01 Mar 2021 12:03:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Zm83aXTC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242405AbhCAUBY (ORCPT + 99 others); Mon, 1 Mar 2021 15:01:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:55908 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236693AbhCAQ6i (ORCPT ); Mon, 1 Mar 2021 11:58:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id ADF1E64F5C; Mon, 1 Mar 2021 16:37:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616629; bh=2h0OcArB9tb8B+/3X01jDalkr89GWiNq9+KbgvNopkM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zm83aXTCetP2ZvBPJPHymnkQ2veyRmOuHF/3V06hxHWEqNBKwG7eZ+YB8/G1Av3+U nj6nupFmN9V/IKGcUi9WJpvqz+cujBcc5IbfchnNadZ2V+ipakijVGF3Z1ExstIO5p LbyNpmRfaTaEq0f99msGv0EvY3wTQ0zv/zkAwMSo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maximilian Luz , Bob Moore , Erik Kaneda , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.19 041/247] ACPICA: Fix exception code class checks Date: Mon, 1 Mar 2021 17:11:01 +0100 Message-Id: <20210301161033.687197314@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maximilian Luz [ Upstream commit 3dfaea3811f8b6a89a347e8da9ab862cdf3e30fe ] ACPICA commit 1a3a549286ea9db07d7ec700e7a70dd8bcc4354e The macros to classify different AML exception codes are broken. For instance, ACPI_ENV_EXCEPTION(Status) will always evaluate to zero due to #define AE_CODE_ENVIRONMENTAL 0x0000 #define ACPI_ENV_EXCEPTION(Status) (Status & AE_CODE_ENVIRONMENTAL) Similarly, ACPI_AML_EXCEPTION(Status) will evaluate to a non-zero value for error codes of type AE_CODE_PROGRAMMER, AE_CODE_ACPI_TABLES, as well as AE_CODE_AML, and not just AE_CODE_AML as the name suggests. This commit fixes those checks. Fixes: d46b6537f0ce ("ACPICA: AML Parser: ignore all exceptions resulting from incorrect AML during table load") Link: https://github.com/acpica/acpica/commit/1a3a5492 Signed-off-by: Maximilian Luz Signed-off-by: Bob Moore Signed-off-by: Erik Kaneda Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- include/acpi/acexcep.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 856c56ef01431..878b8e26c6c50 100644 --- a/include/acpi/acexcep.h +++ b/include/acpi/acexcep.h @@ -59,11 +59,11 @@ struct acpi_exception_info { #define AE_OK (acpi_status) 0x0000 -#define ACPI_ENV_EXCEPTION(status) (status & AE_CODE_ENVIRONMENTAL) -#define ACPI_AML_EXCEPTION(status) (status & AE_CODE_AML) -#define ACPI_PROG_EXCEPTION(status) (status & AE_CODE_PROGRAMMER) -#define ACPI_TABLE_EXCEPTION(status) (status & AE_CODE_ACPI_TABLES) -#define ACPI_CNTL_EXCEPTION(status) (status & AE_CODE_CONTROL) +#define ACPI_ENV_EXCEPTION(status) (((status) & AE_CODE_MASK) == AE_CODE_ENVIRONMENTAL) +#define ACPI_AML_EXCEPTION(status) (((status) & AE_CODE_MASK) == AE_CODE_AML) +#define ACPI_PROG_EXCEPTION(status) (((status) & AE_CODE_MASK) == AE_CODE_PROGRAMMER) +#define ACPI_TABLE_EXCEPTION(status) (((status) & AE_CODE_MASK) == AE_CODE_ACPI_TABLES) +#define ACPI_CNTL_EXCEPTION(status) (((status) & AE_CODE_MASK) == AE_CODE_CONTROL) /* * Environmental exceptions -- 2.27.0