From patchwork Mon Oct 28 16:08:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shishkin X-Patchwork-Id: 839415 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.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 70BEF1DEFEE; Mon, 28 Oct 2024 16:12:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730131922; cv=none; b=YetBVwE3W+YkKw/S8mxYuT8VkwaHtfNYFrFlVh8Prv5OHI0fhb1Ogo6tNwMql4NhdNmK/hCfWaMj/Ri+zEZ3GWlIww4eijyDAUJzupHlEnkEhPmgU0XCqpMAc9yz4qW/YOQbKyyjkbJyRsCNGT87k7cq8kdogr2XLn+4IdABqZw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730131922; c=relaxed/simple; bh=wOMJ6l35iG3/UV7cdqJrNVNPNZiJ7wbNmpeZyTJVyao=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bNRpniNTYC9Nvj4z5uqavrUYJW9Q5Mt7DqhlCW5A/STVoGBc8wbGCVUUnuvU9l68RcIG9LSJ2Ds2/Jncw6FYWQ63P/nlcPZcZnod0yDzjSIzpYijyquIdjg55CJbidJG7QA1nZSolsMMqNh+GOHALpxO3GwfVs9yGkUqV9b3oLs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=m2246HPw; arc=none smtp.client-ip=192.198.163.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.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="m2246HPw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730131921; x=1761667921; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wOMJ6l35iG3/UV7cdqJrNVNPNZiJ7wbNmpeZyTJVyao=; b=m2246HPwerG0/mFHltHuGfXkSBOnBLkn0PHW3rG1GFCB7s8RHmBIYmm6 TFhOaMdGlZ2U8v62ts19qYcD3fkOGL70YrZhuSPRJ4IdupCMrdDIHgbse R3DoXU5NYnbMW+WiFgjCSsHmTx97QMvxarf8DlgVbPlCTbUJqCpODIeVR TLh1Q1PLdkzgmOlTJDeA4H6WcOzhjJliAgF+bFTMgZg7ioj6XEk2Khos8 LAYw1wuMQF+M8SXk3Ot2ED5bcYPqsFNPFHtLJfaMRdgunaj9TzthACqKY vUo92CcMQumy5EVNXg+ucQwuRSxd43xJ/ac7snwqWMcP9GWd3vRGJ+DWW A==; X-CSE-ConnectionGUID: l2SwnE9HRm6pBKGBxFhfbA== X-CSE-MsgGUID: PvGTuqlKQYOgRV4OEkhkgw== X-IronPort-AV: E=McAfee;i="6700,10204,11239"; a="32594219" X-IronPort-AV: E=Sophos;i="6.11,239,1725346800"; d="scan'208";a="32594219" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2024 09:11:59 -0700 X-CSE-ConnectionGUID: r0rgbptQS7+frk7w52MmQg== X-CSE-MsgGUID: 1hDCkkhiQ2icapOXK47IBQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,239,1725346800"; d="scan'208";a="112478650" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by orviesa002.jf.intel.com with ESMTP; 28 Oct 2024 09:11:47 -0700 From: Alexander Shishkin 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 , "Kirill A. Shutemov" , Alexey Kardashevskiy Cc: Jonathan Corbet , Alexander Shishkin , 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, Yian Chen Subject: [PATCH v5 12/16] x86/cpu: Set LASS CR4 bit as pinning sensitive Date: Mon, 28 Oct 2024 18:08:00 +0200 Message-ID: <20241028160917.1380714-13-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241028160917.1380714-1-alexander.shishkin@linux.intel.com> References: <20241028160917.1380714-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 --- 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 c249fd0aa3fb..f8eed9548ea1 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -402,7 +402,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;