public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: akataria@vmware.com
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	"Nakajima, Jun" <jun.nakajima@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	"avi@redhat.com" <avi@redhat.com>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Zach Amsden <zach@vmware.com>, Daniel Hecht <dhecht@vmware.com>
Subject: Re: Use CPUID to communicate with the hypervisor.
Date: Mon, 29 Sep 2008 17:31:31 -0700	[thread overview]
Message-ID: <48E17363.7060103@zytor.com> (raw)
In-Reply-To: <1222733523.30247.91.camel@alok-dev1>

Alok Kataria wrote:
> 
> Sure, some leaves have been defined already, but it's not too late to
> try to go the generic route for the remaining leaves.
> The longer we wait to come to a consensus on generic leaves, the more
> contention we will have.  So let's try to address it now.  
> 

We don't have a quorum to create a consensus, since we only have a 
subset of the relevant parties present.

We can get away with that if we agree on a standard that includes 
postive definition.

> 1. This solution really bloats the kernel, below are few observations

You have no basis for that assertion.

> i)  What happens if two ABI signature blocks define a cpuid leaf which
> have similar semantics, how does the kernel handle this ?

We already have this situation in a number of places.  The answer is 
generally that there is one form that the kernel prefer over another (in 
CPUID space, leaf 80000006 over leaf 2, for example) because it is 
better designed/more reliable/mode complete.

> ii) Also, think about a case where a hypervisor supports 2 such ABI
> blocks - which have cpuid leafs with similar semantics - and decides to
> implement one of those and not the other leaf. How does the kernel
> handle this ?

The standard way to handle that in CPUID space is to leave the 
unimplemented leaf as zero.

> I do understand that there are ways to handle this in the kernel but at
> the cost of just making the kernel more and more complicated for such
> corner cases.

The complexity is relatively minor.

> 2. Also as a side note, what you are proposing just breaks down the
> problem in to sub-problems, i.e we still need to make sure that the
> individual cpuid leafs in the "block of leaves" are still generic. Also
> we may still have situations where hypervisor "A" wants to define a
> subset of cpuid block X, hypervisor B had defined.

It gives individual sub-APIs positive identification.  This is similar 
to PCI capabilities, for example.

> 3. All in all, the end result of doing this would be that each
> hypervisor defines its own signature block forgetting about what the
> other hypervisor is doing. This is hardly generalizing this space.
> 
> Seriously, if we want to generalize this in the current situation, how
> about doing this ? 
> 
> 1. Have 0x40000000 as the hypervisor signature leaf.
> 2. Have 0x40000001-0x4000000F as the hypervisor specific leafs.
> 3. 0x40000010 - 0x400000FF as the generic space. 
> Use the non-zero meaning defined semantics for this generic space. 

As I said, I don't think we have any kind of quorum to declare such a 
"standard", and we'll see violations with failures as a result.

	-hpa

  reply	other threads:[~2008-09-30  0:36 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-26 23:46 Use CPUID to communicate with the hypervisor Alok Kataria
2008-09-27  0:09 ` H. Peter Anvin
2008-09-27  0:30   ` Alok Kataria
2008-09-27  0:32     ` H. Peter Anvin
2008-09-27  0:59       ` Nakajima, Jun
2008-09-27  1:55         ` H. Peter Anvin
2008-09-27  4:52           ` Nakajima, Jun
2008-09-29 20:56   ` Karel Zak
2008-09-27  1:02 ` Jeremy Fitzhardinge
2008-09-27  1:28   ` H. Peter Anvin
2008-09-27  3:11   ` Alok Kataria
2008-09-27  4:20     ` H. Peter Anvin
2008-09-27  5:37       ` Alok Kataria
2008-09-28  5:01     ` Jeremy Fitzhardinge
2008-09-29  9:28       ` Tim Deegan
2008-09-29  9:44         ` Avi Kivity
2008-09-29  6:55 ` Gleb Natapov
2008-09-29  7:37   ` Avi Kivity
2008-09-29  9:08     ` Bernd Eckenfels
2008-09-29  9:33       ` Gleb Natapov
2008-09-29 15:32     ` Nakajima, Jun
2008-09-30  9:16       ` Avi Kivity
2008-09-29  8:24 ` Gerd Hoffmann
2008-09-29 17:55   ` Alok Kataria
2008-09-29 17:58     ` H. Peter Anvin
2008-09-29 18:46     ` Gerd Hoffmann
2008-09-29 19:38       ` Alok Kataria
2008-09-29 20:31         ` H. Peter Anvin
2008-09-29 20:55         ` Nakajima, Jun
2008-09-29 21:07           ` H. Peter Anvin
2008-09-29 21:28             ` Jeremy Fitzhardinge
2008-09-29 21:49               ` H. Peter Anvin
2008-09-29 23:20               ` Zachary Amsden
2008-09-30  0:33                 ` H. Peter Anvin
2008-09-30  0:12               ` Alok Kataria
2008-09-30  0:31                 ` H. Peter Anvin [this message]
2008-09-30  0:56                   ` Nakajima, Jun
2008-09-30  0:58                     ` H. Peter Anvin
2008-09-30  1:14                       ` Nakajima, Jun
2008-09-30  2:21                         ` H. Peter Anvin
2008-09-30  3:14                           ` Nakajima, Jun
2008-09-30  3:48                             ` H. Peter Anvin
2008-09-29 22:46         ` Gerd Hoffmann
2008-09-30  0:33           ` Alok Kataria
2008-09-30  8:11             ` Gerd Hoffmann
2008-09-30 16:42               ` Zachary Amsden
2008-10-02 11:52                 ` Avi Kivity
2008-10-01  4:35               ` [Hypervisors] TSC frequency change Alok Kataria
2008-10-01  9:47                 ` Gerd Hoffmann

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=48E17363.7060103@zytor.com \
    --to=hpa@zytor.com \
    --cc=akataria@vmware.com \
    --cc=avi@redhat.com \
    --cc=dhecht@vmware.com \
    --cc=jeremy@goop.org \
    --cc=jun.nakajima@intel.com \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=zach@vmware.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox