Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp619688yba; Sun, 31 Mar 2019 08:15:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCMMfzqgQ78mcR/zLTkM3TTuWGM8CXYQFPMdPPCbFRQcbW9KQJa+VQX7M5MavksVyY18IG X-Received: by 2002:a63:525f:: with SMTP id s31mr55550896pgl.172.1554045317347; Sun, 31 Mar 2019 08:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554045317; cv=none; d=google.com; s=arc-20160816; b=UhZuoCHh27HfqWZXP1ZjKu453SRgkTl6mxzQqPBsTdjDO/gX+eVkJWRTUgnuxl8cfF lNfjjwUzYBeogzBWqMTNsJ9fAQdqlB/ygM2BUT/mlxMfruVsqn5q+gOnkwkHsa+XiP7Y dvt1jn+iu4Fcpa8YUwkYYWHIdjRS0C1Uy4p+jj6YzLz4aoZq2XoVzC4Ig9i1mipPkxiH BNsBZ/PKwvL1etI4kRwDQXf0jrHjmMfcFXLuUuBkjlFpT7A7JjMX8g2kyy+zyzTNYarj hloucg2ecHjZXGHE8bhOCeqeMhmgEUvpe53lZD+lD0+Ra0RlXLCWiuGv8xLppwAE3J7T bQ8g== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=svyDCcgq3wXfxeVOLwOH7ifKj0fK/+lF/VXXIcI/l8Y=; b=igm3v49s3HFlu/P46K1h8zI9h+zo0vuSj0vsxT0GTruF2STjBFxZRpGBphFs2OMbao Qt7jGvTer7Y/V28AHhMcmmJp8mL+aghns3+ywe8H7wLDDBjx3u8SXmOJo+zsWippxMHZ qD8HwGCC+qkdTv9xlka61V1ncmGXRvh9HgLffKyIInzhJTl1XFBACgx3YmGllHguGzQD YW4nazDGvQXCf6cniedlnjWJ47WxVtNTB9wjxH2AlmaQoUzcsMXfACkIax6GLPNWcNCb zc8ahD0FjEyoRgpYBmYyQvbpAoQYAHlOaKLrrgic2TD6gPtQgOo56U1m6LsmHhnAid2Z bU/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=fkf01x+d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w61si7138984plb.160.2019.03.31.08.14.59; Sun, 31 Mar 2019 08:15:17 -0700 (PDT) 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=pass header.i=@alien8.de header.s=dkim header.b=fkf01x+d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731256AbfCaPMz (ORCPT + 99 others); Sun, 31 Mar 2019 11:12:55 -0400 Received: from mail.skyhub.de ([5.9.137.197]:34516 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731211AbfCaPMz (ORCPT ); Sun, 31 Mar 2019 11:12:55 -0400 Received: from zn.tnic (p200300EC2F148A00A1B251568878E03A.dip0.t-ipconnect.de [IPv6:2003:ec:2f14:8a00:a1b2:5156:8878:e03a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id D44351EC05C4; Sun, 31 Mar 2019 17:12:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1554045174; 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:in-reply-to:in-reply-to: references:references; bh=svyDCcgq3wXfxeVOLwOH7ifKj0fK/+lF/VXXIcI/l8Y=; b=fkf01x+dO1z/ZXsnjlKrrfSvwNzolzy1kieaSr6sfqEjEejlg3kZNlbMCA87/M2EjDkF+t 03krVnV/HEv0FeFMAWc34FHcSzm/AIJpLMU+53sn8xnsEvDHRD1MFCsz7MFKP/Tjiq0Zau BO5Nvz+YoLWU+S5/U2WPQIj/aqPt7C0= Date: Sun, 31 Mar 2019 17:12:48 +0200 From: Borislav Petkov To: Paolo Bonzini Cc: LKML , Nadav Amit , Andy Lutomirski , Peter Zijlstra , "H. Peter Anvin" , Ingo Molnar , Joerg Roedel , kvm@vger.kernel.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , Thomas Gleixner , x86@kernel.org Subject: Re: [PATCH 3/5] x86/kvm: Convert some slow-path static_cpu_has() callers to boot_cpu_has() Message-ID: <20190331151248.GB15073@zn.tnic> References: <20190330112022.28888-1-bp@alien8.de> <20190330112022.28888-4-bp@alien8.de> <2f71cb35-46b2-9ed5-28b3-c6eb5e647b46@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2f71cb35-46b2-9ed5-28b3-c6eb5e647b46@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 31, 2019 at 04:20:11PM +0200, Paolo Bonzini wrote: > These are not slow path. Those functions do a *lot* of stuff like a bunch of MSR reads which are tens of cycles each at least. I don't think a RIP-relative MOV and a BT: movq boot_cpu_data+20(%rip), %rax # MEM[(const long unsigned int *)&boot_cpu_data + 20B], _45 btq $59, %rax #, _45 are at all noticeable. On latest AMD and Intel uarch those are 2-4 cycles, according to https://agner.org/optimize/instruction_tables.ods -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.