Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #68308

Bug#971058: [PATCH] ACPI / extlog: Check for RDMSR failure

From "Rafael J. Wysocki" <rafael@kernel.org>
Newsgroups linux.debian.bugs.dist, linux.debian.kernel
Subject Bug#971058: [PATCH] ACPI / extlog: Check for RDMSR failure
Date 2020-10-02 19:10 +0200
Message-ID <AVwJc-5QI-5@gated-at.bofh.it> (permalink)
References <ATMS6-6Nb-11@gated-at.bofh.it> <ATsTo-3eW-1@gated-at.bofh.it> <ATMS6-6Nb-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


On Mon, Sep 28, 2020 at 12:27 AM Ben Hutchings <ben@decadent.org.uk> wrote:
>
> extlog_init() uses rdmsrl() to read an MSR, which on older CPUs
> provokes a error message at boot:
>
>     unchecked MSR access error: RDMSR from 0x179 at rIP: 0xcd047307 (native_read_msr+0x7/0x40)
>
> Use rdmsrl_safe() instead, and return -ENODEV if it fails.
>
> Reported-by: jim@photojim.ca
> References: https://bugs.debian.org/971058
> Cc: stable@vger.kernel.org
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
>  drivers/acpi/acpi_extlog.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
> index f138e12b7b82..72f1fb77abcd 100644
> --- a/drivers/acpi/acpi_extlog.c
> +++ b/drivers/acpi/acpi_extlog.c
> @@ -222,9 +222,9 @@ static int __init extlog_init(void)
>         u64 cap;
>         int rc;
>
> -       rdmsrl(MSR_IA32_MCG_CAP, cap);
> -
> -       if (!(cap & MCG_ELOG_P) || !extlog_get_l1addr())
> +       if (rdmsrl_safe(MSR_IA32_MCG_CAP, &cap) ||
> +           !(cap & MCG_ELOG_P) ||
> +           !extlog_get_l1addr())
>                 return -ENODEV;
>
>         rc = -EINVAL;

Applied as 5.10 material, thanks!

Back to linux.debian.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Bug#971058: [PATCH] ACPI / extlog: Check for RDMSR failure Ben Hutchings <ben@decadent.org.uk> - 2020-09-28 00:00 +0200
  Bug#971058: [PATCH] ACPI / extlog: Check for RDMSR failure "Rafael J. Wysocki" <rafael@kernel.org> - 2020-10-02 19:10 +0200

csiph-web