Received: by 10.192.165.148 with SMTP id m20csp3396818imm; Mon, 23 Apr 2018 06:01:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx49wggIJFMrxZR68McjaAlN+3Q4aICWRN/q8s7UZ91v6J6fkaj+VqeCugU/U1ULBQAHpM2RX X-Received: by 10.98.24.214 with SMTP id 205mr19413961pfy.242.1524488462858; Mon, 23 Apr 2018 06:01:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524488462; cv=none; d=google.com; s=arc-20160816; b=ayPTe/idYNLsmB9D6/agOs37891ieIZ1y9M2zjZAaogWOqidJ/azggmaa7GD5QOBzv KvZrcGdRdUxaWrffyq7bcvvjlBDwaix0kvIH5ecJ8pI5FQsyfB+AXtQpxg0BIZFonM/4 3VIOEfvNzDLvNeX3JNMYkZ48q7szvMtuws/4bSZWHTpW6kALySCqJtP4zDzA5TV2pV0/ GvizqMuWjujkGxDeCYlIIxM85WzmyNAxkSjk0gaJDMRMwsvg6RSp+tb5bfszlR/yNrhV zLjtTDz7j7X+EzwzP44QQDIXJ285iaFew0jYi4g1Lz4ML0dT1KPGIrLkSn49TQv3ldPZ ezbA== 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=Xc/RZ08o2cH0oRTKOGL3487/qbs5YMsE4qTkdKbLVHY=; b=dZDrqtlgkzLF5RZ+/Y0PbXSlELhuh+L0z75SwtKQzQ0wGM39I0A6g42m7+fBH0nPAR 0aQy2o0ajRwTN4a1nKXND/gHSBJ67l9CVQK5Wr+e9nRhMxuORcYntT3Pf6egkXrUv4mZ /ABjVVouH69qIqlxQLkzfEQP1RhKlNdxkxXeaDbubPjXHwo66oNnI+HKbXJ6aV5hBynf Ti0mnfMInex5zl24DKZJNAtNc/oiKScNQniSMgdIA9vv0Pa2mZbhyO5ufrOFO7JwGozW sqTb/RQGrVv9skU8Hhl4PMkqt8aDLCqGLG6zEk0RNtbCVTphwzCHFeST3aeb70wS7bIB c/hw== 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 e6si8629802pgt.208.2018.04.23.06.00.48; Mon, 23 Apr 2018 06:01:02 -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 S1755302AbeDWM7S (ORCPT + 99 others); Mon, 23 Apr 2018 08:59:18 -0400 Received: from mail.skyhub.de ([5.9.137.197]:37012 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754874AbeDWM7O (ORCPT ); Mon, 23 Apr 2018 08:59:14 -0400 X-Virus-Scanned: Nedap ESD1 at mail.skyhub.de Received: from mail.skyhub.de ([127.0.0.1]) by localhost (blast.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vGGnkV_17U_E; Mon, 23 Apr 2018 14:58:57 +0200 (CEST) Received: from pd.tnic (p200300EC2BC8AC00557A5D25006EBC38.dip0.t-ipconnect.de [IPv6:2003:ec:2bc8:ac00:557a:5d25:6e:bc38]) (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 D7BE51EC0288; Mon, 23 Apr 2018 14:58:56 +0200 (CEST) Date: Mon, 23 Apr 2018 14:58:49 +0200 From: Borislav Petkov To: Paolo Bonzini Cc: Eduardo Habkost , Wanpeng Li , LKML , kvm , Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] KVM: X86: Allow userspace to define the microcode version Message-ID: <20180423125849.GD22238@pd.tnic> References: <20180226121509.GE4377@pd.tnic> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? :) -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.