All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hepkin <davidhep@microsoft.com>
To: Andy Lutomirski <luto@amacapital.net>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>,
	KY Srinivasan <kys@microsoft.com>,
	Mathew John <mathewj@microsoft.com>,
	Theodore Ts'o <tytso@mit.edu>,
	"John Starks" <John.Starks@microsoft.com>,
	kvm list <kvm@vger.kernel.org>, "Gleb Natapov" <gleb@kernel.org>,
	Niels Ferguson <niels@microsoft.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Jake Oshins <jakeo@microsoft.com>,
	"Linux Virtualization"
	<virtualization@lists.linux-foundation.org>
Subject: RE: Standardizing an MSR or other hypercall to get an RNG seed?
Date: Thu, 18 Sep 2014 21:46:05 +0000	[thread overview]
Message-ID: <0180a8dfcad746a895755c4374853c16@BY2PR03MB585.namprd03.prod.outlook.com> (raw)
In-Reply-To: <CALCETrUGS_V2h_beStbVyoTC8vuKiudmJwt55Q2BJg=S2KCNKw@mail.gmail.com>

I'm not sure what you mean by "this mechanism?"  Are you suggesting that each hypervisor put "CrossHVPara\0" somewhere in the 0x40000000 - 0x400fffff CPUID range, and an OS has to do a full scan of this CPUID range on boot to find it?  That seems pretty inefficient.  An OS will take 1000's of hypervisor intercepts on every boot just to search this CPUID range.

I suggest we come to consensus on a specific CPUID leaf where an OS needs to look to determine if a hypervisor supports this capability.  We could define a new CPUID leaf range at a well-defined location, or we could just use one of the existing CPUID leaf ranges implemented by an existing hypervisor.  I'm not familiar with the KVM CPUID leaf range, but in the case of Hyper-V, the Hyper-V CPUID leaf range was architected to allow for other hypervisors to implement it and just show through specific capabilities supported by the hypervisor.  So, we could define a bit in the Hyper-V CPUID leaf range (since Xen and KVM also implement this range), but that would require Linux to look in that range on boot to discover this capability.

Thanks...

David

-----Original Message-----
From: Andy Lutomirski [mailto:luto@amacapital.net] 
Sent: Thursday, September 18, 2014 12:07 PM
To: Paolo Bonzini
Cc: Jun Nakajima; KY Srinivasan; Mathew John; Theodore Ts'o; John Starks; kvm list; Gleb Natapov; Niels Ferguson; David Hepkin; H. Peter Anvin; Jake Oshins; Linux Virtualization
Subject: Re: Standardizing an MSR or other hypercall to get an RNG seed?

On Thu, Sep 18, 2014 at 11:58 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>> > Actually, that MSR address range has been reserved for that 
>> > purpose, along
>> > with:
>> > - CPUID.EAX=1 -> ECX bit 31 (always returns 0 on bare metal)
>> > - CPUID.EAX=4000_00xxH leaves (i.e. HYPERVISOR CPUID)
>>
>> I don't know whether this is documented anywhere, but Linux tries to 
>> detect a hypervisor by searching CPUID leaves 0x400xyz00 for 
>> "KVMKVMKVM\0\0\0", so at least Linux can handle the KVM leaves being 
>> in a somewhat variable location.
>>
>> Do we consider this mechanism to work across all hypervisors and 
>> guests?  That is, could we put something like "CrossHVPara\0"
>> somewhere in that range, where each hypervisor would be free to 
>> decide exactly where it ends up?
>
> That's also possible, but extending the hypervisor CPUID range beywond 
> 400000FFH is not officially sanctioned by Intel.
>
> Xen started doing that in order to expose both Hyper-V and Xen CPUID 
> leaves, and KVM followed the practice.
>

Whoops.

Might Intel be willing to extend that range to 0x40000000 - 0x400fffff?  And would Microsoft be okay with using this mechanism for discovery?

Do we have anyone from VMware in this thread?  I don't have any VMware contacts.

--Andy

  parent reply	other threads:[~2014-09-18 22:01 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  2:50 Standardizing an MSR or other hypercall to get an RNG seed? Andy Lutomirski
2014-09-18 14:40 ` KY Srinivasan
2014-09-18 14:40 ` KY Srinivasan
2014-09-18 14:43   ` H. Peter Anvin
2014-09-18 15:38     ` Andy Lutomirski
2014-09-18 15:44       ` Andy Lutomirski
2014-09-18 15:58         ` Paolo Bonzini
2014-09-18 16:36       ` KY Srinivasan
2014-09-18 17:13         ` Nakajima, Jun
2014-09-18 17:17           ` Paolo Bonzini
2014-09-18 17:17           ` Paolo Bonzini
2014-09-18 17:20             ` Jake Oshins
2014-09-18 17:20             ` Jake Oshins
2014-09-18 17:20             ` KY Srinivasan
2014-09-18 17:20             ` KY Srinivasan
2014-09-18 17:42               ` Nakajima, Jun
2014-09-18 18:35                 ` Andy Lutomirski
2014-09-18 18:39                   ` H. Peter Anvin
2014-09-18 18:54                     ` Niels Ferguson
2014-09-18 19:03                       ` Andy Lutomirski
2014-09-18 21:54                         ` David Hepkin
2014-09-19  6:04                           ` Paolo Bonzini
2014-09-18 21:54                         ` David Hepkin
2014-09-18 18:58                   ` Paolo Bonzini
2014-09-18 19:07                     ` Andy Lutomirski
2014-09-18 21:21                       ` Nakajima, Jun
2014-09-18 21:35                         ` Andy Lutomirski
2014-09-18 21:46                       ` David Hepkin [this message]
2014-09-18 21:57                         ` H. Peter Anvin
2014-09-18 22:07                           ` Andy Lutomirski
2014-09-19  0:49                             ` Nakajima, Jun
2014-09-19  0:49                             ` Nakajima, Jun
2014-09-19  1:03                               ` Andy Lutomirski
2014-09-19  1:28                                 ` Andy Lutomirski
2014-09-19 16:14                                   ` Nakajima, Jun
2014-09-19 16:22                                     ` Paolo Bonzini
2014-09-19 16:40                                     ` H. Peter Anvin
2014-09-19 17:21                                       ` Andy Lutomirski
2014-09-19 17:36                                         ` H. Peter Anvin
2014-09-19 17:39                                           ` Andy Lutomirski
2014-09-19 22:05                                       ` Theodore Ts'o
2014-09-19 22:06                                         ` Andy Lutomirski
2014-09-19 22:57                                           ` Nakajima, Jun
2014-09-19 22:57                                           ` Theodore Ts'o
2014-09-19 23:12                                             ` Andy Lutomirski
2014-09-19 23:29                                               ` H. Peter Anvin
2014-09-19 23:35                                                 ` Theodore Ts'o
2014-09-19 23:41                                                   ` Andy Lutomirski
2014-09-20  0:06                                                   ` H. Peter Anvin
2014-09-19 23:29                                               ` H. Peter Anvin
2014-09-19  1:28                                 ` Andy Lutomirski
2014-09-18 22:00                         ` Andy Lutomirski
2014-09-18 22:03                           ` H. Peter Anvin
2014-09-19 16:37                           ` Gleb Natapov
2014-09-19 16:40                             ` H. Peter Anvin
2014-09-19 16:53                               ` Gleb Natapov
2014-09-19 17:08                                 ` H. Peter Anvin
2014-09-19 17:15                                   ` Gleb Natapov
2014-09-19 17:18                                     ` H. Peter Anvin
2014-09-19 17:49                                       ` Gleb Natapov
2014-09-19 18:02                                         ` Andy Lutomirski
2014-09-19 18:12                                           ` Gleb Natapov
2014-09-19 18:20                                             ` Andy Lutomirski
2014-09-19 20:53                                               ` Gleb Natapov
2014-09-22  4:11                                               ` Alok Kataria
2014-09-19 17:18                                     ` H. Peter Anvin
2014-09-19 17:21                                 ` Andy Lutomirski
2014-09-19 17:59                                   ` Gleb Natapov
2014-09-19 17:59                                   ` Gleb Natapov
2014-09-18 21:46                       ` David Hepkin
2014-09-18 18:56                 ` Paolo Bonzini
2014-09-18 16:36       ` KY Srinivasan
2014-09-19 18:30 ` Christopher Covington
2014-09-19 18:42   ` Andy Lutomirski
2014-09-19 20:21     ` Nadav Amit
2014-09-19 20:46       ` Andy Lutomirski
2014-09-19 21:46         ` H. Peter Anvin
2014-09-22 13:31           ` Christopher Covington
2014-09-22 14:17             ` H. Peter Anvin
2014-09-22 14:18               ` H. Peter Anvin
2014-09-22 23:01             ` H. Peter Anvin
2014-09-21 12:39         ` Paolo Bonzini
2014-09-19 20:21     ` Nadav Amit
2014-09-22 13:33     ` Christopher Covington

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0180a8dfcad746a895755c4374853c16@BY2PR03MB585.namprd03.prod.outlook.com \
    --to=davidhep@microsoft.com \
    --cc=John.Starks@microsoft.com \
    --cc=gleb@kernel.org \
    --cc=hpa@zytor.com \
    --cc=jakeo@microsoft.com \
    --cc=jun.nakajima@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kys@microsoft.com \
    --cc=luto@amacapital.net \
    --cc=mathewj@microsoft.com \
    --cc=niels@microsoft.com \
    --cc=pbonzini@redhat.com \
    --cc=tytso@mit.edu \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.