Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3211855pxb; Mon, 9 Nov 2020 05:43:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9b4Z93ZFLX1piYkyElYDieYQbw1tagAQK8ivTS6DQiMfUiY2oKbT/ZnPgwyYkASdhn1fB X-Received: by 2002:aa7:da0a:: with SMTP id r10mr15892219eds.102.1604929394810; Mon, 09 Nov 2020 05:43:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929394; cv=none; d=google.com; s=arc-20160816; b=pJm269hRSFLjsK/cvJydldNxswiAljlh89fhkw5OkYyT9GlA0oS+OaXIbYwdhiIb3p 3nNJL6+uSJzV0o5EULo3pPctvy2wJvI7sJ3YahTrEpRkg6prjfA/KP2N5MBwi+IWCNaj 7UIRdiEVrjotozfUcx3kY6ZhDKlluOY0n5BRVEJToyHvikYCTRLaoFAYlEmyXaynhJZ2 muz+OMlZa3rk7vmiwi72KxyAnz6+TjmggA1C1CGYjoJ8rgKpBOfbYgr1gNkEIjKQlS2P WtirZD2MNhCYtrZAHxUnSq+jYu8hshiUU/51Iz499kIfdqnPMDQwgxtNuWqipkUaXqyl s8ZA== 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=ZlfeEHtdeeFoRRdXO3yluQOpfkBky5CMDPeDDlS1FqY=; b=GlcjVrmQi8HWrQEOsq+WEQBvURUlYOk05ZlVuDn2fnSlUHguzwCqZHMPz2soF8YM0V kyUahRN3waTRebCUxLpa3Mn+tWHp8612YaPZYX20IvqWl8SZoIj1RC8smEcLU/S0JE10 FVPthZU+iNp8+wZtyRDWK30R2MbjttbSE14EgrAxQYFbjv8sMvHtAUE8LBnFbzUNsJYr 0quL+i69uo/YsNNJwJ3D5S15O+1vzGxW98iPdTgjOx0xByq8tPBYIb9DfBIg5MoeHnSb 0tTiaPxnpQc3KSEORhsAHSvv/JhL9w2JnPnWIgYXRb65c2Ko2WG5G+v7Nry/zOI/lHrB yccg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WZNLKYc+; 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 s17si836874edt.578.2020.11.09.05.42.48; Mon, 09 Nov 2020 05:43:14 -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=WZNLKYc+; 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 S2387647AbgKINje (ORCPT + 99 others); Mon, 9 Nov 2020 08:39:34 -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 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 (get_edac_report_status() == EDAC_REPORTING_FORCE) {