Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4438827imu; Mon, 12 Nov 2018 11:01:42 -0800 (PST) X-Google-Smtp-Source: AJdET5cJHghawLwzoYXSnuKI/GN9AedgBqt1ZTY3kGjADma/gkc11n6OgdW7UAE1EwkWBMHkTniB X-Received: by 2002:a17:902:8ec1:: with SMTP id x1-v6mr2028189plo.130.1542049302051; Mon, 12 Nov 2018 11:01:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542049302; cv=none; d=google.com; s=arc-20160816; b=WVCBLrzEAz8hR+wIAiRcO4xY7Wl0PTte6m3lVmFh74cWNV/kWby+Gu3Gopljmg5g4U oLY6HJEpi1eiobUyxlujv3+Jb7CQYId4l2FC9Da0rDUu2FXzcVBUiM4oPaq0w9OCSzjb m1qaDRR+O4aiK+Tv7bc1I9gqhE5gcNGy+cCBs4EieEU3AIUV7WBvSrd8/u1XqGOolIvv 9Zr+cN+DiFpy/DF4j8NIVYiP026sytIHr3sBjSXCZo3T38xzkBPd6X+amrtN+Iwt/HiI vmHalmhPuz8As8+O6yLKufG/JnogdIxTldolsBAzZVPZjW23tCBWmvefGjHFGjqOFMIU VPtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :cc:to:from:dkim-signature; bh=z2blqNxG8NWWGhF/0yT4b8jxtN5MPiLtj9Ch7bZlfEc=; b=ExiDMKfySBFBPvEfzkg+r3OzvSehY51Qkd42kgPiIkZVs6dfimJ1dwQV+QE+4UVN8z HQSpF+rRfS0eJcAjYet0PhtQlbwLStGfYXRlprZjH+Z6X5w+iEEFyrJqoXoojTaNhHPC MX33JeksOflnBkFdX0lySPhkF2W4KG3hUSVvaD90wkV91HastgUVbT+RVag64owwQbvH 4p1LDQwlg00vMQW1rzhhAq/0wp0cLN5Ni7Xx/uf+PtxrSWLUgiBM1fod3oLsO0xwQjQJ xaZhkLN43PlpyBCVvIAt5MtKo3ZSv8eBTqSPc9QMR1CpCScETnQZZcfcTygTKWHMnzxF UqTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=VXOqFAbl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o24-v6si15890634pgv.242.2018.11.12.11.01.23; Mon, 12 Nov 2018 11:01:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=VXOqFAbl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729553AbeKMEzb (ORCPT + 99 others); Mon, 12 Nov 2018 23:55:31 -0500 Received: from mail-eopbgr710062.outbound.protection.outlook.com ([40.107.71.62]:9225 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727712AbeKMEzb (ORCPT ); Mon, 12 Nov 2018 23:55:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z2blqNxG8NWWGhF/0yT4b8jxtN5MPiLtj9Ch7bZlfEc=; b=VXOqFAblXZ/HETgluxJIDQuZkIXiKAbBPgJTNoukc1haOvyrTf1dicV/0ABgFO4+wl+tQVt1RYJICrBym1eg7wdc7WZsPiOSIDpy/qXbTyZQbyJbJoz041QoM8/8Dy176ikQ+7yMkK3VF23M/J+pifBuyu7i1AX6gHYhV+uPErA= Received: from BN7PR12MB2593.namprd12.prod.outlook.com (20.176.176.31) by BN7PR12MB2689.namprd12.prod.outlook.com (20.176.176.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.27; Mon, 12 Nov 2018 19:00:55 +0000 Received: from BN7PR12MB2593.namprd12.prod.outlook.com ([fe80::7d9e:3828:c095:b801]) by BN7PR12MB2593.namprd12.prod.outlook.com ([fe80::7d9e:3828:c095:b801%3]) with mapi id 15.20.1294.045; Mon, 12 Nov 2018 19:00:55 +0000 From: "Ghannam, Yazen" To: "linux-acpi@vger.kernel.org" CC: "linux-kernel@vger.kernel.org" , "rjw@rjwysocki.net" , "lenb@kernel.org" , "tony.luck@intel.com" , "bp@alien8.de" , "keescook@chromium.org" , "Ghannam, Yazen" Subject: [PATCH] ACPI / APEI: Fix parsing HEST that includes Deferred Machine Check subtable Thread-Topic: [PATCH] ACPI / APEI: Fix parsing HEST that includes Deferred Machine Check subtable Thread-Index: AQHUeroKfApkIX1/+0ussSwAR+oKPQ== Date: Mon, 12 Nov 2018 19:00:55 +0000 Message-ID: <20181112190029.41760-1-Yazen.Ghannam@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN4PR0201CA0012.namprd02.prod.outlook.com (2603:10b6:803:2b::22) To BN7PR12MB2593.namprd12.prod.outlook.com (2603:10b6:408:28::31) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Yazen.Ghannam@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.78.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BN7PR12MB2689;20:VHC/2pEXGLg540RTLTG++bVCdCSbHUBQNzU8i//0Jnaw3sM3DPIeBepR5V/jRrDhhIhxTeil2AsYE3FbouYoq4mCzsAISOUmiaE06B9A57vtq0CAA3fgKrzPRZYO8Lri1FnfwERz25vivytb1RYoy3Vzu7HAzWDC8a+RlR7rGEfZ5pxWRGjnzJnZxeJlDOsGZ5LTmHW/V+9HpLR86nMoRP4YgnC34aFX/XD43oW1U2GTSIQ2eBjroRw4BerfNnGR x-ms-office365-filtering-correlation-id: 5c2e709c-596b-45d9-ff71-08d648d12cac x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390040)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BN7PR12MB2689; x-ms-traffictypediagnostic: BN7PR12MB2689: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(823302103)(93006095)(93001095)(3231402)(944501410)(52105112)(10201501046)(3002001)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:BN7PR12MB2689;BCL:0;PCL:0;RULEID:;SRVR:BN7PR12MB2689; x-forefront-prvs: 0854128AF0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(136003)(39860400002)(346002)(366004)(396003)(189003)(199004)(81166006)(81156014)(8676002)(2501003)(486006)(86362001)(7736002)(575784001)(305945005)(476003)(8936002)(36756003)(97736004)(2616005)(99286004)(256004)(1076002)(105586002)(6506007)(6916009)(386003)(2900100001)(14444005)(106356001)(6116002)(26005)(5660300001)(102836004)(3846002)(71190400001)(71200400001)(6486002)(6436002)(25786009)(72206003)(14454004)(478600001)(6512007)(5640700003)(53936002)(4326008)(2906002)(186003)(1857600001)(52116002)(316002)(68736007)(54906003)(2351001)(66066001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR12MB2689;H:BN7PR12MB2593.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 8SjXIFXD8QuVuB0TEAZmsSTVPrrzZFHKy56Y2zZsbI+mqBs28uGQGKHiNo1gTJmgA+owDInrs1rSG5UkoasBLalwJ9fNRtWb6J/uc8cS5qQ3u3jcdn86dNDZKb71J9bwqIsqM45n8FNaEb1Wo2GMCDGzqL2Xis0nPqFxNRRUpzg57NDyGRP68CXGxm+Mw/Apu77E8wLyDXQRVcV7asw4xyWzYzLH/rsaJzOk7Jrv4THaiwq1UAJHw30Nbv5BdrAaOrbNYOqEpgX0BqhDuK26J0YQpgC9oxRJO0aPSo//3XpsM7xoQl8BGFH3SpG/AXyf6+kX8orIDOYjJIBgrV1L5+5QU5oOcIRqqL876P2ES7M= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c2e709c-596b-45d9-ff71-08d648d12cac X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Nov 2018 19:00:55.7841 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2689 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yazen Ghannam ACPI 6.2 includes a new definition for a Deferred Machine Check "DMC" subtable. The definition of this subtable was included in following commit: c042933df2b1 ("ACPICA: Add support for new HEST subtable") However, the HEST parsing function was not updated to include this new subtable. Therefore, Linux will fail to parse the HEST on systems that include a DMC entry. Add the length check for the new DMC subtable so that HEST parsing doesn't fail on systems that include it. Signed-off-by: Yazen Ghannam --- drivers/acpi/apei/hest.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c index b1e9f81ebeea..0935a0ef37e5 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c @@ -53,6 +53,7 @@ static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVE= D] =3D { [ACPI_HEST_TYPE_AER_BRIDGE] =3D sizeof(struct acpi_hest_aer_bridge), [ACPI_HEST_TYPE_GENERIC_ERROR] =3D sizeof(struct acpi_hest_generic), [ACPI_HEST_TYPE_GENERIC_ERROR_V2] =3D sizeof(struct acpi_hest_generic_v2)= , + [ACPI_HEST_TYPE_IA32_DEFERRED_CHECK] =3D -1, }; =20 static int hest_esrc_len(struct acpi_hest_header *hest_hdr) @@ -75,6 +76,11 @@ static int hest_esrc_len(struct acpi_hest_header *hest_h= dr) mc =3D (struct acpi_hest_ia_machine_check *)hest_hdr; len =3D sizeof(*mc) + mc->num_hardware_banks * sizeof(struct acpi_hest_ia_error_bank); + } else if (hest_type =3D=3D ACPI_HEST_TYPE_IA32_DEFERRED_CHECK) { + struct acpi_hest_ia_deferred_check *mc; + mc =3D (struct acpi_hest_ia_deferred_check *)hest_hdr; + len =3D sizeof(*mc) + mc->num_hardware_banks * + sizeof(struct acpi_hest_ia_error_bank); } BUG_ON(len =3D=3D -1); =20 --=20 2.17.1