From patchwork Tue Nov 3 20:34:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 317192 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 72D8FC388F7 for ; Tue, 3 Nov 2020 20:45:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 355352242A for ; Tue, 3 Nov 2020 20:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436339; bh=d3CuJi4DX4CEbIJEOeVUaWWVfcTcqAn8gtBCReOXWx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zFvS1BQ4m6aUcoumfNcIT4BKOJL7E/CvAtzRQXLIfXF0C3GUYV0UwFWXuoMGXyABO IJ7izVtHfVbKCEWSuxHOUF1cIkG2mErTmKmWbL8+5J7g84GTzq2ljjA6PsoE7XDhyS bn+frcwxWUqQ4FWWhhbk9Wf4BrKZa/MmONJpLwnM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731057AbgKCUpi (ORCPT ); Tue, 3 Nov 2020 15:45:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:34050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731050AbgKCUph (ORCPT ); Tue, 3 Nov 2020 15:45:37 -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 9AD2422409; Tue, 3 Nov 2020 20:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604436337; bh=d3CuJi4DX4CEbIJEOeVUaWWVfcTcqAn8gtBCReOXWx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JuOEZDidKLmPB0itjKreCC6/E5nSnuiAYg6SL3nr0CfckD5nvIoOKKdnKY5/P/p6A zEjRpwBWxymTsjmBbYr6H5GphBRC6rN+1/KZwHmjXDcYvAOSiQK8NFb52ThpOls0vC YVYB7uVa5esrOS5pBD5fg34F/XMZKelRqqV+1PCs= 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 5.9 206/391] ACPI / extlog: Check for RDMSR failure Date: Tue, 3 Nov 2020 21:34:17 +0100 Message-Id: <20201103203400.798812397@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203348.153465465@linuxfoundation.org> References: <20201103203348.153465465@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 @@ -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;