Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp305493lqh; Mon, 6 May 2024 22:18:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5r66aTvDauF+yMv6N/bl7ijq03cFqKgYKG+DwJgq8O4qutfGpyoyyCngX5m9kY+MiOMBpnrUjhyHVJWgmtTQgePp6fiRPpIipC/prkg== X-Google-Smtp-Source: AGHT+IGFiIVbigOcte33zdAFK0FwNadQDl9lRFJtJqfANFiPi0T2K+dGUZUCIQdSjwM1SICyp6UB X-Received: by 2002:a17:902:6506:b0:1e7:b6b5:1f05 with SMTP id b6-20020a170902650600b001e7b6b51f05mr11725955plk.18.1715059101909; Mon, 06 May 2024 22:18:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715059101; cv=pass; d=google.com; s=arc-20160816; b=hUuXjYzmYuE31Tfh7buHG6k5eku3w26wKvwDx/LG/nEmCdsgq2OZiDydx+QB3pka23 5Ele2a5m2/btGjdupAPAjNYeFx21Pg6U2jxKMDAUnusFzvjf6kIiu/wp2O/IaVUo0f6+ eQSm4eFgkaJZ2lQaKruPeyCqgwL+LDuXj+MY5GLQv1WsvCjd09yLKkDwWy3HqhXENSqD 3SfUpeGRV4cjM9ACaezNMGV1bkQsCLpbINE7I8NOinUadTavIirWWfghi3SRUq+Bj3Xf s1OzakrXiFu9WsNEDBFXidYEwFFaQIxQaVkFPOlzKoKXnNuFyE5g/5MMuPbVb/OMiTx7 utvA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WVySZYT6KA9Gbr5tdOjmluO8UWU3V/SJGdVM5B9Z8Mk=; fh=qR261FA59eFaDvGNg0/tpWsfTL9w6j3ecqfEgHg5NCE=; b=GY27KDDRPfl6ONi9bhbp4nf4ys1+1Evpm/IS4vKjZwJj4SnaeAlldvdzW+/LvmhhRf 8MT7dFz4BlaYUPx4SXFmTSZkslq+6S7y4CLvqCwlCtbgoKoIKPuhI4bNqDptWv1RW0qx XFkY6JsFNZSpPRpaKUqa9VDS/wkttzZRVZZN5e8gHIngY3V9Wo8PkQODJLusrXjNaZep ztu3LpgaKqpgzHUrMdI0y5+rMlBnE6c2c4SEe5DxVQ578m3z/J1C8TqNfsMdgWiCJ+9c Pim9wDwDPQB4X5eAAuriVdN21a8MVTeAXZ4qgJsi4IwIlDA+EJ8AB2hEfNdzNqF4ZrFD sQWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dmCncGDS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-170687-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170687-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t2-20020a170902e84200b001e29de2a2f0si9815180plg.518.2024.05.06.22.18.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 22:18:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170687-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dmCncGDS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-170687-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170687-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 21CFEB22DF7 for ; Tue, 7 May 2024 05:17:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA92E6BB5C; Tue, 7 May 2024 05:17:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dmCncGDS" 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 0C97454BE4 for ; Tue, 7 May 2024 05:17:43 +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=1715059064; cv=none; b=kU6aOCU3uaFd4QkWsZ/VqUyRqXh6cMKAtC2tGp8x/k3g4Dpj+HR/IfpcmxZHrxmBd4eOhJLCES0kc5hocT94Jb4xjOMOeS758yKN8fQir3Dx9/CJyAhSDIQZpwm1/+Bkbn0QoOMMdCFAKpHxhUjWi6jyTRlFTkPPM20G6fgPJEE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715059064; c=relaxed/simple; bh=MVxJV0DmzBRnFYcte+tBATygTJyvAiF8PMo21+ADg0k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m1Hy/aJS348QOKlLDcEF9+/J4viZSAAHb+rmf0q1qDoWyKGHMX85tcXwmT8Zm8nFCpc1IHOfPJKaO1KQD/TfzfIrc4nnpIbmO+Q3u9aFJyUg9NdNmNcmSOoMIbOcVtsZ6Vy+aHZfW7VGbuwhOT+gqSMR5/FYHtBRBh2s5Yzc71A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dmCncGDS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EE31C2BBFC; Tue, 7 May 2024 05:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715059063; bh=MVxJV0DmzBRnFYcte+tBATygTJyvAiF8PMo21+ADg0k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dmCncGDSSdcfqIIrRxuvPGq8GBzaMWSoFP1+/GbVdC4S+pb6vOXXwwEYHfnHZY8Cn VTBPcvNG7zAi5DgR4J+25vLRX/APnkwzEXsdfke2GInWIiVzVTsNxBxLQZl0VKUjN3 ZfLTGeOcFKc2Jm5+9m5Q0V3a8bYU3Uurv4a1pnsZEUeC/qWLsHCOoZ5trQaEXR8AiF KjmaCqd7fPFkQHg5zRuiYiXSkne0H9al2+0X9KcGY6pu2jRj7yjZEH0D4Tv2m9x2bt QUJttVFp4LpaZ/Ct1npI/v4VKJm6uFhzDVTz0sSjqQElyHYk5v3dSuchc8Q80shHUM GTANWxXuf7vAg== Date: Mon, 6 May 2024 22:17:41 -0700 From: Josh Poimboeuf To: Yujie Liu Cc: x86@kernel.org, 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: Re: [PATCH v4 1/5] x86/bugs: Only harden syscalls when needed Message-ID: <20240507051741.4crk2pd2fuh4euyd@treble> References: <982d05a2f669140f26500bee643011896d661094.1713559768.git.jpoimboe@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Mon, Apr 22, 2024 at 04:09:33PM +0800, Yujie Liu wrote: > On Fri, Apr 19, 2024 at 02:09:47PM -0700, Josh Poimboeuf wrote: > > Syscall hardening (converting the syscall indirect branch to a series of > > direct branches) has shown some performance regressions: > > > > - Red Hat internal testing showed up to 12% slowdowns in database > > benchmark testing on Sapphire Rapids when the DB was stressed with 80+ > > users to cause contention. > > > > - The kernel test robot's will-it-scale benchmarks showed significant > > regressions on Skylake with IBRS: > > https://lkml.kernel.org/lkml/202404191333.178a0eed-yujie.liu@intel.com > > To clarify, we reported a +1.4% improvement (not regression) of > will-it-scale futex4 benchmark on Skylake. Meanwhile we did observe some > regressions by running other benchmarks on Ice Lake, such as: > > stress-ng.null.ops_per_sec -4.0% regression on Intel Xeon Gold 6346 (Ice Lake) > unixbench.fsbuffer.throughput -1.4% regression on Intel Xeon Gold 6346 (Ice Lake) Thanks for clarifying that. I'm not sure what I was looking at. I also saw your email where Ice Lake showed a ~10% regression for 1e3ad78334a6. Unfortunately my patch wouldn't help with that, as it's designed to help with older systems (e.g., Skylake) and newer (e.g., Sapphire Rapids) but not Ice/Cascade Lake. Whether 1e3ad78334a6 helps or hurts seems very workload-dependent. It would be especially interesting to see if my patch helps on the newer systems which have the HW mitigation: Raptor Lake, Meteor Lake, Sapphire Rapids, Emerald Rapids. For now, maybe I'll just table this patch until we have more data. -- Josh