Received: by 10.223.176.5 with SMTP id f5csp1184345wra; Fri, 2 Feb 2018 12:42:12 -0800 (PST) X-Google-Smtp-Source: AH8x227w0kfTrHncR168hHzrEw5qfFRom8lORttqm1wNwojG8TCnMY48n4Bz0Ga1nDKdVjNiUB8m X-Received: by 10.99.110.10 with SMTP id j10mr15240334pgc.72.1517604132632; Fri, 02 Feb 2018 12:42:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517604132; cv=none; d=google.com; s=arc-20160816; b=FNx9rjstuFt2OYcVDOKYnNDhpEnhZWze7nEkOdH+Y9QPc8E8ZeB8wDJG15UK5ktKB3 ccGJbuvTz7crfLOd7hbvH3G8NQe7d+MP1kVzXq4qZgEQvBgMox9lqhyAgVsgKMxy0pRI qWMjJMJuANiLH64Jr2yPpu+1jJOKANvus/r8AEzhDUwxvSrMBMogcW2fnqhz9jyVznA0 YJykxBdSJP7LUOLXeiwrC0sZ7VfRE5Jz4Evl7Kwmsfi3tv5ZnnxBKKu16WwucWsDS4q0 wuDlx86KJ7O0zt+zBzpjRJfrn2+1OlOEBaQKDbNcLSUJDiX5SIiXnL3oYGXWrTpZdtPS SAfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=9rH31yFVHYdaWLtUZVh8M+NdFnPoPOI4g/C4wefVNK8=; b=yxThfdHIjs3hj46LSpFLjDys8P04fD4Ms2urZfkIRnDDTsHM9FQlxMz8DY5TgGFeCk JlL2SZhcgxU/4o3kozuXy09ZY26JtXeb+WA5fdN3hmar5YL4NEuNxy7/moUU4abosAp9 uAzZV/uHvbjQpKTRW4wIpmGSxMVvXlRC5LlwVsplkF/3pdaLKPRKytuInp/B/pqoCol3 dzeG4txK/kDI5t4k59cu+9XSnhlTB0rYH9GLg4IngrwjMPRWKroiNDajf0JRTJ03MmWs YKF7EL5O59Tq1uUL1ckfGBXv7ljr2ixyqyyuf96cLut8Y/Scx4VgY7ywl/FSC4e+woYO B+Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=s841umX2; 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 j3-v6si365034pld.676.2018.02.02.12.41.58; Fri, 02 Feb 2018 12:42:12 -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=s841umX2; 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 S1752910AbeBBTK2 (ORCPT + 99 others); Fri, 2 Feb 2018 14:10:28 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:33619 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751958AbeBBTKU (ORCPT ); Fri, 2 Feb 2018 14:10:20 -0500 Received: by mail-it0-f68.google.com with SMTP id u12-v6so2600268ite.0; Fri, 02 Feb 2018 11:10:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9rH31yFVHYdaWLtUZVh8M+NdFnPoPOI4g/C4wefVNK8=; b=s841umX2Q8yU0vHcJocSaN/MpmAIp3zyCKszxvBdSNlb5kmzHYGPRel1jPa2wGeLaO +GklMATCUllGca1mjtuftK1mBDSPrkP/QDBpHUeYGaSc2GsWbb/1GkRUliurFxZKtXgi yI3IVtDcNqaS3ecClpkAeSrr1GyIjsod65p0BGDJsrISB3xC6dRXqrZKosVybb+uFbIY zpUqb8Vi3ivxewgceJquDRoD/P3Ts6LQOZfi0Q71Y1yYu9SRBmP2lyziDjLL5KslhgTS UrMMewsqNzywxjb1FLSHpKe7P/2BkYY1Jd/HMp/8bC4YTSHa4uOT80kLklg5YU32m+hg eQrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9rH31yFVHYdaWLtUZVh8M+NdFnPoPOI4g/C4wefVNK8=; b=E6In0VbYaxWDdx7WqHnxK4ExrljpwLN04y8YLwMkH6FIFxUOFlJ5kydNYUlbd+MRUi YtPRdi0KrFyD8p/CwQqBZ05RHtlwh62vdiSOAmAvhD9HsLnEZ5aGkqBZqeIvi2oEz98F TBPOpn51YOkZia9vnuycOUR3SIHArETlwd8sgRLTkcahX6nxhl0R/rSYaMwBsLuj5ReD ET23qRnHCSJCTuPtxbXiBfYL8ZAwGbcwp25E+VUJICcs1ay6MDfBj1KFTPSRwRmu5gSP sRYzxobX/TE7q6FdmlS8tgGJNygr3bmsjbvcNiDe1UD2wMziLbshMomNDeH+72gMa9NV N5dA== X-Gm-Message-State: AKwxyte2nurWNDmtbS02PDyPrOowfS7kbrySNsiZJkrPhZExNsovWVPy BYgZnZTD3J90SDq7LZ/MsQgHGIx8OndFDCbvEqY= X-Received: by 10.36.47.5 with SMTP id j5mr45133787itj.123.1517598620041; Fri, 02 Feb 2018 11:10:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.59.196 with HTTP; Fri, 2 Feb 2018 11:10:19 -0800 (PST) In-Reply-To: References: <1517583559-424-1-git-send-email-dwmw@amazon.co.uk> From: Linus Torvalds Date: Fri, 2 Feb 2018 11:10:19 -0800 X-Google-Sender-Auth: 6SK_2tR_S35z2EFi0xn5IwfesRs Message-ID: Subject: Re: [PATCH] KVM: x86: Reduce retpoline performance impact in slot_handle_level_range() To: David Woodhouse Cc: Thomas Gleixner , KarimAllah Ahmed , sironi@amazon.de, "the arch/x86 maintainers" , KVM list , Paolo Bonzini , Linux Kernel Mailing List , Borislav Petkov , Peter Zijlstra Content-Type: multipart/mixed; boundary="001a1143ce48a9509a05643f7663" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --001a1143ce48a9509a05643f7663 Content-Type: text/plain; charset="UTF-8" On Fri, Feb 2, 2018 at 10:50 AM, Linus Torvalds wrote: > > Will it make for bigger code? Yes. But probably not really all *that* > much bigger, because of how it also will allow the compiler to > simplify some things. Actually, testing this with my fairly minimal config, it actually makes for *smaller* code to inline those things. That may be a quirk of my configuration, or maybe I screwed something else up, but: [torvalds@i7 linux]$ size ~/mmu.o arch/x86/kvm/mmu.o text data bss dec hex filename 85587 9310 120 95017 17329 /home/torvalds/mmu.o 85531 9310 120 94961 172f1 arch/x86/kvm/mmu.o so the attached patch actually shrank things down by about 50 bytes because of the code simplification. Of course, I have been known to screw up retpoline testing in the past, so my numbers are suspect ;). Somebody should double-check me. Linus --001a1143ce48a9509a05643f7663 Content-Type: text/plain; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jd6b0z5x0 IGFyY2gveDg2L2t2bS9tbXUuYyB8IDEwICsrKysrLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA1IGlu c2VydGlvbnMoKyksIDUgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvYXJjaC94ODYva3ZtL21t dS5jIGIvYXJjaC94ODYva3ZtL21tdS5jCmluZGV4IDJiOGViNGRhNGQwOC4uYjlmMGRlNmUzMDli IDEwMDY0NAotLS0gYS9hcmNoL3g4Ni9rdm0vbW11LmMKKysrIGIvYXJjaC94ODYva3ZtL21tdS5j CkBAIC01MDU4LDcgKzU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