Linux ACPI
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Ghannam, Yazen" <Yazen.Ghannam@amd.com>
Cc: "linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"tony.luck@intel.com" <tony.luck@intel.com>,
	"keescook@chromium.org" <keescook@chromium.org>
Subject: Re: [PATCH] ACPI / APEI: Fix parsing HEST that includes Deferred Machine Check subtable
Date: Mon, 14 Jan 2019 11:43:50 +0100	[thread overview]
Message-ID: <20190114104350.GH2773@zn.tnic> (raw)
In-Reply-To: <20181112190029.41760-1-Yazen.Ghannam@amd.com>

On Mon, Nov 12, 2018 at 07:00:55PM +0000, Ghannam, Yazen wrote:
> From: Yazen Ghannam <yazen.ghannam@amd.com>
> 
> 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 <yazen.ghannam@amd.com>
> ---
>  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_RESERVED] = {
>  	[ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
>  	[ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
>  	[ACPI_HEST_TYPE_GENERIC_ERROR_V2] = sizeof(struct acpi_hest_generic_v2),
> +	[ACPI_HEST_TYPE_IA32_DEFERRED_CHECK] = -1,
>  };
>  
>  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_hdr)
>  		mc = (struct acpi_hest_ia_machine_check *)hest_hdr;
>  		len = sizeof(*mc) + mc->num_hardware_banks *
>  			sizeof(struct acpi_hest_ia_error_bank);
> +	} else if (hest_type == ACPI_HEST_TYPE_IA32_DEFERRED_CHECK) {
> +		struct acpi_hest_ia_deferred_check *mc;
> +		mc = (struct acpi_hest_ia_deferred_check *)hest_hdr;
> +		len = sizeof(*mc) + mc->num_hardware_banks *
> +			sizeof(struct acpi_hest_ia_error_bank);
>  	}
>  	BUG_ON(len == -1);
>  
> -- 

Reviewed-by: Borislav Petkov <bp@suse.de>

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

  reply	other threads:[~2019-01-14 10:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 19:00 [PATCH] ACPI / APEI: Fix parsing HEST that includes Deferred Machine Check subtable Ghannam, Yazen
2019-01-14 10:43 ` Borislav Petkov [this message]
2019-01-15 18:44   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190114104350.GH2773@zn.tnic \
    --to=bp@alien8.de \
    --cc=Yazen.Ghannam@amd.com \
    --cc=keescook@chromium.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox