linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: "Nakajima, Jun" <jun.nakajima@intel.com>,
	kvm-devel@lists.sourceforge.net, Avi Kivity <avi@qumranet.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [kvm-devel] [PATCH] Refactor hypercall infrastructure
Date: Mon, 17 Sep 2007 12:15:34 -0700	[thread overview]
Message-ID: <46EED256.40801@goop.org> (raw)
In-Reply-To: <46EEC6FE.5060306@us.ibm.com>

Anthony Liguori wrote:
> Nakajima, Jun wrote:
>>> I don't understand the purpose of returning the max leaf.  Who is that
>>> information useful for?
>>>     
>>
>> Well, this is the key info to the user of CPUID. It tells which leaves
>> are valid to use. Otherwise, the user cannot tell whether the results of
>> CPUID.0x4000000N are valid or not (i.e. junk). BTW, this is what we are
>> doing on the native (for the leaf 0, 0x80000000, for example). The fact
>> that Xen returns 0x40000002 means it only uses 3 leaves today.   
>
> Then it's just a version ID.  You pretty much have to treat it as a
> version id because if it returns 0x4000 0003 and you only know what
> 0002 is, then you can't actually use it.

Yeah.  It's the way all the other cpuid leaf/level stuff works, so it's
reasonable to do the same thing here.  The question it helps answer is
"I understand leaf 33, does the [v]CPU?".

> I much prefer the current use of CPUID in KVM.  If 1000 returns the
> KVM signature, then 1001 *must* be valid and contain a set of feature
> bits.  If we wish to use additional CPUID leaves in the future, then
> we can just use a feature bit.  The real benefit to us is that we can
> use a discontiguous set of leaves whereas the Xen approach is forced
> to use a linear set (at least for the result to be meaningful).

Well, its also what the CPU itself does.  The feature bits tend to
relate to specific CPU features rather than CPUID instruction leaves. 
The features themselves may also have corresponding leaves, but that's
secondary.  IOW, if feature bit X is set, it may use leaf 0x4000101f,
but that doesn't mean leaves 0x40001001-1f are necessarily defined.

> I'm starting to lean toward just using 0000.  If for no other reason
> than the hypercall space is unsharable.

Well, it could be, but it would take affirmative action on the guest's
part.  If there's feature bits for each supported hypercall interface,
then you could have a magic MSR to select which interface you want to
use now.  That would allow a generic-interface-using guest to probe for
the generic interface at cpuid leaf 0x40001000, use 40001001 to
determine whether the hypercall interface is available, 4000100x to find
the base of the magic msrs, and write appropriate msr to set the desired
hypercall style (and all this can be done without using vmcall, so it
doesn't matter that hypercall interface is initially established).

    J

  reply	other threads:[~2007-09-17 19:15 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-14 19:45 [PATCH] Refactor hypercall infrastructure Anthony Liguori
2007-09-14 20:53 ` Jeremy Fitzhardinge
2007-09-14 21:02   ` [kvm-devel] " Anthony Liguori
2007-09-14 21:20     ` Zachary Amsden
2007-09-14 21:44       ` Anthony Liguori
2007-09-15  3:37         ` Zachary Amsden
2007-09-15  8:08           ` Avi Kivity
2007-09-15 17:33           ` Anthony Liguori
2007-09-14 21:22     ` Jeremy Fitzhardinge
2007-09-14 21:46       ` Anthony Liguori
2007-09-14 21:52         ` Jeremy Fitzhardinge
2007-09-14 22:08           ` Anthony Liguori
2007-09-14 22:40             ` Nakajima, Jun
2007-09-14 23:00               ` Jeremy Fitzhardinge
2007-09-15  0:10                 ` Nakajima, Jun
2007-09-15  0:28                   ` Jeremy Fitzhardinge
2007-09-15  1:04                     ` Nakajima, Jun
2007-09-15  4:53                       ` Jeremy Fitzhardinge
2007-09-15  6:11                         ` Nakajima, Jun
2007-09-15 18:23                           ` Anthony Liguori
2007-09-17 18:14                             ` Nakajima, Jun
2007-09-17 18:27                               ` Anthony Liguori
2007-09-17 19:15                                 ` Jeremy Fitzhardinge [this message]
2007-09-17 19:33                                   ` Anthony Liguori
2007-09-17 19:15                               ` Jeremy Fitzhardinge
2007-09-17 20:52                                 ` Nakajima, Jun
2007-09-15  8:00               ` Avi Kivity
2007-09-15  7:53     ` Avi Kivity
2007-09-15  2:35   ` Rusty Russell

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=46EED256.40801@goop.org \
    --to=jeremy@goop.org \
    --cc=aliguori@us.ibm.com \
    --cc=avi@qumranet.com \
    --cc=jun.nakajima@intel.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).