From: Avi Kivity <avi@redhat.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right
Date: Thu, 24 Nov 2011 12:45:09 +0200 [thread overview]
Message-ID: <4ECE2035.1070905@redhat.com> (raw)
In-Reply-To: <1322131078.4248.15.camel@lappy>
On 11/24/2011 12:37 PM, Sasha Levin wrote:
> On Thu, 2011-11-24 at 12:33 +0200, Avi Kivity wrote:
> > On 11/24/2011 12:31 PM, Sasha Levin wrote:
> > > >
> > > > The protocol goes like "try size x, if it fails with -E2BIG, increase x,
> > > > try again". Its awkward.
> > >
> > > We can set nent to be the amount of entries required like we do in the
> > > opposite case where we passed too many entries.
> >
> > There's no point, since userspace will want to support older kernels.
>
> In the case of old kernels the cpuid->nent value will not be modified,
> so userspace can handle both cases easily:
>
> - If KVM_GET_SUPPORTED_CPUID returned -E2BIG, check cpuid->nent
> - If zero, do same -E2BIG loop as we do now.
> - If not, allocate amount needed and pass it to the ioctl again.
>
What's the point? The code becomes more complicated.
Something like 'while (try_get_cpuid(x) == -E2BIG) { x *= 2; }' is
simple and works everywhere.
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2011-11-24 10:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-17 10:18 [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right Sasha Levin
2011-11-17 10:18 ` [PATCH 2/2] KVM: Correct documentation of KVM_GET_SUPPORTED_CPUID Sasha Levin
2011-12-04 17:37 ` Sasha Levin
2011-11-24 10:09 ` [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right Marcelo Tosatti
2011-11-24 10:31 ` Sasha Levin
2011-11-24 10:33 ` Avi Kivity
2011-11-24 10:37 ` Sasha Levin
2011-11-24 10:45 ` Avi Kivity [this message]
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=4ECE2035.1070905@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=mtosatti@redhat.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 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.