From nobody Wed Oct 8 20:02:02 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 B738A2676C2; Wed, 25 Jun 2025 12:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750855895; cv=none; b=bvsSYMOlZzVovf0EH0zT8CzTabNajdTPAvJcN52T5pSeEill2KXHpvF4u1tGjHnvMPL7NLnFIhzU6PlZlrEeMx6LuxFEkwNBKBp+4dNA4xJ72GPxeDvtsGTqE0nR3Iwd9v+0gZIrDjj8EFDhFRd7mzPd9Q3fXQjrKSDm2+5feRA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750855895; c=relaxed/simple; bh=r8+6XTFMer08iaSTrK7+AgP3gettkLSvH05lTk9iIws=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XqcM/qd8V/Bu9NPcf0WwKQe6Wnq6DBxIl8zU+qzxM4uFxPZieCTP9fyus+NJcir1v0bFC5zgG8jNQ83Mb0BJQl8Dqte9jYyT0ul5DyJHtChhnrSrQh8UQWTCFtx6iVCj6cq9tU1F0PTz3I2dhcvVk8cKKU12g4oDmSW8onkqTOo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.helo=mgamail.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=T12Xqr1/; arc=none smtp.client-ip=192.198.163.14 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.helo=mgamail.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="T12Xqr1/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750855894; x=1782391894; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=r8+6XTFMer08iaSTrK7+AgP3gettkLSvH05lTk9iIws=; b=T12Xqr1/aFzH6YyOPpMdDlCUV8J8WjUI3HlxzX7PphHy1iHNwEYsiCyE O0NEMtUff4iqYzJ5j3vKbmoIZ9k3MMiWdJNd5/DuBrxaEyaRXxcgPULFG GEI38MqAJGtFRc019TGmCZXkFD/FJujL8czL8+JatPr4r+Z84DmrQwHLs KiY8uKwRRpihlGST0y52ERFZpXwIRtGRLlBaWVqVTvwdRphhrJ9HcmajS 3RQWlfIoF1Cciwrh/dJjj/Vg/630uQ2Q3ME9rNKAno9R4aI/tzHaQYAbQ gHlnp67GCyZoyA9m3mN/v6vKx0a1tqnQS/KOXWBiY53xZqVxQxLJFjvd5 w==; X-CSE-ConnectionGUID: buwmviUyQUiMjYb+Unij+A== X-CSE-MsgGUID: 7sZ/YZ/EQLWT6bySQ6FOwQ== X-IronPort-AV: E=McAfee;i="6800,10657,11474"; a="53189632" X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="53189632" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2025 05:51:33 -0700 X-CSE-ConnectionGUID: 8Fr5drcmQ7ao4amJPgEeWA== X-CSE-MsgGUID: 4mNwDd8lRBmuXMlyKC1+GQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="151830978" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa007.fm.intel.com with ESMTP; 25 Jun 2025 05:51:22 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 0AC3B70C; Wed, 25 Jun 2025 15:51:13 +0300 (EEST) From: "Kirill A. Shutemov" To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Peter Zijlstra , Ard Biesheuvel , "Paul E. McKenney" , Josh Poimboeuf , Xiongwei Song , Xin Li , "Mike Rapoport (IBM)" , Brijesh Singh , Michael Roth , Tony Luck , Alexey Kardashevskiy , Alexander Shishkin Cc: Jonathan Corbet , Sohil Mehta , Ingo Molnar , Pawan Gupta , Daniel Sneddon , Kai Huang , Sandipan Das , Breno Leitao , Rick Edgecombe , Alexei Starovoitov , Hou Tao , Juergen Gross , Vegard Nossum , Kees Cook , Eric Biggers , Jason Gunthorpe , "Masami Hiramatsu (Google)" , Andrew Morton , Luis Chamberlain , Yuntao Wang , Rasmus Villemoes , Christophe Leroy , Tejun Heo , Changbin Du , Huang Shijie , Geert Uytterhoeven , Namhyung Kim , Arnaldo Carvalho de Melo , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-mm@kvack.org, "Kirill A. Shutemov" Subject: [PATCHv7 11/16] x86/cpu: Set LASS CR4 bit as pinning sensitive Date: Wed, 25 Jun 2025 15:51:04 +0300 Message-ID: <20250625125112.3943745-13-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250625125112.3943745-1-kirill.shutemov@linux.intel.com> References: <20250625125112.3943745-1-kirill.shutemov@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yian Chen Security features such as LASS are not expected to be disabled once initialized. Add LASS to the CR4 pinned mask. Signed-off-by: Yian Chen Signed-off-by: Alexander Shishkin Reviewed-by: Tony Luck Signed-off-by: Kirill A. Shutemov --- arch/x86/kernel/cpu/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 9918121e0adc..1552c7510380 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -403,7 +403,8 @@ static __always_inline void setup_umip(struct cpuinfo_x= 86 *c) =20 /* These bits should not change their value after CPU init is finished. */ static const unsigned long cr4_pinned_mask =3D X86_CR4_SMEP | X86_CR4_SMAP= | X86_CR4_UMIP | - X86_CR4_FSGSBASE | X86_CR4_CET | X86_CR4_FRED; + X86_CR4_FSGSBASE | X86_CR4_CET | X86_CR4_FRED | + X86_CR4_LASS; static DEFINE_STATIC_KEY_FALSE_RO(cr_pinning); static unsigned long cr4_pinned_bits __ro_after_init; =20 --=20 2.47.2