From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 1BCE435C19D; Tue, 14 Apr 2026 07:08:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776150505; cv=none; b=CMmVCDuAOlW0UL9oCVvbhoIc1PNEFZpA/p01QPXcfY7LDzMfYzZdTereEtVHjlKcyZ6SM4MOn/adIhzSmhMrkhXn1+h2zG854edt9+qasla322mAFUSvIdpOd4CcoQb2uF0W9IDajiy+mJz3908gekdltQ+8+fHxcLXzg+RSGy4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776150505; c=relaxed/simple; bh=b6MuRVTf/ZgA9L22eiHzgpdsNzUtE5SipssmAjn0OuY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UVfhkwFq5Vf4s7giWcZgDrVjEIiQF349ElD/JALYojc2AiYGC/pktqtH3LyILX2UIzCx5N7NC3l9tmUVMSTJAWk0SjRNxFNAeQZNQXiXl+mICMCIqIo3ZGCfg8bdgYyUuIV+tCvtxnBQafpNpsBBrCXTyJV7vaDgVpCxBzfUjuw= 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=P8tSNWgM; arc=none smtp.client-ip=192.198.163.12 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="P8tSNWgM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1776150504; x=1807686504; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=b6MuRVTf/ZgA9L22eiHzgpdsNzUtE5SipssmAjn0OuY=; b=P8tSNWgMYvEdUSbOvtvyWbGWHNkPBV42KoBE5O6Anr3YeYufxFfVTs0e v8M/XfwDzuazOQ5MIdiWGTrmMw2f7o6a0Q6ZZFcs8obqwaWH+OaisXdNs zyHL2LpDHq5bvFVrXKHQ7hWcMvMw+VSE5eWziiZcZxjryeo4xfmZtMpsn Msi3WdB5T/7+MF+f3LxYvBG2gy8xqbJhuxPQGal0mKADcJfEKmcfz0ZKg Mg5NW9ym7gz1LzXgCEPD7ldr/roIbNYcAJoaD8gJBvfJXin9PAg8PhhAN 32mhf/hQKAT1p9LU1pRE+QvWLHu+VR55vaEKcVtU9Q2VbPV2NdK0ZtsvN Q==; X-CSE-ConnectionGUID: NMRY7v9FQpmq7n0YQVktpg== X-CSE-MsgGUID: U0ssOPYOT52TndIdHSdD8Q== X-IronPort-AV: E=McAfee;i="6800,10657,11758"; a="80983622" X-IronPort-AV: E=Sophos;i="6.23,179,1770624000"; d="scan'208";a="80983622" Received: from orviesa002.jf.intel.com ([10.64.159.142]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2026 00:08:23 -0700 X-CSE-ConnectionGUID: xTvYt0ysQf2QLw0aTex+Yg== X-CSE-MsgGUID: EWbHBLF3QeiWNViVG5/ctQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,179,1770624000"; d="scan'208";a="260430964" Received: from guptapa-desk.jf.intel.com (HELO desk) ([10.165.239.46]) by orviesa002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2026 00:08:23 -0700 Date: Tue, 14 Apr 2026 00:08:22 -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 v10 12/12] x86/vmscape: Add cmdline vmscape=on to override attack vector controls Message-ID: <20260414-vmscape-bhb-v10-12-efa924abae5f@linux.intel.com> X-Mailer: b4 0.16-dev References: <20260414-vmscape-bhb-v10-0-efa924abae5f@linux.intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260414-vmscape-bhb-v10-0-efa924abae5f@linux.intel.com> In general, individual mitigation knobs override the attack vector controls. For VMSCAPE, =ibpb exists but nothing to select BHB clearing mitigation. The =force option would select BHB clearing when supported, but with a side-effect of also forcing the bug, hence deploying the mitigation on unaffected parts too. Add a new cmdline option vmscape=on to enable the mitigation based on the VMSCAPE variant the CPU is affected by. Reviewed-by: Nikolay Borisov Tested-by: Jon Kohler 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..2558a5c3d956 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=`` command line parameter: Choose the mitigation based on the VMSCAPE variant the CPU is affected by. (default when CONFIG_MITIGATION_VMSCAPE=y) + + * ``vmscape=on``: + + Same as ``auto``, except that it overrides attack vector controls. diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/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 vsyscall= [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 fbdb137720c4..4e0b77fb21dd 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -3088,6 +3088,8 @@ static int __init vmscape_parse_cmdline(char *str) } else if (!strcmp(str, "force")) { setup_force_cpu_bug(X86_BUG_VMSCAPE); vmscape_mitigation = VMSCAPE_MITIGATION_ON; + } else if (!strcmp(str, "on")) { + vmscape_mitigation = VMSCAPE_MITIGATION_ON; } else if (!strcmp(str, "auto")) { vmscape_mitigation = VMSCAPE_MITIGATION_AUTO; } else { -- 2.34.1