Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp901056lqt; Fri, 19 Apr 2024 14:10:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVHzW+1tRl19ftQV3Dpl3sNmpZvTL4aO0gGCeQOa9bB02dD+jJzL9pvvL0+rHRzLwuqWHehvC/VRzEgfG52p5iZOgGaQKesMzw2X2mfxw== X-Google-Smtp-Source: AGHT+IHEoS/3Vr8Om4v131UKCPiS0AsWUQvrnZQw/KGqurxyfOdtZZ3umt97j5p/P6HD31qyjGCL X-Received: by 2002:a05:6a00:22d0:b0:6ea:b69a:7c78 with SMTP id f16-20020a056a0022d000b006eab69a7c78mr4293044pfj.14.1713561040842; Fri, 19 Apr 2024 14:10:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713561040; cv=pass; d=google.com; s=arc-20160816; b=gSzJzP+iu+nHTFsesS2sz7cNnfU4qXIwpeuaI/dwkiPOX1MgXwgQc6/ddcLQ21p7rV KL9djw6aWTlLxKwREwndQzy8ZzAJAHQCKTvX98/+BlUVzDX1cARUQfKkbuO6SOevKAFM vxkSnv/Vw+nVLTFNSreitmgWVscbuggMyI188iGdGkJ3CxKfOsEKh5t4qyP6KWO6SG2W RIgZn/W9ggprOFWtsJzVjW8gr9SaYtPoU3RZufeJZKNhie1dmbXbtYdFmC5S0Wwq0Sj/ pgVPbgqnV18QqLVpO7cxfltW9kZtweelvNxi2FuMAZMKcPfbgNDikRsnLeQb7me+9zER e/cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Pyxsvg03QDkuF74lQGuHbclfwYbxE7UwoxccbagB7zo=; fh=D1drUkjhd6cQ461FGcgjExl1O+jZ7EhaGJAtOyxVAPQ=; b=Ns+kZvk1mbDtECqA07DPShzMyQnStiboiqmB1Bdge4/YVrvNETfUc5qiKHP1xWPq4A xeBom12LHphyqOyOfpgjLulmkDk5juEHrtnC8UlRF/vHpvN6mc7WWwJ9303QGXoOPQ5F 6rsu+TQenyAS30TAVjtg3BVevS4znrgyDRy2wLheuFGr6XAs+o8Tz0ijC9/w9LnVTl9t nP6suIWm9vM4qWfzSDcmgDmfli7E/KTQCCFw0+gb0J1Dm7gvSnzlOM9HuInerpF4QSF8 Use3NU9rN3rU57ivoTKl/WjvUvoKkdlTXLB9g7qu39hs3PcVQtYatzS5kJteccQDWch0 hhRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uEjKo5iB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151959-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id r136-20020a632b8e000000b005f773040384si3584401pgr.426.2024.04.19.14.10.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 14:10:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151959-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uEjKo5iB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151959-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151959-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 69692282E01 for ; Fri, 19 Apr 2024 21:10:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8443C13D2AA; Fri, 19 Apr 2024 21:09:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uEjKo5iB" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 972B813D278 for ; Fri, 19 Apr 2024 21:09:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713560998; cv=none; b=J2dqP3nYPW2Hz8ITmYgqtG0BstWl9/sqj0aBHAqs+Vc9wOIxhMW5DSW3+eaVPvM0eNw0rQJHI4pNuE6JtAMGzLlrf36EyphxnRAaVXM6ITGkvLyEglkR+Qbw0fRpy1kzOzxM+0nhWuYNxjDA4A/kpzOldsfYE9NGgtKmbArtbmM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713560998; c=relaxed/simple; bh=2mmHXkHoIDd4IMtBzLUixZKjNwd7j1hlbGi1zfFJhhc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aH460ldc152SGa4RqtsPt2VaDV/WED+KrPgn/ak1Wcm76jxuxXlsBUlPN4yq1lza7aZOyza9e54uYbILyxgMnWNy3YJiGDoHkDOYd/ppAfsa3wAkPewg9Cf8lAjEPf73hsUTmt8kDnwPI4sd6TCO3iM6lta9GrA2k78OhHOyZl0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uEjKo5iB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5C6BC32786; Fri, 19 Apr 2024 21:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713560998; bh=2mmHXkHoIDd4IMtBzLUixZKjNwd7j1hlbGi1zfFJhhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uEjKo5iB/3niZzMJSg2NPJZ/idQB5q5uRC39vu8MBIC9OUuxP+XeWjQATKrklMcl/ fOr0rLOdUFq1w3tqOCVYNdy0zNfMblMzo0SVsi3pgZlyIYFMKlZsmMtHFC1AHWksKL u6I7CdJ/Dpd+/R2ne2RSGdfxPnLcq8BSWCcQzBy45i4IvscTuP2cEq17plCxGOoKOa g8br8pCAlhKtr9A0zfbYAk7ALub2ReR2hmc+mb+xcNWc0cvmbU50WAUYs5n5GNJqLw 1U38WjwzvhujAsFNSAg4Xhgd17LZjnXa7Ab0SCCbttzzxKy0zy9FwvLq0e6RZYmWdi /K+6tC8UgKlGA== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Linus Torvalds , Daniel Sneddon , Pawan Gupta , Thomas Gleixner , Alexandre Chartre , Konrad Rzeszutek Wilk , Peter Zijlstra , Greg Kroah-Hartman , Sean Christopherson , Andrew Cooper , Dave Hansen , Nikolay Borisov , KP Singh , Waiman Long , Borislav Petkov , Ingo Molnar Subject: [PATCH v4 4/5] x86/bugs: Remove duplicate Spectre cmdline option descriptions Date: Fri, 19 Apr 2024 14:09:50 -0700 Message-ID: <7862dbc387213d8b3bb208c421caaf92623be856.1713559768.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Duplicating the documentation of all the Spectre kernel cmdline options in two separate places is unwieldy and error-prone. Instead just add a reference to kernel-parameters.txt from spectre.rst. Signed-off-by: Josh Poimboeuf --- Documentation/admin-guide/hw-vuln/spectre.rst | 84 ++----------------- 1 file changed, 9 insertions(+), 75 deletions(-) diff --git a/Documentation/admin-guide/hw-vuln/spectre.rst b/Documentation/admin-guide/hw-vuln/spectre.rst index 25a04cda4c2c..f9797ab6b38f 100644 --- a/Documentation/admin-guide/hw-vuln/spectre.rst +++ b/Documentation/admin-guide/hw-vuln/spectre.rst @@ -592,85 +592,19 @@ Spectre variant 2 Mitigation control on the kernel command line --------------------------------------------- -Spectre variant 2 mitigation can be disabled or force enabled at the -kernel command line. +In general the kernel selects reasonable default mitigations for the +current CPU. + +Spectre default mitigations can be disabled or changed at the kernel +command line with the following options: nospectre_v1 - - [X86,PPC] Disable mitigations for Spectre Variant 1 - (bounds check bypass). With this option data leaks are - possible in the system. - nospectre_v2 + spectre_v2={option} + spectre_v2_user={option} + spectre_bhi={option} - [X86] Disable all mitigations for the Spectre variant 2 - (indirect branch prediction) vulnerability. System may - allow data leaks with this option, which is equivalent - to spectre_v2=off. - - - spectre_v2= - - [X86] Control mitigation of Spectre variant 2 - (indirect branch speculation) vulnerability. - The default operation protects the kernel from - user space attacks. - - on - unconditionally enable, implies - spectre_v2_user=on - off - unconditionally disable, implies - spectre_v2_user=off - auto - kernel detects whether your CPU model is - vulnerable - - Selecting 'on' will, and 'auto' may, choose a - mitigation method at run time according to the - CPU, the available microcode, the setting of the - CONFIG_MITIGATION_RETPOLINE configuration option, - and the compiler with which the kernel was built. - - Selecting 'on' will also enable the mitigation - against user space to user space task attacks. - - Selecting 'off' will disable both the kernel and - the user space protections. - - Specific mitigations can also be selected manually: - - retpoline auto pick between generic,lfence - retpoline,generic Retpolines - retpoline,lfence LFENCE; indirect branch - retpoline,amd alias for retpoline,lfence - eibrs Enhanced/Auto IBRS - eibrs,retpoline Enhanced/Auto IBRS + Retpolines - eibrs,lfence Enhanced/Auto IBRS + LFENCE - ibrs use IBRS to protect kernel - - Not specifying this option is equivalent to - spectre_v2=auto. - - In general the kernel by default selects - reasonable mitigations for the current CPU. To - disable Spectre variant 2 mitigations, boot with - spectre_v2=off. Spectre variant 1 mitigations - cannot be disabled. - - spectre_bhi= - - [X86] Control mitigation of Branch History Injection - (BHI) vulnerability. This setting affects the deployment - of the HW BHI control and the SW BHB clearing sequence. - - on - (default) Enable the HW or SW mitigation as - needed. - off - Disable the mitigation. - -For spectre_v2_user see Documentation/admin-guide/kernel-parameters.txt +For more details on the available options, refer to Documentation/admin-guide/kernel-parameters.txt Mitigation selection guide -------------------------- -- 2.44.0