Received: by 10.192.165.156 with SMTP id m28csp768463imm; Tue, 17 Apr 2018 20:25:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4899MuHG4Hp5vAEIYX9403Hb5WKxcotiFX3g/QVPgIeDjQHleTMh+8la3Ry4IJxDBAhixxY X-Received: by 10.101.78.18 with SMTP id r18mr379864pgt.128.1524021947345; Tue, 17 Apr 2018 20:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524021947; cv=none; d=google.com; s=arc-20160816; b=hxkliVqXhYsSRc5HBIe7wZXtYR570cGfC1IbllVeCImfGH1Rie1/u3ARv0CcmbPk+D pTbxvEPSULBP42xVVVbzSmaA47R1eSaEkXHqI6GByLgchFOCvYDYMBr9OVm55G8pS3rk s3wO7IbHrYukG/6MyGKHARW8mcXhDwmMrm/V9l0iZjqq9GkYlCxMdY/yPLjowsXN+5eK jfXltnM3HYLwps5waCOtaypFuODGnzhvpk/L2cgdpg65Ugzd7XRtMhKx1i7A9kCdTrdB 8tolfjzhCsJCx0S2kz9FQuVCvspUC6WbCaZU020U9Q4fbgWWNma7TJiyx7VM2AHlf93w 8mgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=bkxDKWK6FfO6Gq7/RSn7SpOyhwxdJWNjubbkAkzA80A=; b=aDuHRlWTTKfLV7JFzMwhya7xGsT5BF76lTCDL1/d/fcNL+Giqcfhz/nSIZNcEuSgwj 6/2t17zNx3Cx4zlh8ENGt6qFnVBaTKOuCKQW1FmUxMtzg4RZZqoo7GrNySgmG4i53aoV k2kPRQ9El+tAvRaqizp5fdJWNf2hJB9fWHc46wmKx8pCKt9EZBsmsV+cowHLvwPI05t8 62syxOPvUaw/1yIjOxTLXaoNsUWEtbU47piEUa53qaoo3zU2M649xri+8x9UK//KyTcB OSsiHR3NlmZ/MtwI8zzCu4IndDVyFFyKS35+G3KZTagC01nrgwtfJWGkSOk4QS6xeTen b0Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=u0bgu2Qf; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d21-v6si286321pll.460.2018.04.17.20.25.33; Tue, 17 Apr 2018 20:25:47 -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=@gmail.com header.s=20161025 header.b=u0bgu2Qf; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753612AbeDRDYY (ORCPT + 99 others); Tue, 17 Apr 2018 23:24:24 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:44619 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753499AbeDRDYX (ORCPT ); Tue, 17 Apr 2018 23:24:23 -0400 Received: by mail-oi0-f66.google.com with SMTP id e11-v6so289037oii.11; Tue, 17 Apr 2018 20:24:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=bkxDKWK6FfO6Gq7/RSn7SpOyhwxdJWNjubbkAkzA80A=; b=u0bgu2Qf4n2HtDKRTMRFdYbDM1kCIaMHDt3LUiqH7OWmbcJS3NGzXVxGdOmP+oIRBP DdLwSjw08udv82g4x6SgbgE00knpFNkmf27XE/HCApgV9NvNEX1+yX7+2PF4LrhPpZHe DnRwX3d4j+RamOkCoZW15NIg3VeA/jB93F1auDlHhocoTlnSUKoYpODgAAU2QzHxyw1d Tx220KbdlxkgfMgyJfnb61NMRUFoKm3ThMvNcI0wjurxZ5XoK7Bx31KGLo6zL/2ssuUh k5nljtnFzglcD2Dsw0aW9mfCubMD24VHouXn/xIDYWMJ7EOnYx8Xln4DiDZJivNRu+C3 E6lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bkxDKWK6FfO6Gq7/RSn7SpOyhwxdJWNjubbkAkzA80A=; b=H4FVpviIxkpiE2UKMaT5Yi1PfpGUjuuy2fOoWj5ZXxjVCW1pzCGwrcTojBn5IEmhQu CekkfxaA4GW4dgdJriCL1fOyHdHXJc6mAoFqVNvAaF+gTS5EuUTre1j7ZEXGPSzKLXiJ 7OYzfyV9URdlZywObJE+uxdg/SudjD+0WQ/xyjBaw8yS9jhl0Do24j7JPbPQg7MMqri9 JlD7AKVfQgMsCW9IgaCrpzxiTKYWnhWpre81ahE1dqUDoVRMiQp58OqDFsKwYDkdLnJ5 yepKD2o3ocZb8D+sk12jG4eo78HeJaj12En7/Nda+fbjo9ft889jBgbu0y/mhrIVIe5e GCLQ== X-Gm-Message-State: ALQs6tBPgAwuqtw84j2P7zxkK3KT98DMmueYw1jjV5SDJPiVVLgXfA7M 4e0q5DUkXYwQnuCX0d8As8KJIYRNyJ63B73MVYw= X-Received: by 2002:aca:5253:: with SMTP id g80-v6mr217120oib.186.1524021862680; Tue, 17 Apr 2018 20:24:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.210.78 with HTTP; Tue, 17 Apr 2018 20:24:22 -0700 (PDT) In-Reply-To: <20180417202417.GA29865@localhost.localdomain> References: <20180226113000.GC4377@pd.tnic> <20180226114409.GD4377@pd.tnic> <46cecef2-b0fb-b0c2-bbf3-983328d52763@redhat.com> <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> From: Wanpeng Li Date: Wed, 18 Apr 2018 11:24:22 +0800 Message-ID: Subject: Re: [PATCH] KVM: X86: Allow userspace to define the microcode version To: Eduardo Habkost Cc: Paolo Bonzini , Borislav Petkov , LKML , kvm , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-04-18 4:24 GMT+08:00 Eduardo Habkost : > On Tue, Apr 17, 2018 at 06:40:58PM +0800, Wanpeng Li wrote: >> Cc Eduardo, >> 2018-02-26 20:41 GMT+08:00 Paolo Bonzini : >> > On 26/02/2018 13:22, Borislav Petkov wrote: >> >> On Mon, Feb 26, 2018 at 01:18:07PM +0100, Paolo Bonzini wrote: >> >>>> In this context, "host-initiated" write means written by KVM userspace >> >>>> with ioctl(KVM_SET_MSR). It generally happens only on VM startup, reset >> >>>> or live migration. >> >>> >> >>> To be clear, the target of the write is still the vCPU's emulated MSR. >> >> >> >> So how am I to imagine this as a user: >> >> >> >> qemu-system-x86_64 --microcode-revision=0xdeadbeef... >> > >> > More like "-cpu foo,ucode_rev=0xdeadbeef". But in practice what would >> > happen is one of the following: >> > >> > 1) "-cpu host" sets ucode_rev to the same value of the host, everyone >> > else leaves it to zero as is now. >> >> Hi Paolo, >> >> Do you mean the host admin to get the ucode_rev from the host and set >> to -cpu host, ucode_rev=xxxxxx or qemu get the ucode_rev directly by >> rdmsr? > > 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? Regards, Wanpeng Li