Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17685205ybl; Thu, 2 Jan 2020 10:03:19 -0800 (PST) X-Google-Smtp-Source: APXvYqyDJBX6JNZIEnQJ5YuOJ67fxK+43y7pjlCDtupai/eiygFJdjacqjSWjMdJGxpo5ljU2Uzf X-Received: by 2002:a9d:7d85:: with SMTP id j5mr76579541otn.86.1577988199856; Thu, 02 Jan 2020 10:03:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577988199; cv=none; d=google.com; s=arc-20160816; b=jEcfwxqvhW5iF0gs1Ftcc/H2gfwcS78QBOHrJVW0I0MJktrlZ8BIIc59VJrrMt1wFP 4FwgdLm3s49IJqFxPCHCcKPHl5k5FSSLELbrk9e7D9E20Z39+v4E4Ok8DkNbasulatke vBBJC6uyhz4NXL5DZeV1Fbw/5p6cRF0Rlh20xZA2+5xkWapQFj0sGcYX9m3WHWHvUyoS v5qo10JWm3aFJ0ggar8XyOa3acBbx4lp+chJRycb2pRbV+dVIAwyAKGA44+93zFCJ+7g ZboyZ/Q/0NkmLFF5H8J1XmtL9W8T60Ezmp4te6PBlJkJAN274i3pyvUT9ea1A+7FhQ2X fLBA== 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; bh=XunbI+VsMTSt6T8wsDBCwl2OnUH+IVmf1P88LFjggao=; b=NTe/FZx2Ab2UsTSJgYb18E0zqPSbrzujuEJlvHxWQ8RwH9kaNRjXAqpUG95HlGV6LX JhN/aAIc7qjceWZmEPdicX4ylOp1tFzf/HG2LBZD9//mv+nNFKAxGWMy2UhgxtKEEwXN JJJJJjONGF97ghPEUsVOEd814qGMZpC5WX9oMzHV/N4LWITOfrhSzUnF4K8BHVIOdj2u /GHQY+ox+8m+OIb5chMNAci0u94wpjvcQPxe6eqEfWw/zAPCNVJYl+5at1F35hmYjNrE Wdn/c18McF/pDYyr6+r4eG92LPQ11x4Efn4mw0j5NTb80PK92IJOAyPf2FKnV3cbHh/f cEVQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i20si26598571otk.270.2020.01.02.10.03.07; Thu, 02 Jan 2020 10:03:19 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728033AbgABSBu (ORCPT + 99 others); Thu, 2 Jan 2020 13:01:50 -0500 Received: from foss.arm.com ([217.140.110.172]:49046 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727890AbgABSBt (ORCPT ); Thu, 2 Jan 2020 13:01:49 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A0DBB328; Thu, 2 Jan 2020 10:01:48 -0800 (PST) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.197.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC4A73F703; Thu, 2 Jan 2020 10:01:47 -0800 (PST) Date: Thu, 2 Jan 2020 18:01:45 +0000 From: Catalin Marinas To: Srinivas Ramana Cc: will@kernel.org, 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: <20200102180145.GE27940@arrakis.emea.arm.com> References: <1577106146-8999-1-git-send-email-sramana@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1577106146-8999-1-git-send-email-sramana@codeaurora.org> 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 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(). I think the fix is for user space to set SSBS in the child if it no longer needs it. -- Catalin