Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp825621pxb; Tue, 3 Nov 2020 13:37:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1fYEkjrFCiR/s8bxqw2NjlL4AxZTspbxopv76XdVa08NgBnC4gq9QW7K1k14QHKTiBbq1 X-Received: by 2002:a17:907:2166:: with SMTP id rl6mr10435865ejb.61.1604439452838; Tue, 03 Nov 2020 13:37:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439452; cv=none; d=google.com; s=arc-20160816; b=ehFPx2ABv0P7oQ1Ma8ooY3TX9DIiIILmZy0J2vXP1hJ9JUbGVbhTg/Qh3z/WOz3rq9 edAzS44t8R9wGq0NGQBxX4sI1ZbZZtZD56XYokp7hgm2V6NNNoYe8Vw3VZ+XGBTIPh8t xn2YLbAiF8zeISAuQyyikU3ASER2EtuYrkXrHPeSsnTkbKDOFJ2iDU/5Rfdbv6AaynBs S4x+yLVM25k42AbytN6fiyimY1vAHbb+p5sYOpgGcaXZc3OWSWn/yFiIe26PoqLVVNGz 86VHVlDhxX8hIu7RisdniZ7JfNLx1GoSqfB3eCnDfsR9f5/K/kKYNvAG5c6nBBMBUoVh pyGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LPsy7R6kCPkrsOkd+YvZqhqCVvKdWcDBs9GdRFSN/us=; b=mtSCXy5nttqNJ9AMMJm/0I9+sE61mXf5LvtR63CM/PXOb4OYiwPmqMDGhAwTft81h3 UpFkoiqCn0uSqqyTCczc8GE5qImKTD5+B7zLMmEqlAtqgWrLcFJJFeqtq5Oni/V+W1zc bwXM0YOfDfG5+u4uTHtorTPzTGbRpQ7hV8Dwz6m2XUt4RKAwAq3VfTprF5tecwA+Cs+U hdxzZ0JlZ/u7VHp6wQR6MkYsCAJMlIqFwQy8DOQZ8mXzWR+3ojch9PO3qNSHsoku1vYE faU+8OljJdqioNLjw50FUS+ZZlJVJFxweZPJSujaGKL+ql+PsR4eXMKoUiJb472K2FFI THuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dKdZHO9L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si13781593edy.584.2020.11.03.13.37.09; Tue, 03 Nov 2020 13:37:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dKdZHO9L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732408AbgKCVch (ORCPT + 99 others); Tue, 3 Nov 2020 16:32:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:59190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730485AbgKCU5D (ORCPT ); Tue, 3 Nov 2020 15:57:03 -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 8E9792053B; Tue, 3 Nov 2020 20:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437023; bh=y8+reyxENSxJN4FG/fsfU7IltPLih2us9w8dvQNvq3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dKdZHO9Le/uAg4pkiUR35OoV0mFk+arTW2PETgPUHpaY6wozRukzmstzM+XqFNLgG 5A6Y0BHBprV/x0zk06ztpg+7CuoO8ADmxP2ipHTULcQxtfp2gnPlDZO2O+jcnRhvw3 0U4vWC2G0x8iprGkPFBeAit8HjMkoR9BJrDNBNgo= 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.4 111/214] ACPI / extlog: Check for RDMSR failure Date: Tue, 3 Nov 2020 21:35:59 +0100 Message-Id: <20201103203301.312485753@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 (edac_get_report_status() == EDAC_REPORTING_FORCE) {