From nobody Fri Apr 3 02:42:10 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 003E537DEA0; Tue, 24 Mar 2026 18:19:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774376345; cv=none; b=BxoklGB/0pV9NKD1iCof3Bm1cdVesO+NOgsvImrqAT/bCQougYloeOEBwPhsRNhRXKB3VMC2b4lIjmI6c420rxRf2cr00oC1BwCEpIC0fsxhsGFk9VRtbXVTuJXRBC3tJY8LxVwibwFf2sHibR8TE7r8ul22b6y3z9mkvyC9dVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774376345; c=relaxed/simple; bh=tJKPFoTE04b29dqHeQZIy36ufkX7uRuyKW9NSMZZOE4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sLGetAlkm+f63DHG1s57GqXXr4P2Nqe3se8YG5km7QF5r9aStbsU0VcffzJxJoTErLS3+A+bBmfXxsjt+D/Qu47K88wmbs68+1DFrkLHTmMDY4ft30ZdDdBiic1LS9lkLJ2FCXiQHNRfYvBqH0fItLTSHSZCjxx0IvJIim1GhdU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=XMXvE67a; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass 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="XMXvE67a" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774376343; x=1805912343; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=tJKPFoTE04b29dqHeQZIy36ufkX7uRuyKW9NSMZZOE4=; b=XMXvE67alTmY0b8weYjGVyOiX0QFxGpYvaAvAvEh/yqBUUnPBvkIxCdI nPQeMv8atEneuQDPfCUsGs83XK5bGrsvIOEBJymwGHS+Urgxch5aI+8o1 j24yC4DLJCMQHjsp9+gnhVT2TfK2ICQuDboVh5ah+7ACR8+3hzF6uoqmT LCsjwpOh6pHVbl5A2yz620MRSQP467ypiCsyroV0uq0Kcmz1/kD7smAlm g41B0W+c2V3b9LvshMmWAHb31TvaJJPRCmD3HXLXSNj5VA3CVePDfPSQ4 FXs1N41J+jE5W94Mi7ffVW0tXQfxY5oovEb2dMrcLKEB0hLOoQdGfzzUk Q==; X-CSE-ConnectionGUID: fB6pw53HTue8cRQjJGqEwA== X-CSE-MsgGUID: 0eBc547jRxOPDmOPTBXAUQ== X-IronPort-AV: E=McAfee;i="6800,10657,11739"; a="79001149" X-IronPort-AV: E=Sophos;i="6.23,138,1770624000"; d="scan'208";a="79001149" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2026 11:19:02 -0700 X-CSE-ConnectionGUID: whTIKQ1dTJenyzHLYJZAdg== X-CSE-MsgGUID: 7EdO1p2ZR36PRWrpLZAIIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,138,1770624000"; d="scan'208";a="226066052" Received: from guptapa-desk.jf.intel.com (HELO desk) ([10.165.239.46]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2026 11:19:01 -0700 Date: Tue, 24 Mar 2026 11:19:01 -0700 From: Pawan Gupta To: x86@kernel.org, Jon Kohler , Nikolay Borisov , "H. Peter Anvin" , Josh Poimboeuf , David Kaplan , Sean Christopherson , Borislav Petkov , Dave Hansen , Peter Zijlstra , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , KP Singh , Jiri Olsa , "David S. Miller" , David Laight , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , David Ahern , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , Stanislav Fomichev , Hao Luo , Paolo Bonzini , Jonathan Corbet Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Asit Mallick , Tao Zhang , bpf@vger.kernel.org, netdev@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v8 10/10] x86/vmscape: Add cmdline vmscape=on to override attack vector controls Message-ID: <20260324-vmscape-bhb-v8-10-68bb524b3ab9@linux.intel.com> X-Mailer: b4 0.15-dev References: <20260324-vmscape-bhb-v8-0-68bb524b3ab9@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260324-vmscape-bhb-v8-0-68bb524b3ab9@linux.intel.com> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In general, individual mitigation knobs override the attack vector controls. For VMSCAPE, =3Dibpb exists but nothing to select BHB clearing mitigation. The =3Dforce option would select BHB clearing when supported, b= ut with a side-effect of also forcing the bug, hence deploying the mitigation on unaffected parts too. Add a new cmdline option vmscape=3Don to enable the mitigation based on the VMSCAPE variant the CPU is affected by. Reviewed-by: Nikolay Borisov Signed-off-by: Pawan Gupta --- Documentation/admin-guide/hw-vuln/vmscape.rst | 4 ++++ Documentation/admin-guide/kernel-parameters.txt | 2 ++ arch/x86/kernel/cpu/bugs.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/Documentation/admin-guide/hw-vuln/vmscape.rst b/Documentation/= admin-guide/hw-vuln/vmscape.rst index 7c40cf70ad7a..a15d1bc91cce 100644 --- a/Documentation/admin-guide/hw-vuln/vmscape.rst +++ b/Documentation/admin-guide/hw-vuln/vmscape.rst @@ -117,3 +117,7 @@ The mitigation can be controlled via the ``vmscape=3D``= command line parameter: =20 Choose the mitigation based on the VMSCAPE variant the CPU is affected = by. (default when CONFIG_MITIGATION_VMSCAPE=3Dy) + + * ``vmscape=3Don``: + + Same as `auto`, except that it overrides attack vector controls. diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentatio= n/admin-guide/kernel-parameters.txt index 3853c7109419..98204d464477 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -8383,6 +8383,8 @@ Kernel parameters unaffected processors auto - (default) use IBPB or BHB clear mitigation based on CPU + on - same as "auto", but override attack + vector control =20 vsyscall=3D [X86-64,EARLY] Controls the behavior of vsyscalls (i.e. calls to diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index ba714f600249..84bf89ca278b 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -3083,6 +3083,8 @@ static int __init vmscape_parse_cmdline(char *str) } else if (!strcmp(str, "force")) { setup_force_cpu_bug(X86_BUG_VMSCAPE); vmscape_mitigation =3D VMSCAPE_MITIGATION_ON; + } else if (!strcmp(str, "on")) { + vmscape_mitigation =3D VMSCAPE_MITIGATION_ON; } else if (!strcmp(str, "auto")) { vmscape_mitigation =3D VMSCAPE_MITIGATION_AUTO; } else { --=20 2.34.1