Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp250887rdb; Fri, 5 Jan 2024 08:37:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IENSi6hQ9Slo2eM3gcqsM6+MlR6UOjLIzbkC89PRf8VnJ8jXuFlc4mA7IDnImH+YGF3Hw0b X-Received: by 2002:a17:903:1245:b0:1d4:4fc6:8d9 with SMTP id u5-20020a170903124500b001d44fc608d9mr2348749plh.60.1704472668566; Fri, 05 Jan 2024 08:37:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704472668; cv=none; d=google.com; s=arc-20160816; b=z+SuCxzsWt2RLbMkT+jLsrURIBCFZJS2rVmg2hq7BR7UEa+NJmKitz/fhj9n4aHM7R LCdfECDni+nFqnXw5kMC4OX2rJH4IoGdESwZMUEatygqmUpOubW2u8fd5VFCR3Kr0bO8 SI9dy8+AkyJSHea9AQj0NmNisTk9HogKRHRHolbpvfEdgPMCtk5QzOaxiS5psU3Y57LZ 4gi/8Ls2zjoed51BI2JUubFonDx5ZiwOl1txj0jfdE/TRd65XwGEewM88KajDxQ43jHY T7uUS9BX+e8IazQOhdg6DQbe/Om3x5dvaP3QZpCrEqBon58eXMjYXj9LCd+UJ0cfNBqX /dCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=J9BJMdsxPgjMuASgGsCJzK+UatXMhVSTg6u1B0kfjK0=; fh=+6KIiIQx7RlBEpiJo3aozMdAMX7u/fPcgwx32k1QFuY=; b=Wt19R9mYLpQhaAW1kHqaX3RPNgKb7cSWTpBQmUM6AIpfbZYymBcw8wPlEIS2mEAxen CvP4qEZMTyKgUJhPIQXS8C2OAsC6BPw+UQIs/FxjfJIyby8x7oCSoMJa4VF+zJr3j8PP lSTdQhvw3bCpnVapV94L36HhV+eOttwUcRBUYPjKvlrSFfEAZ1nbt+3VUTCSJdZ71oqM S6PgGemNwy9LZa4Q5YlqQi4J1yqJ4AGyZh8o2wezesFlRWYDkRriauUQvybPuKJLi3hf 0XsmVaDBE+Td3mXbdYld3eHy79YDa+WKhJFsAWJ7CC5uuFfkIMvRvof5oA4fq++xOjtL HnGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iPcTdpyM; spf=pass (google.com: domain of linux-kernel+bounces-18070-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18070-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jh9-20020a170903328900b001d42878aa5esi1457976plb.60.2024.01.05.08.37.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 08:37:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18070-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iPcTdpyM; spf=pass (google.com: domain of linux-kernel+bounces-18070-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18070-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 40422283DAA for ; Fri, 5 Jan 2024 16:37:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB841328DA; Fri, 5 Jan 2024 16:37:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iPcTdpyM" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD77A328B3 for ; Fri, 5 Jan 2024 16:37:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704472638; x=1736008638; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=nNShzR6tVlt8MP2GEm4twbSrn0rdHKZew4twsigGRgc=; b=iPcTdpyM5oDb3a9mJ9Wwa7KTc9/1yj5pV+pzMgzW2X6E+3IUPYTJrcqW ZAGGKgjKRTX40rZ0c5Lul7JTyZcvgRL7V8NrLKLPDdoRAtHbH/99CUs4U BdS0R+BdozZhC/vzcbwQ5QBmcSSCtKEQjL1zso621RXTzxMDjTGiCO3EQ uzuaOw5lgITxrYQ5oiYeGuj9mzWch7CNYRNVn9qU4AH5VbHL45nW6adZf WToPgcFgfeVtUy3ui4jDre2zfMBtwv60DUsYiWNL+qtL6pmx0slwbthja ZzmSlgbneg4J8DHcSRjMHH5tjoUehdh+97z1AeuYYHWzfVeAtQAhycdgJ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10944"; a="463931765" X-IronPort-AV: E=Sophos;i="6.04,334,1695711600"; d="scan'208";a="463931765" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 08:37:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10944"; a="953991189" X-IronPort-AV: E=Sophos;i="6.04,334,1695711600"; d="scan'208";a="953991189" Received: from tassilo.jf.intel.com ([10.54.38.190]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2024 08:37:18 -0800 From: Andi Kleen To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH] x86/mtrr: Check if fixed MTRRs exist before saving them Date: Fri, 5 Jan 2024 08:37:11 -0800 Message-ID: <20240105163711.9278-1-ak@linux.intel.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This one place forgot to check the fixed capability. Signed-off-by: Andi Kleen --- arch/x86/kernel/cpu/mtrr/mtrr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mtrr/mtrr.c b/arch/x86/kernel/cpu/mtrr/mtrr.c index 767bf1c71aad..2a2fc14955cd 100644 --- a/arch/x86/kernel/cpu/mtrr/mtrr.c +++ b/arch/x86/kernel/cpu/mtrr/mtrr.c @@ -609,7 +609,7 @@ void mtrr_save_state(void) { int first_cpu; - if (!mtrr_enabled()) + if (!mtrr_enabled() || !mtrr_state.have_fixed) return; first_cpu = cpumask_first(cpu_online_mask); -- 2.43.0