Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3314147ybl; Sun, 1 Sep 2019 10:27:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQto5jODjLOQ9Qa7qY9nkUuKIrLT6B7ZSzntj1CvJYfiHqmLkAdCNIIXpeFtrCpfcnVRkX X-Received: by 2002:a17:90a:cf0b:: with SMTP id h11mr3646814pju.95.1567358844815; Sun, 01 Sep 2019 10:27:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567358844; cv=none; d=google.com; s=arc-20160816; b=QdLZEIcOqHOF6ew62ZazdhbyRwyrVpP70xSQPNWh39mfACVl9jUtiGdqXN3J74w/Ij 4NaXymZW3lkwkRuWU5pdCZyq7kePHbRMv+IMhM752AAoLQtrYZ5/3CzfyUYwK6TqxyZj 9vwIf1tpmKjaWclBQFKedgbrSyg4eLI0HNE2Ogk0M4EUOhdzV+ltc15DzAdJvFWDRhyh BhtdFmlR78nnJM1l1s+iGfmjAlEP4fUaiSK4eKcg32dBTnigsn4tioLW49O2w5Lm2W0O ZXxEXy+W6RMTcSK945IBkX3PFUo0oP8T54IyKu+8fuah8MpR793JVw12XzN4og14e29i oZ5g== 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; bh=D1pub74e6UihUUpTnxfyllqM8Z0+TaiXxowzQA5emBs=; b=CCJFlmFvLIQrxQRTLKYicjNOan5XXtt+xCtwkpTQOwvHokHj3ba4p5Y6jQDKQJkMC+ Zb1Hbd9n/Y8oEDVlhl+asR2oSN7fFf5aAoeFlSQ51AJJwKw2nSCAz6/+kjRs2siEZbsb 6HY3AsG4m/LUpKIURxdTUekgC0rcrCfrHw5LZn0v0jQarxUpEqgIv56FrynHfXazXvMB ozI00JO4I4nnnltBWmZDe+4aqg68nrenep37P9c1bR+QMFvUD4X/iJrvtFJeOq5E7CmK 8bEQoVy2fw9dtB36vVx7OFk944lJN5+/kRf488JG6VqeVO5FXXOMrbxj8D4AtazxDuYB hj1Q== ARC-Authentication-Results: i=1; mx.google.com; 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 u2si9353956pgm.242.2019.09.01.10.27.09; Sun, 01 Sep 2019 10:27:24 -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; 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 S1729007AbfIARZu (ORCPT + 99 others); Sun, 1 Sep 2019 13:25:50 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:39672 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728570AbfIARZu (ORCPT ); Sun, 1 Sep 2019 13:25:50 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 7EBC5817A5; Sun, 1 Sep 2019 19:25:34 +0200 (CEST) Date: Sun, 1 Sep 2019 19:25:47 +0200 From: Pavel Machek To: Mihai Carabas Cc: linux-kernel@vger.kernel.org, bp@alien8.de, ashok.raj@intel.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, patrick.colp@oracle.com, kanth.ghatraju@oracle.com, Jon.Grimm@amd.com, Thomas.Lendacky@amd.com Subject: Re: [PATCH] Parallel microcode update in Linux Message-ID: <20190901172547.GD1047@bug> References: <1566506627-16536-1-git-send-email-mihai.carabas@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1566506627-16536-1-git-send-email-mihai.carabas@oracle.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > + u64 p0, p1; > int ret; > > atomic_set(&late_cpus_in, 0); > atomic_set(&late_cpus_out, 0); > > + p0 = rdtsc_ordered(); > + > ret = stop_machine_cpuslocked(__reload_late, NULL, cpu_online_mask); > + > + p1 = rdtsc_ordered(); > + > if (ret > 0) > microcode_check(); > > pr_info("Reload completed, microcode revision: 0x%x\n", boot_cpu_data.microcode); > > + pr_info("p0: %lld, p1: %lld, diff: %lld\n", p0, p1, p1 - p0); > + > return ret; > } > > We have used a machine with a broken microcode in BIOS and no microcode in > initramfs (to bypass early loading). > > Here are the results for parallel loading (we made two measurements): > [ 18.197760] microcode: updated to revision 0x200005e, date = 2019-04-02 > [ 18.201225] x86/CPU: CPU features have changed after loading microcode, but might not take effect. > [ 18.201230] microcode: Reload completed, microcode revision: 0x200005e > [ 18.201232] microcode: p0: 118138123843052, p1: 118138153732656, diff: 29889604 > Here are the results of serial loading: > > [ 17.542518] microcode: updated to revision 0x200005e, date = 2019-04-02 > [ 17.898365] x86/CPU: CPU features have changed after loading microcode, but might not take effect. > [ 17.898370] microcode: Reload completed, microcode revision: 0x200005e > [ 17.898372] microcode: p0: 149220216047388, p1: 149221058945422, diff: 842898034 > > One can see that the difference is an order magnitude. Well, that's impressive, but it seems to finish 300 msec later? Where does that difference come from / how much real time do you gain by this? Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html