Received: by 10.192.165.148 with SMTP id m20csp3409769imm; Mon, 23 Apr 2018 06:11:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+JzZu21gAiRXzOQNjE82VrZF3RW3pKBf0N2jz3u3BpOUhf5M0xq7M05SJkuS2gBi97Z+Cx X-Received: by 10.98.86.204 with SMTP id h73mr18965345pfj.47.1524489085784; Mon, 23 Apr 2018 06:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524489085; cv=none; d=google.com; s=arc-20160816; b=BMNMIcvATe+cDgePiHB9Sstgqq53+WpGGqRCh/WGZlrvl1bbRdbiLiXroYygJpvndD 8fyeikAtAIqIHn+edw9apC7Wl+j3GWZTl7PA9tUzgmzzfAqQZtZaL7+kSpActVwqPFgK XMQEw/fHwcEiKIJmaHNcgAGWsKo/+jhlotd+ejT4r97j2RpTeZMhQh1kjSooJWbJB7Vc 73u6n5ueaPx+abL7xpE0sYcW0CFh21F96qk+8MnCprcEhb5CCHnu4cPzd7Dw15dmLV5/ Ahw5Ct8944DQqL+BDFdTh3K9g7dUIY1P5u115eofR/NNLjGAvWz//xmrDe7YSC6Q6MR8 o29A== 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:arc-authentication-results; bh=ihQJC/0JvsX0iGGMtEjNgGWw0x/d4BKc6ztzdb9CVlE=; b=XTONEAwbNgPzmC17EYExoWqbVymL50mz6YYba6l/G0pxGCTuIwQ6NR3S2/a3F1zpOY 8NArS0DrUCfDkrTwNBEg8GlBHlONqWNmQGXvaBLxBjAik7pHtvkFVBrOUH1ciacy7CSc HZ4axpdAC7YrcrOeY/g45GPxWh8vI/DJVBlTRml8PdOansFw5+wkHn0s7ULZ2Ybx05wu Amk9IS1rBZPbp4bodTotEyAYsMy+37g3+SGygUxsU2s60AszlRf8spNrZOklE2S9A+xc 3msls6ZTwdf2TyzY70hjWDMtcTKpoUHAXNQkyyTINcj0PeDR8SCWglj5w3WK6waEYLdm VtqQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e187si5631772pgc.127.2018.04.23.06.11.11; Mon, 23 Apr 2018 06:11:25 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755212AbeDWNIu (ORCPT + 99 others); Mon, 23 Apr 2018 09:08:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58044 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755124AbeDWNIp (ORCPT ); Mon, 23 Apr 2018 09:08:45 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EE93E30BC116; Mon, 23 Apr 2018 13:08:44 +0000 (UTC) Received: from localhost (ovpn-116-52.gru2.redhat.com [10.97.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC60978BB7; Mon, 23 Apr 2018 13:08:35 +0000 (UTC) Date: Mon, 23 Apr 2018 10:08:23 -0300 From: Eduardo Habkost To: Borislav Petkov Cc: Paolo Bonzini , Wanpeng Li , LKML , kvm , Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] KVM: X86: Allow userspace to define the microcode version Message-ID: <20180423130823.GM29865@localhost.localdomain> References: <24cd527d-5287-f0be-ffe8-eab341bf1d94@redhat.com> <3866d359-0ef8-6a99-6254-84890be62b93@redhat.com> <20180226122205.GG4377@pd.tnic> <20180417202417.GA29865@localhost.localdomain> <20180418090329.GJ29865@localhost.localdomain> <20180423125849.GD22238@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180423125849.GD22238@pd.tnic> X-Fnord: you can see the fnord User-Agent: Mutt/1.9.2 (2017-12-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 23 Apr 2018 13:08:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 02:58:49PM +0200, Borislav Petkov wrote: > On Wed, Apr 18, 2018 at 12:36:37PM +0200, Paolo Bonzini wrote: > > On 18/04/2018 11:03, Eduardo Habkost wrote: > > >>> QEMU setting ucode_rev automatically using the host value when > > >>> using "-cpu host" (with no need for explicit ucode_rev option) > > >>> makes sense to me. > > >> QEMU can't get the host value by rdmsr MSR_IA32_UCODE_REV directly > > >> since rdmsr will #GP when ring !=0, any idea? > > > By looking at kvm_get_msr_feature(), it looks like > > > ioctl(system_fd, KVM_GET_MSRS) would return the host MSR value > > > for us. > > > > Yes, that's exactly what it was introduced for (together with other MSRs > > including VMX capabilities). > > Can't qemu do: > > grep microcode /proc/cpuinfo | awk '{ print $3 }' | head -n 1 It could, but why would QEMU do it if a real API already exists for that? -- Eduardo