Skip to content

Commit

Permalink
ACPI / extlog: Check for RDMSR failure
Browse files Browse the repository at this point in the history
commit 7cecb47 upstream.

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: All applicable <stable@vger.kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
bwhacks authored and gregkh committed Nov 5, 2020
1 parent 5e25b44 commit 9578d73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/acpi/acpi_extlog.c
Expand Up @@ -223,9 +223,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;

if (edac_get_report_status() == EDAC_REPORTING_FORCE) {
Expand Down

0 comments on commit 9578d73

Please sign in to comment.