From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB1F833A012 for ; Wed, 15 Oct 2025 17:02:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760547747; cv=none; b=ZCrGEdEgCBXL5RYokLIycXnHqmc/aPvizDIUhhJ/5sXL2nXUsCxJXRFNk5MwHF3s1z6o13R3lCLroM4fqnNd4Ba/yCCEuZlpegMPlvsH5PBoznykvz/bNNZOJyn9U8UlSL2GVRPWN6S8ich+3hEIUahnQYMuhrK2yAIxjm1RUbU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760547747; c=relaxed/simple; bh=1jed6GmDT1FsL0aWAQrTOmSmNfkR/x9qXkLi2gdyspE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=KdDZKFjNFlQFhLGNw4+1Lajrar6rv53m/k7JO+rdNQdJX7eNqotwSGPZ4xYXNq11fa/TW6N4Zmnd3ry2nRlfUI2FMpqKPBls4SPAzZ4Y0YKCbHmCya8Vsa3BlBFIDCNnf1SoZtUEpJFZ+85c+h8R1OQZ7dZuT+vEQF+sHhOAg9M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=IuaKdqJf; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="IuaKdqJf" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-470ffd40c16so3244175e9.3 for ; Wed, 15 Oct 2025 10:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1760547744; x=1761152544; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=MFa5MsvOEgP3p/Hez6gTFGugruhQ98Q36uD5Tr4UKtc=; b=IuaKdqJfvvwjIqtkpNjIUSKpuPGx4QJ9ERpU+mojB0TGlrCD7y43s5Qqjod0AEHnJr kQbxj1jTW5bGJStKkMIZLOOlQAxjMi4QCteYt8Rm6AfT8w6iMdWXQv51oLOc3naXhetU hcQvdhimQmgDautnYr24mdoHxcSNtjQLtZbYfbGdOLhIjbXlpguQ7tYKuXG+xuoVX9x7 l4TsZLDQW96G/Ef0ERhjoN6VolYTrbwaQf6ntnwhIZsWbo9NZlx3uX3ipTPR/ouAQ0t7 M9vVR4MF6tvDcqqAsKc0bIOrkmida+qaEnpHTKuPM0eUjax2D6r/iIU8DfvMYdQzC8Je atbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760547744; x=1761152544; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MFa5MsvOEgP3p/Hez6gTFGugruhQ98Q36uD5Tr4UKtc=; b=xVGB7XtjcI0s+GKVT8gDTKnXt0LRf0osj1GfJ2goYiA59l5OPOcRyNg3tJ95grys8I D8XWbze0ImfJkWTbLomIEJL2TyxANjBZzVHnaQw3bWdbvSLlcLSwpsIVnunXoIYE7MKG xObzdt2iOrCS+uKk5+ALznRfaC7SVEbg3jnHBC2yf/VgzIEBb9xpR9sVRN8Hc5h4I/tN LuXw6QdNDn54HkKmwauv71tG53B9E+N5AhXIPKWbouzo9NqqLtbjTXNT6zmzIQaR8R7M 4rgs3suYu1C3IohddmkpGkV9D2DFKms9XYQ6rxrUl55Wz6nx0BAYvEHBAJaHM4l72xUM ZuTQ== X-Gm-Message-State: AOJu0YxZZI7Vuh3dLhoX8r2iil/tHV11aUPl/2cQCOzXVEIuHLBYDedW b3aW1JijCOvVDzC0z3wGM0z8+ZoWRvlUtqBScIgt7k0lRlYDfHYZG6bU9WReTep6U7JLlI7DLuO 3UJaomHdV0hBfvg== X-Google-Smtp-Source: AGHT+IFvxc3sGG1SeHoxohU8Q35w8zbZLd6mM8Sf9fcI92y8FVCNPWrspXmbbM6LPsQib/+IzMUzo5jzGr5ojw== X-Received: from wmoo1.prod.google.com ([2002:a05:600d:101:b0:45d:e2f3:c626]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:699b:b0:46e:410f:f645 with SMTP id 5b1f17b1804b1-46fa9af8fa5mr219134815e9.21.1760547743670; Wed, 15 Oct 2025 10:02:23 -0700 (PDT) Date: Wed, 15 Oct 2025 17:02:05 +0000 In-Reply-To: <20251015-l1d-flush-doc-v1-0-f8cefea3f2f2@google.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251015-l1d-flush-doc-v1-0-f8cefea3f2f2@google.com> X-Mailer: b4 0.14.2 Message-ID: <20251015-l1d-flush-doc-v1-1-f8cefea3f2f2@google.com> Subject: [PATCH 1/2] Documentation: clarify PR_SPEC_L1D_FLUSH From: Brendan Jackman To: Jonathan Corbet , Thomas Gleixner , Borislav Petkov , Peter Zijlstra , Josh Poimboeuf , Pawan Gupta , Balbir Singh Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Brendan Jackman , Kees Cook Content-Type: text/plain; charset="utf-8" For PR_SPEC_STORE_BYPASS and PR_SPEC_INDIRECT_BRANCH, PR_SPEC_DISABLE means "disable the speculation bug" i.e. "enable the mitigation". For PR_SPEC_L1D_FLUSH, PR_SPEC_DISABLE means "disable the mitigation". This is not obvious, so document it. Signed-off-by: Brendan Jackman --- Documentation/userspace-api/spec_ctrl.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/userspace-api/spec_ctrl.rst b/Documentation/userspace-api/spec_ctrl.rst index 5e8ed9eef9aa84f12fa255af7b15c163ff01aab8..ca89151fc0a8e7205e0a0062134d63b213b9ef11 100644 --- a/Documentation/userspace-api/spec_ctrl.rst +++ b/Documentation/userspace-api/spec_ctrl.rst @@ -26,7 +26,8 @@ PR_GET_SPECULATION_CTRL PR_GET_SPECULATION_CTRL returns the state of the speculation misfeature which is selected with arg2 of prctl(2). The return value uses bits 0-3 with -the following meaning: +the following meaning (with the caveat that PR_SPEC_L1D_FLUSH has less obvious +semantics, see documentation for that specific control below): ==== ====================== ================================================== Bit Define Description @@ -110,6 +111,9 @@ Speculation misfeature controls - PR_SPEC_L1D_FLUSH: Flush L1D Cache on context switch out of the task (works only when tasks run on non SMT cores) +For this control, PR_SPEC_ENABLE means that the **mitigation** is enabled (L1D +is flushed), PR_SPEC_DISABLE means it is disabled. + Invocations: * prctl(PR_GET_SPECULATION_CTRL, PR_SPEC_L1D_FLUSH, 0, 0, 0); * prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_L1D_FLUSH, PR_SPEC_ENABLE, 0, 0); -- 2.50.1