Re: Standardizing an MSR or other hypercall to get an RNG seed?

5 messages, 4 authors, 2014-09-18 · open the first message on its own page

Re: Standardizing an MSR or other hypercall to get an RNG seed?

From: "H. Peter Anvin" <hpa@zytor.com>
Date: 2014-09-18 14:43:09

On 09/18/2014 07:40 AM, KY Srinivasan wrote:
quoted
The main questions are what MSR index to use and how to detect the
presence of the MSR.  I've played with two approaches:

1. Use CPUID to detect the presence of this feature.  This is very easy for
KVM to implement by using a KVM-specific CPUID feature.  The problem is
that this will necessarily be KVM-specific, as the guest must first probe for
KVM and then probe for the KVM feature.  I doubt that Hyper-V, for
example, wants to claim to be KVM.  If we could standardize a non-
hypervisor-specific CPUID feature, then this problem would go away.
We would prefer a CPUID feature bit to detect this feature.
 
I guess if we're introducing the concept of pan-OS MSRs we could also
have pan-OS CPUID.  The real issue is to get a single non-conflicting
standard.

	-hpa

Re: Standardizing an MSR or other hypercall to get an RNG seed?

From: Andy Lutomirski <luto@amacapital.net>
Date: 2014-09-18 15:38:02

On Thu, Sep 18, 2014 at 7:43 AM, H. Peter Anvin [off-list ref] wrote:
On 09/18/2014 07:40 AM, KY Srinivasan wrote:
quoted
quoted
The main questions are what MSR index to use and how to detect the
presence of the MSR.  I've played with two approaches:

1. Use CPUID to detect the presence of this feature.  This is very easy for
KVM to implement by using a KVM-specific CPUID feature.  The problem is
that this will necessarily be KVM-specific, as the guest must first probe for
KVM and then probe for the KVM feature.  I doubt that Hyper-V, for
example, wants to claim to be KVM.  If we could standardize a non-
hypervisor-specific CPUID feature, then this problem would go away.
We would prefer a CPUID feature bit to detect this feature.
I guess if we're introducing the concept of pan-OS MSRs we could also
have pan-OS CPUID.  The real issue is to get a single non-conflicting
standard.
Agreed.

KVM currently puts 0 in 0x40000000.EAX, meaning that a feature bit in
Microsoft's leaf 0x40000003 would probably not work well for KVM.  I
don't expect that Microsoft wants to start claiming to be KVM for the
purpose of using a KVM-style feature bit, so, if we went the CPUID
route, we would probably need something new.

--Andy
        -hpa


-- 
Andy Lutomirski
AMA Capital Management, LLC

Re: Standardizing an MSR or other hypercall to get an RNG seed?

From: Andy Lutomirski <luto@amacapital.net>
Date: 2014-09-18 15:44:29

On Thu, Sep 18, 2014 at 8:38 AM, Andy Lutomirski [off-list ref] wrote:
On Thu, Sep 18, 2014 at 7:43 AM, H. Peter Anvin [off-list ref] wrote:
quoted
On 09/18/2014 07:40 AM, KY Srinivasan wrote:
quoted
quoted
The main questions are what MSR index to use and how to detect the
presence of the MSR.  I've played with two approaches:

1. Use CPUID to detect the presence of this feature.  This is very easy for
KVM to implement by using a KVM-specific CPUID feature.  The problem is
that this will necessarily be KVM-specific, as the guest must first probe for
KVM and then probe for the KVM feature.  I doubt that Hyper-V, for
example, wants to claim to be KVM.  If we could standardize a non-
hypervisor-specific CPUID feature, then this problem would go away.
We would prefer a CPUID feature bit to detect this feature.
I guess if we're introducing the concept of pan-OS MSRs we could also
have pan-OS CPUID.  The real issue is to get a single non-conflicting
standard.
Agreed.

KVM currently puts 0 in 0x40000000.EAX, meaning that a feature bit in
Microsoft's leaf 0x40000003 would probably not work well for KVM.  I
don't expect that Microsoft wants to start claiming to be KVM for the
purpose of using a KVM-style feature bit, so, if we went the CPUID
route, we would probably need something new.
Slight correction: QEMU/KVM has optional support for Hyper-V feature
enumeration.  Ideally the RNG seed mechanism would be enabled by
default, but I don't know whether the QEMU maintainers would be okay
with enabling the Hyper-V cpuid mechanism in a default configuration.

--Andy
--Andy
quoted
        -hpa


--
Andy Lutomirski
AMA Capital Management, LLC


-- 
Andy Lutomirski
AMA Capital Management, LLC

Re: Standardizing an MSR or other hypercall to get an RNG seed?

From: Paolo Bonzini <pbonzini@redhat.com>
Date: 2014-09-18 15:58:25

Il 18/09/2014 17:44, Andy Lutomirski ha scritto:
Slight correction: QEMU/KVM has optional support for Hyper-V feature
enumeration.  Ideally the RNG seed mechanism would be enabled by
default, but I don't know whether the QEMU maintainers would be okay
with enabling the Hyper-V cpuid mechanism in a default configuration.
Some guests cannot find the KVM leaves at 0x40000100, so it wouldn't be
great.  And I also don't know what VMware folks would think, but I think
they would be even less thrilled than me.

Note that even if there is no well-defined CPUID leaf, and the main
detection mechanism is #GP, each hypervisor is free to define a CPUID
bit of its own.

However, if it's going to be an architectural (Intel-defined) MSR, I
think the right place for a feature bit is in the low leaves (like
EAX=7, ECX=0).

Paolo

RE: Standardizing an MSR or other hypercall to get an RNG seed?

From: KY Srinivasan <kys@microsoft.com>
Date: 2014-09-18 16:36:45

-----Original Message-----
From: Andy Lutomirski [mailto:luto@amacapital.net]
Sent: Thursday, September 18, 2014 8:38 AM
To: H. Peter Anvin
Cc: KY Srinivasan; Linux Virtualization; kvm list; Gleb Natapov; Paolo Bonzini;
Theodore Ts'o
Subject: Re: Standardizing an MSR or other hypercall to get an RNG seed?

On Thu, Sep 18, 2014 at 7:43 AM, H. Peter Anvin [off-list ref] wrote:
quoted
On 09/18/2014 07:40 AM, KY Srinivasan wrote:
quoted
quoted
The main questions are what MSR index to use and how to detect the
presence of the MSR.  I've played with two approaches:

1. Use CPUID to detect the presence of this feature.  This is very
easy for KVM to implement by using a KVM-specific CPUID feature.
The problem is that this will necessarily be KVM-specific, as the
guest must first probe for KVM and then probe for the KVM feature.
I doubt that Hyper-V, for example, wants to claim to be KVM.  If we
could standardize a non- hypervisor-specific CPUID feature, then this
problem would go away.
quoted
quoted
We would prefer a CPUID feature bit to detect this feature.
I guess if we're introducing the concept of pan-OS MSRs we could also
have pan-OS CPUID.  The real issue is to get a single non-conflicting
standard.
Agreed.

KVM currently puts 0 in 0x40000000.EAX, meaning that a feature bit in
Microsoft's leaf 0x40000003 would probably not work well for KVM.  I don't
expect that Microsoft wants to start claiming to be KVM for the purpose of
using a KVM-style feature bit, so, if we went the CPUID route, we would
probably need something new.

--Andy
I am copying other Hyper-V engineers to this discussion.

Regards,

K. Y
quoted
        -hpa


--
Andy Lutomirski
AMA Capital Management, LLC
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help