Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 833EFC636D6 for ; Mon, 20 Feb 2023 18:22:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232344AbjBTSW1 (ORCPT ); Mon, 20 Feb 2023 13:22:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231923AbjBTSWZ (ORCPT ); Mon, 20 Feb 2023 13:22:25 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A259B1C7EA; Mon, 20 Feb 2023 10:22:24 -0800 (PST) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 89B521EC04CC; Mon, 20 Feb 2023 19:22:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1676917342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=eycNE7ApAXhzX6807MvJt8kbzZ81N9yIEfNaO6s5OXs=; b=ZS0fCig49ahDJuciJ83aMYaYEnmnpa2gFtBVWtHjuVDhTpByo/OX2aFNj/N47jFaA05uI3 1IIK3rZlUWmHJySPjVsNhMa2HLeWNBkNQsWHT37kSenUyMxXMK3ViJfBrSkbXzpDUw5SWP IgfFdtN4hwLM4mVxG1EsCB3T0VUHTYE= Date: Mon, 20 Feb 2023 19:22:18 +0100 From: Borislav Petkov To: KP Singh Cc: Josh Poimboeuf , linux-kernel@vger.kernel.org, pjt@google.com, evn@google.com, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, peterz@infradead.org, pawan.kumar.gupta@linux.intel.com, kim.phillips@amd.com, alexandre.chartre@oracle.com, daniel.sneddon@linux.intel.com, =?utf-8?B?Sm9zw6k=?= Oliveira , Rodrigo Branco , Alexandra Sandulescu , Jim Mattson , stable@vger.kernel.org Subject: Re: [PATCH RESEND] x86/speculation: Fix user-mode spectre-v2 protection with KERNEL_IBRS Message-ID: References: <20230220120127.1975241-1-kpsingh@kernel.org> <20230220121350.aidsipw3kd4rsyss@treble> <20230220163442.7fmaeef3oqci4ee3@treble> <20230220175929.2laflfb2met6y3kc@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 20, 2023 at 10:01:57AM -0800, KP Singh wrote: > Well, we disable IBRS userspace (this is KENREL_IBRS), because it is > slow. Now if a user space process wants to protect itself from cross > thread training, it should be able to do it, either by turning STIBP > always on or using a prctl to enable. With the current logic, it's > unable to do so. Ofcourse it can: [SPECTRE_V2_USER_PRCTL] = "User space: Mitigation: STIBP via prctl", we did this at the time so that a userspace process can control it via prctl(). So, maybe you should explain what you're trying to accomplish in detail and where it fails... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette