Received: by 10.213.65.68 with SMTP id h4csp1408125imn; Wed, 14 Mar 2018 21:04:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELvi+6b2QEJO4FUZFh3M9Sj2tG2R8QkWa05kjJo4DZ5ra5Y1pBO3PJOPbQRTJ2Czi2PWk+V6 X-Received: by 2002:a17:902:d90b:: with SMTP id c11-v6mr6642823plz.200.1521086686770; Wed, 14 Mar 2018 21:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521086686; cv=none; d=google.com; s=arc-20160816; b=R3Jz02ngyIGV2p1eir3UppFd7u8BgvXcRO8dxn6zC2GfrtdyRKX0HJVqKUaNF+tBTf +CBbxID3r8Hsr6ZzjN21XyPccyJV8OwMERE1HXBm7UTVKmVh1swxmKip0ElIOQNKQWuk eu6NMBLVdkIyPGgpdK3nqwvp7BcIA4xuBID97nsivbMuhYinttKLxVZY8A0xjjzHsYJh WF0wsLEAfU/qRZIPd7LAK7dic6FO23IMNXoncgwhyObIM/41bAQrIBoUxSffHl9lfrQB BL27b6bhHSo58pWa5ri3o9J6+nMTkBZmoIRfX1suweUtLLLHPr9Hs12OcyXqf6d10rpR 9Efg== 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:dkim-signature :arc-authentication-results; bh=Hq5r64vsn2JbvgODem2GhXM+TKtcCFhcT0hIuqNRYy4=; b=wSDbVts8157m2KAxdiqFwRcBOcSwkym89AtxwwI+mWKq8aL35S/KkrhZ2c/EzzDsLE elHTMOlbA9TXNfUjZECsXcL/PvQg64e1f4Sq+SMr+jEL3vFEKQYraa3aOYk6jj9prEgb 4O4TW+QIuWs9znPTswAhTX6RGbqoPh4cMypAtimTTP4YMK/q+toyt4t1ny6FXvRuOt3S auTCqnQUt7cbyUuwPBagp0PqJ8qja5/os5RI4+Khn8xa3Csbfkcm68l5eN6ftsd0D0FM hMb4y2KXjc2cxv/gbEmTtcHeNii8PcaN7Jp7B5CkzmWsX68TmCqvEFx0fdwGjiokU3Ch E8yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hmh.eng.br header.s=fm2 header.b=rtT0XSLe; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=OGkELGWF; 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 z1-v6si730674pll.302.2018.03.14.21.04.01; Wed, 14 Mar 2018 21:04:46 -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=@hmh.eng.br header.s=fm2 header.b=rtT0XSLe; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=OGkELGWF; 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 S1751699AbeCOEBi (ORCPT + 99 others); Thu, 15 Mar 2018 00:01:38 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:50273 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751650AbeCOEBg (ORCPT ); Thu, 15 Mar 2018 00:01:36 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id CC89320D96; Thu, 15 Mar 2018 00:01:35 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Thu, 15 Mar 2018 00:01:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hmh.eng.br; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Hq5r64vsn2JbvgODem2GhXM+TKtcCFhcT0hIuqNRYy4=; b=rtT0XSLe tVKUbV6gIF7N1UoAgCXlt/wMZc/l1LRE0RnS8DaEqftXVY0DDZUJ2eKKtHdSxcEC n5qr7gUnfkM/PcBnbwKo9k8/+ElRiA19xwnJllC4bqyL1q9d4U31b3fojqDxHimg 9xGPx0Qpc0qY8sJnaaobvQyESbaVl4oymCpaH1HnZdbZqv2U1cfwhVmILSu3KKU6 68QSFKndJHhtDTUZnhNoI+E+JAoCT37u3Rj0GpQ7D/hXdtOoiF0/upr9I4f1K/1+ N5OZK9Y74GcA8ns6KzP6qpGYqGoy4YHqyFVLgtSbncz3TWZfE/h6MfsnCQVSXxLz 1hsGbcJR/kibGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=Hq5r64vsn2JbvgODem2GhXM+TKtcC FhcT0hIuqNRYy4=; b=OGkELGWFK+kVcHlVnQbu9l1FO4rccHo/05oiWXVSB5jmz f0hbkkhvAtt0cUmP0fa+tWFHp4VhuoHbQikyGWd6O3ZRsBhflqfRQI9Cer+iWm94 nAGsVSb1qq808uIZZcnjkLCIcxBXBlRVPJ+hIL8UjR50l9MCaLZRSnwpBNQtr0I1 9dn7Zons5vH+877En8bcVFdoUepQOmzvVsUQx9yRaYx5Rmqc0eG/LkJ6h1NUGVeU UVQ1MDBldlDpMr+ho3MI9Fx5rxse4bNah28UP0lD7SpmgodaYcN8TIjMg9veivk9 7nUY3Evnw995Tzz44/mIKbd/Lp/JaSdjePrLNo0sw== X-ME-Sender: Received: from khazad-dum.debian.net (unknown [201.82.128.91]) by mail.messagingengine.com (Postfix) with ESMTPA id 665CC7E0F1; Thu, 15 Mar 2018 00:01:35 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by localhost.khazad-dum.debian.net (Postfix) with ESMTP id CFA1B3401307; Thu, 15 Mar 2018 01:01:33 -0300 (-03) X-Virus-Scanned: Debian amavisd-new at khazad-dum.debian.net Received: from khazad-dum.debian.net ([127.0.0.1]) by localhost (khazad-dum2.khazad-dum.debian.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id d-O1ONuFwyjw; Thu, 15 Mar 2018 01:01:33 -0300 (-03) Received: by khazad-dum.debian.net (Postfix, from userid 1000) id ED0483400BF5; Thu, 15 Mar 2018 01:01:32 -0300 (-03) Date: Thu, 15 Mar 2018 01:01:32 -0300 From: Henrique de Moraes Holschuh To: Borislav Petkov Cc: X86 ML , Emanuel Czirai , Ashok Raj , Tom Lendacky , LKML Subject: Re: [PATCH 2/2] x86/microcode: Fix CPU synchronization routine Message-ID: <20180315040132.m3i3ozykkbjrxa66@khazad-dum.debian.net> References: <20180314183615.17629-1-bp@alien8.de> <20180314183615.17629-2-bp@alien8.de> <20180315010014.xsedkarzrgqiunxf@khazad-dum.debian.net> <20180315010152.GE11061@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180315010152.GE11061@pd.tnic> X-GPG-Fingerprint1: 4096R/0x0BD9E81139CB4807: C467 A717 507B BAFE D3C1 6092 0BD9 E811 39CB 4807 User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Mar 2018, Borislav Petkov wrote: > On Wed, Mar 14, 2018 at 10:00:14PM -0300, Henrique de Moraes Holschuh wrote: > > Intel takes anything from twenty thousand cycles to several *million* > > cycles per core, proportional to microcode update size. > > Got any hard data to back that claim up? A reasonably well-known paper on intel microcode updates[1] profiled that very well, years ago (2013). The information about a linear increase in update time versus update size comes from that paper (I did not attempt to reproduce his findings, though). When I measured my Xeon X5550 workstation doing an early update, the Xeon took about 1M cycles for the BSP, and 800k cycles for the APs (see below). To measure that, as far as I recall I just did a rdtsc right before the wrmsr, and another right after, and stashed the result somewhere to be able to print it out later in the BSP's case. I repeated the process (by rebooting) a few times. There was a *lot* of variation, but not enough to get it wrong by an order of magnitude. I am surprised that this would be news to you, though. It is not like I have been quiet about how expensive these updates are on Intel over the past years every time I sent you a patch related to this... Anyway, here's my measurement data from 2013: Xeon X5550: microcode_early: CPU0: entire core updated early to revision 0x19, in 1016168 cycles microcode_early: CPU1: entire core updated early to revision 0x19, in 842264 cycles microcode_early: CPU2: entire core updated early to revision 0x19, in 846784 cycles microcode_early: CPU3: entire core updated early to revision 0x19, in 838196 cycles [1] HAWKES, Ben. "Notes on Intel Microcode Updates", March 2013. -- Henrique Holschuh