Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2346362ybl; Thu, 9 Jan 2020 11:07:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxc0FfkS00qSURP5n5fwzNLflzImwLgNMmBLo7btCneqEkiwSTnDsjPP9OtZ0CJade08jFt X-Received: by 2002:a9d:5784:: with SMTP id q4mr10079748oth.278.1578596831995; Thu, 09 Jan 2020 11:07:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578596831; cv=none; d=google.com; s=arc-20160816; b=MAK64dVY++Y9x1uv50k7wZNkqG2fP16KdExv/itMY0fKUik69qHYfLC3IRXEbpeF2m jUJA2/aRdWGSA6/eVZELW4+kuRMpwkMt++A5Wsk7+ff5cGEGn4bFWSVPWu5xaJ5Rsutf C1qE+J1kieTF4yTy+SeIFbbNnJeg6c4X5omaB/02YO915W4WNxpu2Wl1epg51/BlyDQT KCTfC5OW/xkyNM00TZgTRpsYoM2t0H+uDpbHcVUn5E2uOMVWwsPUbsVVDpPTfIOzD6tS QXYrUMQQ8FVQIhw6AHyXjmV7kFaZt4ZF9UFCnRO9y2394hJDuPfUDLEmAljloqi+nQU2 13GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ee1r00J/vxKDdfISbtoKkjMmxM3LUcBVpsGc7wSrw+0=; b=BDTpxG5PFddHi/7RMrJhFpDBTpQC5AyBiFkpnhfbuVPA8hkuG2YpJXl0cV/l99jk5C Abv2iS/Iaev7QM/xHf97vDrFi06ZohAovc9LgMXIitenLpF45o/u0NDC6z92Jj7FuLpg QbJh3hm3KZPYWcKzssZaDMyFAf9AtzNUYOsfrMzQfLqNhCEl6A2S2qOmXfRBsWDPBAqW lgThhuRukIAsuPc2vAfoZzE0zoeezbBxjGsGkC6UNLMX+ZGvZV6KH+1Nwf5YFNuFUWRM VZbqbkIIJtSYeB9RVMRVNzr1j9P0+JHDCjpaaYj8tpRREtTOzmVcB5jGrtky8xneV2Bn a3UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V6tQ2nfh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si4631574otk.291.2020.01.09.11.06.59; Thu, 09 Jan 2020 11:07:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=V6tQ2nfh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732259AbgAIPSD (ORCPT + 99 others); Thu, 9 Jan 2020 10:18:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:39444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727945AbgAIPSD (ORCPT ); Thu, 9 Jan 2020 10:18:03 -0500 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 418E4206ED; Thu, 9 Jan 2020 15:18:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578583082; bh=wwTkulcWNrf8/WnDIcLNGlEiuiK3aNjEJ0Ao6P3jLx8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V6tQ2nfhWozNQ3WNBxLm/6dfX9TD28B9GdBZdjeTZQ6hOapDoVOaApZajf9G8DOWE +eISC137+7dtioAZSNt3iRl/UVkOQKuB/W8iThl/6EcKMphY/hp2e6LQc+anmIdiEh Ijd6kQgGCuGIeuG2Y5cPSqWBV0qUYoPUkn7Y/UTs= Date: Thu, 9 Jan 2020 15:17:57 +0000 From: Will Deacon To: Catalin Marinas Cc: Srinivas Ramana , maz@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH] arm64: Set SSBS for user threads while creation Message-ID: <20200109151756.GG12236@willie-the-truck> References: <1577106146-8999-1-git-send-email-sramana@codeaurora.org> <20200102180145.GE27940@arrakis.emea.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200102180145.GE27940@arrakis.emea.arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 02, 2020 at 06:01:45PM +0000, Catalin Marinas wrote: > On Mon, Dec 23, 2019 at 06:32:26PM +0530, Srinivas Ramana wrote: > > Current SSBS implementation takes care of setting the > > SSBS bit in start_thread() for user threads. While this works > > for tasks launched with fork/clone followed by execve, for cases > > where userspace would just call fork (eg, Java applications) this > > leaves the SSBS bit unset. This results in performance > > regression for such tasks. > > > > It is understood that commit cbdf8a189a66 ("arm64: Force SSBS > > on context switch") masks this issue, but that was done for a > > different reason where heterogeneous CPUs(both SSBS supported > > and unsupported) are present. It is appropriate to take care > > of the SSBS bit for all threads while creation itself. > > > > Fixes: 8f04e8e6e29c ("arm64: ssbd: Add support for PSTATE.SSBS rather than trapping to EL3") > > Signed-off-by: Srinivas Ramana > > I suppose the parent process cleared SSBS explicitly. Isn't the child > after fork() supposed to be nearly identical to the parent? If we did as > you suggest, someone else might complain that SSBS has been set in the > child after fork(). Right, I'd expect the parent SSBS to be inherited when we copy the pstate field along with the other regs, and I think this is the correct behaviour. Is that broken somehow? Will