All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: kvm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com>
Subject: Re: [PATCH v2] KVM: Refactor and simplify kvm_dev_ioctl_get_supported_cpuid
Date: Mon, 28 Nov 2011 12:08:47 +0200	[thread overview]
Message-ID: <4ED35DAF.7060401@redhat.com> (raw)
In-Reply-To: <4ED359DE.6060005@redhat.com>

On 11/28/2011 11:52 AM, Avi Kivity wrote:
> On 11/28/2011 11:20 AM, Sasha Levin wrote:
> > This patch cleans and simplifies kvm_dev_ioctl_get_supported_cpuid by using a table
> > instead of duplicating code as Avi suggested.
> >
> > This patch also fixes a bug where kvm_dev_ioctl_get_supported_cpuid would return
> > -E2BIG when amount of entries passed was just right.
> >
> >  	do_cpuid_1_ent(entry, function, index);
> >  	++*nent;
> >  
> > @@ -275,7 +282,10 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
> >  
> >  		entry->flags |= KVM_CPUID_FLAG_STATEFUL_FUNC;
> >  		entry->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT;
> > -		for (t = 1; t < times && *nent < maxnent; ++t) {
> > +		for (t = 1; t < times; ++t) {
> > +			if (*nent >= maxnent)
> > +				goto out;
> > +
> >  			do_cpuid_1_ent(&entry[t], function, 0);
> >  			entry[t].flags |= KVM_CPUID_FLAG_STATEFUL_FUNC;
> >  			++*nent;
>
> Please move the check into do_cpuid_1_ent(); it's more consistent.
>
>

Given that do_cpuid_1_ent() doesn't receive nent/maxent, I applied this;
thanks.

-- 
error compiling committee.c: too many arguments to function


      reply	other threads:[~2011-11-28 10:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28  9:20 [PATCH v2] KVM: Refactor and simplify kvm_dev_ioctl_get_supported_cpuid Sasha Levin
2011-11-28  9:52 ` Avi Kivity
2011-11-28 10:08   ` 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=4ED35DAF.7060401@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.