From: Ben Hutchings Date: Sun, 27 Sep 2020 21:50:42 +0000 (+0100) Subject: ACPI / extlog: Check for RDMSR failure X-Git-Tag: archive/raspbian/5.9.6-1+rpi1^2^2~37 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3fdea48fadc6811442ac659b93cb6724ed7807df;p=linux.git ACPI / extlog: Check for RDMSR failure Origin: https://git.kernel.org/linus/7cecb47f55e00282f972a1e0b09136c8cd938221 Bug-Debian: https://bugs.debian.org/971058 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 Signed-off-by: Ben Hutchings Signed-off-by: Rafael J. Wysocki Gbp-Pq: Topic bugfix/x86 Gbp-Pq: Name ACPI-extlog-Check-for-RDMSR-failure.patch --- diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index f138e12b7b8..72f1fb77abc 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;