From patchwork Mon Nov 9 12:54:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 322603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8329C2D0A3 for ; Mon, 9 Nov 2020 13:39:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69B73206B2 for ; Mon, 9 Nov 2020 13:39:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604929154; bh=EO39JHmwbidWafUliPC9EV1rvv8YHW5Upw6Y2l7PU9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=JUubMFMgsZpdd/Yli69PL7GDHM073xVdK0OvAKrMd0OgzLcZn32gp79QeQAuxuEGl ce67hEPmC2LyO7e4KXYs5n43a+0n6wM5MKJ9SrX8aCc0p0SDYq69+0KNjZeNrl2xBG Dw/p/Ea19ScrwT46QLWUPcnMCBWpDxDEiX84yFKY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731940AbgKINjN (ORCPT ); Mon, 9 Nov 2020 08:39:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:56188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730689AbgKINDl (ORCPT ); Mon, 9 Nov 2020 08:03:41 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 56626216C4; Mon, 9 Nov 2020 13:03:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927014; bh=EO39JHmwbidWafUliPC9EV1rvv8YHW5Upw6Y2l7PU9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WZNLKYc+eGa809qeNrjYSHgWaVfJq3emGSuO+ln7cNF3VDUKD303o4RuR+T47wVC+ wcOZVOj3qcNzUNejBs1udcINNUF3hnlFvI6JjeEdCTSAfDiRxg6Uptxma4P+Lz5UcS YT0eoryN3NtUOD/5VYtHF4qtuV7hoTsP5iZxaZAU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, jim@photojim.ca, Ben Hutchings , "Rafael J. Wysocki" Subject: [PATCH 4.9 051/117] ACPI / extlog: Check for RDMSR failure Date: Mon, 9 Nov 2020 13:54:37 +0100 Message-Id: <20201109125028.092400503@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ben Hutchings commit 7cecb47f55e00282f972a1e0b09136c8cd938221 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 Cc: All applicable Signed-off-by: Ben Hutchings Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpi_extlog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -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 (get_edac_report_status() == EDAC_REPORTING_FORCE) {