From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 BFF9F194098; Mon, 7 Jul 2025 08:03:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751875415; cv=none; b=LflI8pXxjZDlk6fQaO9XB2pS1ag1nDkFSqiBgAgVwtIloDmh7VWPn+gh+lcE42kM+39MWENoy2bKGtt+FjtHU/Xngo3ZUZ1TCj7TxYSZNCQZ7OPDSSFL7OKeYXMIrwJC4EiXPnBeFX3YLxMHdEisBiGYnsZa5LLmBcLOvjO0WgQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751875415; c=relaxed/simple; bh=J5WwLctxhVnscj924ezQg1UGG/n1vvqksbWY0HLqHYc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gFzTraUgdpyexphE8wUZiXEIUN4FKq3DODUp3xLP3UF4OoPJ4jtcO5PNxhJm5RvAvQMbbuqNspuUOi2kaidey+Rg9GcVhJclxogC0d3XocbITjjCTW7MAOrF3w0qsD1SydM3DjMc8xywwyzXRFNWEQEkVcR9D+s24Yo7fbWv+Qk= 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=R/gCxRjL; arc=none smtp.client-ip=198.175.65.13 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="R/gCxRjL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1751875414; x=1783411414; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J5WwLctxhVnscj924ezQg1UGG/n1vvqksbWY0HLqHYc=; b=R/gCxRjLKhacgTbRLQXax9LX/w+rMqikYvJPDwoUvXvb2kpC2rj1IOSn hv/Scrgj/1FTuHdIsdPl/UI+Vayv/GbMpBgM3I2RVY26Ct7rCAPT3WE4S 89GFRjkneZeX3wi1CU5LzAJkaMO27ggJF9Jbhkm62o5IDT0n8TOGxObpn evXb5h2onLjazNeDooxrNl9lJK5upCLoZ4FxA90qQ8yFtFddbwE0L/doR fVAHcME3c0OpV14mwbYRVcRa3tRo9TcZSGKU59mnNWAOlh/ioBdGmzjR2 2SUO/xu9aE2yFdFaxptCv2fBitkwKyizMTnqRLP57uPixfzs/GONIrLrV Q==; X-CSE-ConnectionGUID: XqtkD405ScCjYDRUeAPc+w== X-CSE-MsgGUID: O7Vc/f9uSVSVDyWsTVCecg== X-IronPort-AV: E=McAfee;i="6800,10657,11486"; a="65151816" X-IronPort-AV: E=Sophos;i="6.16,293,1744095600"; d="scan'208";a="65151816" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2025 01:03:32 -0700 X-CSE-ConnectionGUID: Fl3qj04tTyayfhZ22ecZJA== X-CSE-MsgGUID: S+5BXXZmQzm/AV838UcAjw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,293,1744095600"; d="scan'208";a="154573873" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa010.jf.intel.com with ESMTP; 07 Jul 2025 01:03:20 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id B188E2E7; Mon, 07 Jul 2025 11:03:17 +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: [PATCHv9 03/16] x86/cpu: Set LASS CR4 bit as pinning sensitive Date: Mon, 7 Jul 2025 11:03:03 +0300 Message-ID: <20250707080317.3791624-4-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250707080317.3791624-1-kirill.shutemov@linux.intel.com> References: <20250707080317.3791624-1-kirill.shutemov@linux.intel.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Sohil Mehta 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 325f892ee42d..ec62e2f9ea16 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_x86 *c) /* These bits should not change their value after CPU init is finished. */ static const unsigned long cr4_pinned_mask = 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; -- 2.47.2