Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp362011pxf; Wed, 10 Mar 2021 07:52:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzBbHoJtvCx8AcIISMPkm+M8qBCdF85CWhSOS1kVCtUGPiLSv6DNaMfyAfSnvr3ehfd10mF X-Received: by 2002:a05:6402:8c2:: with SMTP id d2mr4200884edz.4.1615391521816; Wed, 10 Mar 2021 07:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615391521; cv=none; d=google.com; s=arc-20160816; b=DRkMySlboufFXrClhRtw0FUnehPvKpuQk3cPpFWpHh5gX1bJEw1vs0MqWcgUzPx3yl T8xBjwQkokL+748DJx7NVr96l2gzjPZu7q9ZIFdAQIDh+uvUSrMIePRJOBGLrVXR2ZkB E18JjuxfYRKJ12hcdWMcTaDa77naP9Flh2dTxjs9uNaAfs8Hmp0+ohk5XMbkmNhsW7ld +DnwLBS7+BPhZcA1zHcJU1KLZUamk74Hm48SSb9tZ1hy+kSSQDaiOdy55q8BTwxOwsfx 1A/DdvsG9u5EVJHJoJqVJP3NFcD8t352Gw9fVmK14JwrPyg+9egMs6T1CAdl7miRpz2D FBWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=O0/izLC33QT8uxDOJE1OEYsC8LaFZNZhkqwpThuvR7o=; b=ATmg4OeyHCBgZKMqhHSt/JFiUQwpjHUGNGk3XfXww0vav5t2W8pA8fUWoDf2+IjWLu bX+v497f9ZoaeiuPTgZPKMuQ0MDY53YcQ66KAQJ7KWEjMfoO2aMKGy7oWnmDHgjDxqfE Ams+vmKMyFGbDI9as+hbvv4dOlFpukE2VxLS8w15b9pRRc/iuxs8fJT/BdOxD9kPe8/9 Z2toXUflieFOdpSK1TgA53qsrLdb6mtHBRMyctPGjxYe8E6sE0hmLabUXcXDZVawUzGY e2AA/gT7WggM1YGEqIS59E1V+ouXQFRSdTfVj9eP5Ollz31HnI3KmgIp11sB0bm6sqFn 6xBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LiVARqif; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ge14si1808140ejb.716.2021.03.10.07.51.39; Wed, 10 Mar 2021 07:52:01 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=LiVARqif; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232422AbhCJPsu (ORCPT + 99 others); Wed, 10 Mar 2021 10:48:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231244AbhCJPsV (ORCPT ); Wed, 10 Mar 2021 10:48:21 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98662C061760; Wed, 10 Mar 2021 07:48:21 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id 18so34225697lff.6; Wed, 10 Mar 2021 07:48:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O0/izLC33QT8uxDOJE1OEYsC8LaFZNZhkqwpThuvR7o=; b=LiVARqif4ZgNCwWk6sy+OjpAE5GiT2jzbCJvJ4wKJS1RiNbprqgYMgQEGEbxXnbwe7 KME6SXtyTmhFF9daV3WhRD4PxrU2L4vyjc12VqbM6R33Iz+B5HSMZYc6eA1q6asY4JVK JQMQl8cLIpgoUjLZ7whYSAmTX6T3AktcpTPyVdsFBmu6aVK0z10iaEXm1j+2A8McMFCc m8u/1UFX93SXCXNpE9TapvruXPSpPAFAPBoYPAIv+wz5nUgyVXcEzlq1hUliTm0vajz7 hh1Carc5gg91iIMAwcFupUR2lo0HRnhzBy03x1XOWuD/Z1g/ec66MHjGxKp1FEmiFBoZ 8zwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O0/izLC33QT8uxDOJE1OEYsC8LaFZNZhkqwpThuvR7o=; b=QCFEgr1vE9j2/hkYOaqjp361f1Zih6aUJmjVMcR2Cq2YeSPi7odcm97MvqeRV8DJL5 DIxDGDLIDr/p/Y32zExlAxZ80EI87U9zgT5gMWYUM5foqX93mWc3/bXsY1BDFkXwSTGF c7egbYPebAmYR07Y7rFHDat1Nj2MevjEa6jmN1aDj3HWnvn/9JlZ3qH8eQdGmndm+4LJ XaBiC2rz/d0nWQ5SgqUiRThtvdxNlbzbjhoSJ8rx3x0sj+cwb2dODIUG1An1eokJ0B1V sW3XjlAjOCG+br+8uID3kUCexAXzYP5jjvTrJltffTLsA5ZStxZZNj1D3TZirWcfB8lP NbcA== X-Gm-Message-State: AOAM531dPAIEGgwY+M9UGAguoOCAMRVz3jXhshp9Y4T1KvP/g+YcTmXW KIpDs/8Ak+cJVY9mjgVGAJnwwB093Sr9kVP39yc= X-Received: by 2002:a05:6512:2254:: with SMTP id i20mr2420918lfu.534.1615391300045; Wed, 10 Mar 2021 07:48:20 -0800 (PST) MIME-Version: 1.0 References: <20210309120519.7c6bbb97@gandalf.local.home> <362BD2A4-016D-4F6B-8974-92C84DC0DDB4@zytor.com> <20210310091324.0c346d5f@oasis.local.home> In-Reply-To: From: Alexei Starovoitov Date: Wed, 10 Mar 2021 07:48:08 -0800 Message-ID: Subject: Re: The killing of ideal_nops[] To: Peter Zijlstra , bpf Cc: Steven Rostedt , "H. Peter Anvin" , X86 ML , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 10, 2021 at 6:29 AM Peter Zijlstra wrote: > > On Wed, Mar 10, 2021 at 09:13:24AM -0500, Steven Rostedt wrote: > > On Wed, 10 Mar 2021 11:22:48 +0100 > > Peter Zijlstra wrote: > > > > > After this FEATURE_NOPL is unused except for required-features for > > > x86_64. FEATURE_K8 is only used for PTI and FEATURE_K7 is unused. > > > > > > AFAICT this negatively affects lots of 32bit (DONTCARE) and 32bit on > > > 64bit CPUs (CARELESS) and early AMD (K8) which is from 2003 and almost > > > 2 decades old by now (SHRUG). > > > > > > Everything x86_64 since AMD K10 (2007) was using p6_nops. > > > > > > And per FEATURE_NOPL being required for x86_64, all those CPUs can use > > > p6_nops. So stop caring about NOPs, simplify things and get on with life > > > :-) > > > > Before ripping out all the ideal_nop logic, I wonder if we should just > > force the nops you want now (that is, don't change the selected > > ideal_nops, just "pretend" that the CPU wants p6_nops), and see if anyone > > complains. After a few releases, if there's no complaints, then we can > > rip out the ideal_nop logic. > > Nah, just rip the entire thing out. You should be happy about > deterministic NOPs :-) Ack for bpf bits. I think the cleanup is good from the point of having one way to do things. Though I won't be surprised if somebody comes along with a patch to use different nops eventually. When I first looked at it years ago I was wondering why segment selector prefix is not used. afaik windows was using it, because having cs: ds: nop makes intel use only one of the instruction decoders (the big and slow one) which allegedly saves power, since the pipeline has bubbles. Things could be completely different now in modern u-arches.