Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4479812ivc; Tue, 3 Nov 2020 13:07:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJwf8F0w4a/3lKauvZRN/VQv6NGyFlv8l9KvuGPAeKtZ1B8ddo0lpeb5f977fmDFLxRWBCAe X-Received: by 2002:a50:e041:: with SMTP id g1mr24127159edl.385.1604437646528; Tue, 03 Nov 2020 13:07:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437646; cv=none; d=google.com; s=arc-20160816; b=Z2dixIb4TcfXrNAU/qVewRQdnf95vp6YSRfHndpV593os7xbYlWV8o1YCkVYkzYVOj w80t4pOCw4urVSoF5zOMkHHRdVBj6TBddjxOaLvIDKvr0+4DaiCFLq4JGhmCPxI2ckyG EEqfBwjbzFapztDwMibnfxOut5W8/5umLye00u4F+jJhMAo0Mqz74ULCYQrmSaNQ9SGb nDKXgxZBvViWrZAvqpTlF36DevwtH7NDRHHzJl67+COkT73q6rlKBXU6phn2rzJA9iQ1 Fl0S8GPN6Yw7VH5UpA+mingHxFHlMARu2CC4ZolpdociBgPnRdsEclc3H6CkN/rjoIxP D5NA== 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=o3SqLb7v5cQ6aa7/wnSolEOYYFPWfK8idtSZHBMzD7E=; b=ztB9q5+OtP9bRvvEC8mkQmEXZjzNtu2G5lFjjTdOanHlSm0vR+dvf8VlTErZom0UKL HdE9OGKHtuItpnqeUKSZfll5AWsbha4L944hI09x/yOm/Cg2AK21C38zhnZmIOX26bOa CtmxPZz5+6jmkv32wMCSn8ekcGXlPBeT44/KPFb8RlIG5hlQR7BzDe9+QsNEHM6wZxtw mvzoYcXRvWPvI6TZ3oag8X30+qnRAN8CVHAeHOgG3IaJCJhF7wHLv/bfpdQhWrIq8cCT T91q7Q2NmTDIjK+VcLqUxxFGjzDOcvSwRQHbXvT98bR2164TZJNe5WpOxZTcqUpZohm4 QUOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IGUvQP+H; 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 r13si13783390edb.164.2020.11.03.13.07.03; Tue, 03 Nov 2020 13:07:26 -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=IGUvQP+H; 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 S2388074AbgKCVFu (ORCPT + 99 others); Tue, 3 Nov 2020 16:05:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:44410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387858AbgKCVFp (ORCPT ); Tue, 3 Nov 2020 16:05:45 -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 4F774205ED; Tue, 3 Nov 2020 21:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437544; bh=cEYcqo0HfhMWwa15jk3JBkbvGR1AGq4Ir29tctpU3jU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IGUvQP+HmnOjW5v2we+NW/DuJE0fslsQDVkRXdDswRy7sQtXXh09y/tCDzky26PVN EJavYqY8/0rEGoTSTTBwCGuNngn4Ofdt1OR9RZqLh8McYzraMnbCB59On1aHQjrSmF NbTMCAJQyT6b/ZtIGIRtDHl39qf8BkcXNralJ9SE= 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.19 121/191] ACPI / extlog: Check for RDMSR failure Date: Tue, 3 Nov 2020 21:36:53 +0100 Message-Id: <20201103203244.614399960@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@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 @@ -224,9 +224,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) {