Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp541001pxb; Wed, 18 Aug 2021 08:10:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkromE/ayEBpFxpt9cnfDGQzVVyvW8g5aU6JWeyXtAlvOK7Ucai/i3HACYN47wTNqTJ+MH X-Received: by 2002:a05:6e02:160f:: with SMTP id t15mr6726057ilu.60.1629299457391; Wed, 18 Aug 2021 08:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629299457; cv=none; d=google.com; s=arc-20160816; b=BKS+jsukdMB5Ufr5i8nwHvpE+fHCgTWl8CaOV/ICngYVgjwFGP0PgVe+MFXnUOO+wJ VFk/1MJ6i4eyWwT+1kMNJTbsJ1qrzW7/nzjzkZNWcDPfzRX9WsWhuS/tYjC1HycTTFnD q73xsnH7aTm+DJu4/hkjNJ3tHGQQr6lrvJnArKJeExIF46E5Ac8ceaUbeqpwlUgFveep mhVBN1tQBHqL8ojK0acX6mQQeTp3Qui8WzZdxFgSYSwh5swWuFbI8latLb1KVE8xiYSq TXvDxoANc2cO7JeNnMu/o6jbjWfoTu02meFj+WOgkYpM7XrxrKlkRIrMinAjhguPok7e 0GbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature:dkim-signature; bh=zDnhRncZEBK7QOE1PSqSdUR/el9JR/iDyYbLw5ADBrw=; b=szh8y5vzVqEAZ6pGCD0vCkV3wHo2G8HnGHp4p8ZjlX/I2jw59574ZPFguV+XkGNXQF kp5IMTe8BammeNPLvraKtgUk/RCDi8/uG/4powLir3oBcrBQI/8/v8aJ8wxu+jp8ebHL frlakqo2w4s45nSQK60Lg122WSH2z1XH9pSB09XS+c8lVEFeKZP9+IImmOYr+f3aiZ2B vB795PcRx1l2wzzcVd079bQpKlmsS/vb099wHaZAuCZHiqJsb1QoNbz5AVI7eb8Rhbs8 HL1cDZibUV986yg//rSCGpic31r6i/ktma5k27/GI515lky3gu6MkKnh419zkYQoazLg rghg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=mBZoSz8G; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=rvVYonya; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b12si106456ilv.101.2021.08.18.08.10.44; Wed, 18 Aug 2021 08:10:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=mBZoSz8G; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=rvVYonya; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239703AbhHRPJ1 (ORCPT + 99 others); Wed, 18 Aug 2021 11:09:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239533AbhHRPJ0 (ORCPT ); Wed, 18 Aug 2021 11:09:26 -0400 Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050::465:202]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2AA2C061764 for ; Wed, 18 Aug 2021 08:08:51 -0700 (PDT) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4GqWWM6PTXzQkcq; Wed, 18 Aug 2021 17:08:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-transfer-encoding:content-type:content-type:mime-version :subject:subject:references:in-reply-to:message-id:from:from :date:date:received; s=mail20150812; t=1629299321; bh=ICYoRp5pZT VsuHWOrKUSHnzVcWuzrw6IK6MmTdXZbuU=; b=mBZoSz8Gn+96f2gAmC0nFyI7d0 DzCR1NxUS3zAtBL+kBHtovbnmAibZXBlX2QV/URiI3rPZmq+mGy0gpZQ/f8lMy6u F4aHP6cQrd9iQ7REBPOzAyuEx9yV2/+kNGtl76GSzk1T2WXyV3zRK1ofjnGrCb7z fh9j2GO+eqVrieVXPrZfhwcejjYQ4M1bBhHQZu8FkcnhdpBslAId42I8+tLzlPBW o2kKXncIPGY/Whc07vfdqzYP8O2iaWO+BpCZg4JGi0DOOK3QGLUGS7jizDdTF+c7 uHByKucpo0/ZDFFw00Ai+fKRWnidnEPhjci5BgD8It2peOv6ve6FbhgcyT1Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1629299325; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zDnhRncZEBK7QOE1PSqSdUR/el9JR/iDyYbLw5ADBrw=; b=rvVYonya2wwM6dh9b2aJdKN0DxcuOPeqIKqHQ6f9xaHxOgjwLDckJAwUeY+iteFWBhxRuU 0UOjVDsrZTK6oeDvukWgBHx1rLVTkXDnSTJImh2heBfOXKdx2n88lVGiHtEr1moYF5rtIQ 3BD2ATPHsgzr5GD8fJ3z/VHWgw8qoXCTw/dkWwF/477rZuTHgfZCEN96xZxuI4scv49pPw O/Ej1iXSl2vbK8NwAs14E6xkfhSYK5hlKG05xICPQWqy4PZda9Qlnce7JoCAUliUTRBtl2 sYBPtVT/ziem6BmzyxlxqAhm1ZIiOi5rQMjYuGgzpCGBt6//WRoOPD6VGTnLew== X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id z8NIfc79jt6B; Wed, 18 Aug 2021 17:08:41 +0200 (CEST) Date: Wed, 18 Aug 2021 17:08:40 +0200 (CEST) From: torvic9@mailbox.org To: Borislav Petkov Cc: "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "clang-built-linux@googlegroups.com" , "graysky@archlinux.us" , "masahiroy@kernel.org" , Christoph Hellwig Message-ID: <1708009975.124311.1629299321026@office.mailbox.org> In-Reply-To: References: <269701460.117528.1629210189833@office.mailbox.org> <796036867.117557.1629210288168@office.mailbox.org> Subject: Re: [PATCH 2/2] x86, Makefile: Add new generic x86-64 settings v2/v3/v4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: B96591838 X-Rspamd-UID: b07b87 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Borislav Petkov hat am 17.08.2021 20:36 geschrieben: > > > On Tue, Aug 17, 2021 at 04:24:48PM +0200, torvic9@mailbox.org wrote: > > Add new generic x86-64 CPU tunings introduced with recent versions of > > gcc and clang, as documented in x86-64-psABI [1]. > > > > This is taken straight from graysky's CPU optimization patch with minor > > modifications [2]. > > > > [1] https://gitlab.com/x86-psABIs/x86-64-ABI/-/commit/77566eb03bc6a326811cb7e9a6b9396884b67c7c > > [2] https://github.com/graysky2/kernel_compiler_patch > > > > Signed-off-by: Tor Vic > > --- > > arch/x86/Kconfig.cpu | 26 +++++++++++++++++++++++++- > > arch/x86/Makefile.cpu | 6 ++++++ > > 2 files changed, 31 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu > > index 814fe0d349b0..a2c872aa5a0b 100644 > > --- a/arch/x86/Kconfig.cpu > > +++ b/arch/x86/Kconfig.cpu > > @@ -294,6 +294,30 @@ config GENERIC_CPU > > Generic x86-64 CPU. > > Run equally well on all x86-64 CPUs. > > > > +config GENERIC_CPU_V2 > > + bool "Generic-x86-64-v2" > > + depends on ( CC_IS_GCC && GCC_VERSION > 110000 ) || ( CC_IS_CLANG && CLANG_VERSION >= 120000 ) > > + depends on X86_64 > > + help > > + Generic x86-64 CPU. > > + Run equally well on all x86-64 CPUs with min support of x86-64-v2. > > + > > +config GENERIC_CPU_V3 > > + bool "Generic-x86-64-v3" > > + depends on ( CC_IS_GCC && GCC_VERSION > 110000 ) || ( CC_IS_CLANG && CLANG_VERSION >= 120000 ) > > + depends on X86_64 > > + help > > + Generic x86-64-v3 CPU with v3 instructions. > > + Run equally well on all x86-64 CPUs with min support of x86-64-v3. > > + > > +config GENERIC_CPU_V4 > > + bool "Generic-x86-64-v4" > > + depends on ( CC_IS_GCC && GCC_VERSION > 110000 ) || ( CC_IS_CLANG && CLANG_VERSION >= 120000 ) > > + depends on X86_64 > > + help > > + Generic x86-64 CPU with v4 instructions. > > + Run equally well on all x86-64 CPUs with min support of x86-64-v4. > > Every once in a while, patches like that pop up without any real numbers > advocating for the additional and perhaps unnecessary complexity. > > If those -march switches don't bring any measureable improvements - and > I highly doubt they do - you shouldn't waste time with submitting them. Borislav, I ran some quick checks and benchmarks, and your doubts seem to be justified. A 5.14-rc6 kernel compiled with the default 'generic' and one built with 'x86-64-v3' even have the exact same uncompressed file size. Benchmarks were inconclusive as well. So I will only resubmit the first patch of this series, with the changes suggested by Masahiro and Christoph. > > Thx. > > -- > Regards/Gruss, > Boris. > > https://people.kernel.org/tglx/notes-about-netiquette