From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: Standardizing an MSR or other hypercall to get an RNG seed? Date: Fri, 19 Sep 2014 20:59:44 +0300 Message-ID: <20140919175944.GM26540@minantech.com> References: <1969371640.51211843.1411066715223.JavaMail.zimbra@redhat.com> <0180a8dfcad746a895755c4374853c16@BY2PR03MB585.namprd03.prod.outlook.com> <20140919163749.GI26540@minantech.com> <541C5C67.6040608@zytor.com> <20140919165349.GJ26540@minantech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jun Nakajima , Paolo Bonzini , Niels Ferguson , Linux Virtualization , Jake Oshins , kvm list , Theodore Ts'o , Mathew John , David Hepkin , "H. Peter Anvin" , KY Srinivasan , John Starks To: Andy Lutomirski Return-path: Received: from mail-wi0-f175.google.com ([209.85.212.175]:51686 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756107AbaISR7s (ORCPT ); Fri, 19 Sep 2014 13:59:48 -0400 Received: by mail-wi0-f175.google.com with SMTP id r20so3956wiv.14 for ; Fri, 19 Sep 2014 10:59:47 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Sep 19, 2014 at 10:21:27AM -0700, Andy Lutomirski wrote: > On Sep 19, 2014 9:53 AM, "Gleb Natapov" wrote: > > > > On Fri, Sep 19, 2014 at 09:40:07AM -0700, H. Peter Anvin wrote: > > > On 09/19/2014 09:37 AM, Gleb Natapov wrote: > > > > > > > > Linux detects what hypervior it runs on very early > > > > > > Not anywhere close to early enough. We're talking for uses like kASLR. > > > > > Still to early to do: > > > > h = cpuid(HYPERVIOR_SIGNATURE) > > if (h == KVMKVMKVM) { > > if (cpuid(kvm_features) & kvm_rnd) > > rdmsr(kvm_rnd) > > else (h == HyperV) { > > if (cpuid(hv_features) & hv_rnd) > > rdmsr(hv_rnd) > > else (h == XenXenXen) { > > if (cpuid(xen_features) & xen_rnd) > > rdmsr(xen_rnd) > > } > > > > I think that there's a lot of value in having each guest > implementation be automatically compatible with all hypervisors. For > example, you forgot VMware, and VMware might be less excited about > implementing this feature if all the guests won't immediately start > using it. > I "forgot" VMware because I do not see VMware people to be CCed. They may be even less excited about them being told _how_ this feature need to be implemented (e.g implement HyperV leafs for the feature detection). I do not want to and cannot speak for VMware, but my guess is that for them it would be much easier to add an else clause for VMware in above "if" then to coordinate with all hypervisor developers about MSR/cpuid details. And since this is security feature implementing it for Linux is in their best interest. -- Gleb.