Received: by 10.223.185.116 with SMTP id b49csp8440158wrg; Fri, 2 Mar 2018 01:39:32 -0800 (PST) X-Google-Smtp-Source: AG47ELuq9jFMx6ppukDyglyoF379iA9nySdd3nG2QW85betpt4IBn90ZOV/zCQHVy18J8z3ga+VQ X-Received: by 10.167.129.24 with SMTP id b24mr5051785pfi.183.1519983571955; Fri, 02 Mar 2018 01:39:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519983571; cv=none; d=google.com; s=arc-20160816; b=uVEAhRvf49ZaZ+BnCuBEYS0aa126QNsdNLJCGN1hONdWbdNSxG1fOsIVKD8hAZFX48 x6xEefAS7/qGw1DlmmM0jgJK9ZUs+JRM9JJQZxaTfkQDSbnStWHDvUqZ3NAxUbLTCnsX I7shpFNYDpcRtjKcBPDQ/NCl2LRdfw0t7AL1RunEaDHz6JY6HvfdJlTwNvsRZ2yHp3+6 5hgHw/vR3PppwnQBSZAIadd5Dp02I62Y0C5yA2qB3HGMwxMK0QJvyUyncH31SDiryde/ IksbtQyLWW/gComwbeFWvgX9x5MTy67gwoGVDs2b3Yf7Yzvon2wfKNP4s1SSRzaLA2DR 3zmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=LUTxatcuo8ftI/gT8yNF1kU/7ptDScERhjG0ICE2yy8=; b=DBeJud6UTSpsQr20B5/Ul0gMsq/iGkNXFDKemnLvvZlRzXQ0bp3yv9HxyVkvLvM92b RFmfLr4MTGEdrDIDrbuoUp4V6Nqr20y/pnpltH4FTuL2mV/qtoMZWz3G9OxRgsVUT++V yO9u1A+YJH/K0jK8wF41DT+pi9gK/F6zaSC7ZHDdiaTEU6SGblDVvOlYjZ8AkthNVIvA 13s8bJkIl4y0s7LAqbmoxbhRlf25A8qaU072A1BNJZ/dUDbIcXQSZ2bHmi8crbTrS+EX PHFmD9vJRoOMs+YIO0gde7SmriI+uTh8L98f/tIwaECj/oLDQSkpmERJ0MsnA0fOA9t9 BLeQ== 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 r15-v6si4462020pls.127.2018.03.02.01.39.17; Fri, 02 Mar 2018 01:39:31 -0800 (PST) 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 S1425851AbeCBJhg (ORCPT + 99 others); Fri, 2 Mar 2018 04:37:36 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35912 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1424982AbeCBJg0 (ORCPT ); Fri, 2 Mar 2018 04:36:26 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0C2918182D27; Fri, 2 Mar 2018 09:36:26 +0000 (UTC) Received: from [10.36.116.70] (ovpn-116-70.ams2.redhat.com [10.36.116.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D5B4B200BCAF; Fri, 2 Mar 2018 09:36:24 +0000 (UTC) Subject: Re: [PATCH] KVM: VMX: expose the host's ARCH_CAPABILITIES MSR to userspace To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Cc: Konrad Rzeszutek Wilk , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, David Woodhouse , KarimAllah Ahmed References: <1519433546-33879-1-git-send-email-pbonzini@redhat.com> <20180226221300.GK22024@char.us.oracle.com> <20180301213205.GB29001@flask> From: Paolo Bonzini Message-ID: Date: Fri, 2 Mar 2018 10:36:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180301213205.GB29001@flask> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 02 Mar 2018 09:36:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Fri, 02 Mar 2018 09:36:26 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pbonzini@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/03/2018 22:39, Radim Krčmář wrote: > [Resent after removing g@char.us.oracle.com.] > > 2018-02-26 17:13-0500, Konrad Rzeszutek Wilk: >> On Sat, Feb 24, 2018 at 01:52:26AM +0100, Paolo Bonzini wrote: >>> Use the new MSR feature framework to expose the ARCH_CAPABILITIES MSR to >>> userspace. This way, userspace can access the capabilities even if it >>> does not have the permissions to read MSRs. >> >> ... That is good but could you expand a bit of why it would want this? >> >> I am 99% sure it is due to the lovely spectre_v2 mitigation but >> could you include that in the commit message so that in say a year >> folks would know what this is? > > Userspace can currently get the MSR by creating a VCPU and reading its > MSR_IA32_ARCH_CAPABILITIES, because it is set from the hardware MSR. > > I thought that "permissions to read MSRs" talked about hardware MSRs, so > the purpose of this patch would be a better interface, but I don't see > how if we keep the auto-setting on VCPU creation. Yeah, it's mostly about a better interface and being able to do checks before creating the VCPU. The commit message was written before I noticed the auto-setting on VCPU creation, and I failed to update it. Thanks, Paolo > Is this aimed towards userspaces that want nothing else from KVM than > the MSR value? > > Thanks. >