Received: by 10.223.176.46 with SMTP id f43csp4007101wra; Tue, 23 Jan 2018 02:45:34 -0800 (PST) X-Google-Smtp-Source: AH8x227YLx79vqPvcLcjKL/WyBqrtoqFM57J1fHFbPfDn540Aveons1hr+T5LE88CG/qClZ8RwPG X-Received: by 2002:a17:902:7083:: with SMTP id z3-v6mr5295852plk.404.1516704334118; Tue, 23 Jan 2018 02:45:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516704334; cv=none; d=google.com; s=arc-20160816; b=w1gdw+7Vat3waOk1yUIuuNrA9vkyOn10Y0MFwXTP7VtcxRsrda3wyWqdfHPARBauXF 6sU3RfyG01t0nBsRp8AtuX/aPAeZ7Mp94SCg/BlWerolOW2Axa4lBJybEj2fhQJOF8Ks mEMi7iDTXDlMbO4z8iYVXnnjtJqFQgQmegBRlzkt2yzsfPVm/L9IIUYH+m3iyCIyg6uy Hfb/vE9ul/Lu/8pgjaFmyeejF4CR8fZsvpauqtbYaqGBoD3XAfvGknm3ROutOLULRe9a JGm4E4ihAX3OCLEVeXjLml9z/jXSeTONb3Jc3xvOAE4h4b7EVuEBa2+Sc6d3XUrUKU/i YykQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=YAWYFMhQX+vTnERCew9XnisUEGI7ZOXkHi7BtPsRVls=; b=rLRuCIXnOh/EsbHAPYncUtH7OlT+1B+10H/CsmK4TqKDEPYAychVWRIzJfE166+y0P TJUEQSKqPdP7toqedR+An6GdTlJaZHeiHAzk4fUtdPhOAOOoTsgV7tsXWAOYTnZvG3AL k6G/NNussF+GLMDaArHh3pkB+7Z/v7HJumYmZAgqQQAAMWqtiFcgU1YaMmga2o3yKboz fMIXUTiyQAsn635EVBqbnJ1C9prZVmqwMKE5OEnU4XOf6ebvUN9AM4G9w0pMkCouxr7z eXHZepeDqlIQ5ww6jqq7F+otMIlCbIfrXc3UY+BA9v5VNMej05SUxtm28xRb8nzr5Pcv 74ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=W1h9nTWq; 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 r3-v6si4522311pls.821.2018.01.23.02.45.19; Tue, 23 Jan 2018 02:45:34 -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=fail header.i=@gmail.com header.s=20161025 header.b=W1h9nTWq; 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 S1751505AbeAWKoh (ORCPT + 99 others); Tue, 23 Jan 2018 05:44:37 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:38815 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751279AbeAWKoZ (ORCPT ); Tue, 23 Jan 2018 05:44:25 -0500 Received: by mail-wr0-f195.google.com with SMTP id x1so20828wrb.5; Tue, 23 Jan 2018 02:44:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=YAWYFMhQX+vTnERCew9XnisUEGI7ZOXkHi7BtPsRVls=; b=W1h9nTWqPkdFHKakqmKQTOdRNLOUADJfq5qY0cw5+shl5tdIv9IxA3DpuN2q3GPW1Q 1Ka+t1LRpqgH/dnoaqhDlP2seKQJSZ+29zlna2b5ZDkHaEk8MCAnJro9MFlgjAmJ/O86 1pkhFLmOYeM1PLvljSmLt7+oIKtKmLOW++IgBLW2iC7XeHouU+dlhpHJU3A5vS9p2kf3 QBP0vVgOYX3XM/0GwOGXVmEEAC1aLwabv/N1LzodI3XkGicEllOZN38To073pF8X+IdJ qGiPGXZ4w/3RtSERiw8eGaTiTJFuvGlPkRt2A07hOijyWy9sofWD3wXSlt830lRq/ZgN fDiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=YAWYFMhQX+vTnERCew9XnisUEGI7ZOXkHi7BtPsRVls=; b=bVsRQ5MoP4yTHm72yuQMDHzrM+a0LJIqcjkRXejYbzzcUzHHDtr6nfqPkq7nIrmPln ra6fwUfQHAe8cgm4zTzxC6ejx4rwsQmNyQ6XQSx6wcoyG88BjKQD8x9x7Pc6SWALQXaL wiHc8Hk6i1eiw2zO3/VmgCiMRbjFxQ1K/mDzAQWnqQlOzniY5+ePyBYqsOnVpiibLASA cqGN7dUz4DOQkhkoKGDVp0EoszKh8zEEgWzsStnzC8eiIF4zPZnz3gBZUP7VGl/3yo8M MxEENuiebcXNfPL8NCfEAY4CwUiBlQ7JUWEcw8RLvJdKLD/3Guw0g0MvfyKWwaz0EnqB cSVg== X-Gm-Message-State: AKwxytflGoica003jMDxYQhmzedOv+UK1PV11l2pY047b/XjKYCCrety LbCS+hHojs4rAoBLUQysjqY= X-Received: by 10.223.133.150 with SMTP id 22mr1989894wrt.176.1516704263939; Tue, 23 Jan 2018 02:44:23 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id 186sm7032074wmu.16.2018.01.23.02.44.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2018 02:44:23 -0800 (PST) Date: Tue, 23 Jan 2018 11:44:20 +0100 From: Ingo Molnar To: David Woodhouse Cc: Linus Torvalds , KarimAllah Ahmed , Linux Kernel Mailing List , Andi Kleen , Andrea Arcangeli , Andy Lutomirski , Arjan van de Ven , Ashok Raj , Asit Mallick , Borislav Petkov , Dan Williams , Dave Hansen , Greg Kroah-Hartman , "H . Peter Anvin" , Ingo Molnar , Janakarajan Natarajan , Joerg Roedel , Jun Nakajima , Laura Abbott , Masami Hiramatsu , Paolo Bonzini , Peter Zijlstra , Radim =?utf-8?B?S3LEjW3DocWZ?= , Thomas Gleixner , Tim Chen , Tom Lendacky , KVM list , the arch/x86 maintainers , Arjan Van De Ven Subject: Re: [RFC 09/10] x86/enter: Create macros to restrict/unrestrict Indirect Branch Speculation Message-ID: <20180123104420.nnuugvqrm7tx7ta7@gmail.com> References: <1516566497.9814.78.camel@infradead.org> <1516572013.9814.109.camel@infradead.org> <1516638426.9521.20.camel@infradead.org> <20180123072930.soz25cyky3u4hpgv@gmail.com> <20180123075358.nztpyxympwfkyi2a@gmail.com> <1516699832.9521.123.camel@infradead.org> <20180123101532.obioudsu3ecm4rez@gmail.com> <1516703244.9521.132.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1516703244.9521.132.camel@infradead.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * David Woodhouse wrote: > On Tue, 2018-01-23 at 11:15 +0100, Ingo Molnar wrote: > > > > BTW., the reason this is enabled on all distro kernels is because the overhead > > is? a single patched-in NOP instruction in the function epilogue, when tracing > > is? disabled. So it's not even a CALL+RET - it's a patched in NOP. > > Hm? We still have GCC emitting 'call __fentry__' don't we? Would be nice to get > to the point where we can patch *that* out into a NOP... or are you saying we > already can? Yes, we already can and do patch the 'call __fentry__/ mcount' call site into a NOP today - all 50,000+ call sites on a typical distro kernel. We did so for a long time - this is all a well established, working mechanism. > But this is a digression. I was being pedantic about the "0 cycles" but sure, > this would be perfectly tolerable. It's not a digression in two ways: - I wanted to make it clear that for distro kernels it _is_ a zero cycles overhead mechanism for non-SkyLake CPUs, literally. - I noticed that Meltdown and the CR3 writes for PTI appears to have established a kind of ... insensitivity and numbness to kernel micro-costs, which peaked with the per-syscall MSR write nonsense patch of the SkyLake workaround. That attitude is totally unacceptable to me as x86 maintainer and yes, still every cycle counts. Thanks, Ingo